diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 19bf4fcbd26..54a10128d86 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -96,8 +96,30 @@ /src/blueprint/ @fengzhou-msft +/src/storage-or-preview/ @Juliehzl + +/src/logic/ @bquantump + /src/databox/ @jsntcy /src/hpc-cache/ @qianwens +/src/timeseriesinsights/ @jiasli + +/src/portal/ @YalinLi0312 + +/src/import-export/ @arrownj + /src/account/ @zikalino + +/src/datashare/ @fengzhou-msft + +/src/k8sconfiguration/ @NarayanThiru + +/src/log-analytics-solution/ @zhoxing-ms + +/src/kusto/ @ilayr @orhasban @astauben + +/src/ai-did-you-mean-this/ @christopher-o-toole + +/src/custom-providers/ @jsntcy diff --git a/azure-cli-extensions.pyproj b/azure-cli-extensions.pyproj index 97b8809839b..f0b0aca658c 100644 --- a/azure-cli-extensions.pyproj +++ b/azure-cli-extensions.pyproj @@ -11,6 +11,7 @@ . {888888a0-9f3d-457c-b088-3a5042f75d52} Standard Python launcher + true @@ -2805,6 +2806,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4615,6 +4697,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4758,6 +4886,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 754c74f5f29..769a6c01492 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,25 +13,25 @@ pr: - '*' jobs: -- job: CredScan - displayName: "Credential Scan" - pool: - vmImage: "windows-2019" - steps: - - task: ms-codeanalysis.vss-microsoft-security-code-analysis.build-task-credscan.CredScan@2 - displayName: 'CredScan' - inputs: - toolVersion: 'Latest' - suppressionsFile: './scripts/ci/credscan/CredScanSuppressions.json' - - task: ms-codeanalysis.vss-microsoft-security-code-analysis.build-task-postanalysis.PostAnalysis@1 - displayName: 'Post Analysis' - inputs: - AllTools: false - BinSkim: false - CredScan: true - RoslynAnalyzers: false - TSLint: false - ToolLogsNotFoundAction: 'Standard' +# - job: CredScan +# displayName: "Credential Scan" +# pool: +# vmImage: "windows-2019" +# steps: +# - task: ms-codeanalysis.vss-microsoft-security-code-analysis.build-task-credscan.CredScan@2 +# displayName: 'CredScan' +# inputs: +# toolVersion: 'Latest' +# suppressionsFile: './scripts/ci/credscan/CredScanSuppressions.json' +# - task: ms-codeanalysis.vss-microsoft-security-code-analysis.build-task-postanalysis.PostAnalysis@1 +# displayName: 'Post Analysis' +# inputs: +# AllTools: false +# BinSkim: false +# CredScan: true +# RoslynAnalyzers: false +# TSLint: false +# ToolLogsNotFoundAction: 'Standard' - job: CheckLicenseHeader displayName: "Check License" @@ -162,6 +162,8 @@ jobs: displayName: 'Use Python 3.7' inputs: versionSpec: 3.7 + - bash: pip install wheel==0.30.0 + displayName: 'Install wheel==0.30.0' - task: Bash@3 displayName: "Verify Extension Ref Docs" inputs: diff --git a/scripts/ci/util.py b/scripts/ci/util.py index 6081d4dad11..6c7ae237231 100644 --- a/scripts/ci/util.py +++ b/scripts/ci/util.py @@ -4,14 +4,21 @@ # -------------------------------------------------------------------------------------------- import os +import re import json import zipfile -from wheel.install import WHEEL_INFO_RE # Dependencies that will not be checked. # This is for packages starting with 'azure-' but do not use the 'azure' namespace. SKIP_DEP_CHECK = ['azure-batch-extensions'] +# copy from wheel==0.30.0 +WHEEL_INFO_RE = re.compile( + r"""^(?P(?P.+?)(-(?P\d.+?))?) + ((-(?P\d.*?))?-(?P.+?)-(?P.+?)-(?P.+?) + \.whl|\.dist-info)$""", + re.VERBOSE).match + def get_repo_root(): current_dir = os.path.dirname(os.path.abspath(__file__)) diff --git a/src/ai-did-you-mean-this/HISTORY.rst b/src/ai-did-you-mean-this/HISTORY.rst new file mode 100644 index 00000000000..0162192acb9 --- /dev/null +++ b/src/ai-did-you-mean-this/HISTORY.rst @@ -0,0 +1,10 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. +* Add autogenerated recommendations for recovery from UserFault failures. +* Ensure that the hook is activated in common UserFault failure scenarios. \ No newline at end of file diff --git a/src/ai-did-you-mean-this/README.md b/src/ai-did-you-mean-this/README.md new file mode 100644 index 00000000000..634db4ef845 --- /dev/null +++ b/src/ai-did-you-mean-this/README.md @@ -0,0 +1,91 @@ +# Microsoft Azure CLI 'AI Did You Mean This' Extension # + +### Installation ### +To install the extension, use the below CLI command +``` +az extension add --name ai-did-you-mean-this +``` + +### Background ### +The purpose of this extension is help users recover from failure. Once installed, failure recovery recommendations will automatically be provided for supported command failures. In cases where no recommendations are available, a prompt to use `az find` will be shown provided that the command can be matched to a valid CLI command. +### Limitations ### +For now, recommendations are limited to parser failures (i.e. not in a command group, argument required, unrecognized parameter, expected one argument, etc). Support for more core failures is planned for a future release. +### Try it out! ### +The following examples demonstrate how to trigger the extension. For a more complete list of supported CLI failure types, see this [CLI PR](https://github.com/Azure/azure-cli/pull/12889). Keep in mind that the recommendations shown here may be different from the ones that you receive. + +#### az account #### +``` +> az account +az account: error: the following arguments are required: _subcommand +usage: az account [-h] + {list,set,show,clear,list-locations,get-access-token,lock,management-group} + ... + +Here are the most common ways users succeeded after [account] failed: + az account list + az account show +``` + +#### az account set #### +``` +> az account set +az account set: error: the following arguments are required: --subscription/-s +usage: az account set [-h] [--verbose] [--debug] [--only-show-errors] + [--output {json,jsonc,yaml,yamlc,table,tsv,none}] + [--query JMESPATH] --subscription SUBSCRIPTION + +Here are the most common ways users succeeded after [account set] failed: + az account set --subscription Subscription +``` + +#### az group create #### +``` +>az group create +az group create: error: the following arguments are required: --name/--resource-group/-n/-g, --location/-l +usage: az group create [-h] [--verbose] [--debug] [--only-show-errors] + [--output {json,jsonc,yaml,yamlc,table,tsv,none}] + [--query JMESPATH] [--subscription _SUBSCRIPTION] + --name RG_NAME --location LOCATION + [--tags [TAGS [TAGS ...]]] [--managed-by MANAGED_BY] + +Here are the most common ways users succeeded after [group create] failed: + az group create --location westeurope --resource-group MyResourceGroup +``` +#### az vm list ### +``` +> az vm list --query ".id" +az vm list: error: argument --query: invalid jmespath_type value: '.id' +usage: az vm list [-h] [--verbose] [--debug] [--only-show-errors] + [--output {json,jsonc,yaml,yamlc,table,tsv,none}] + [--query JMESPATH] [--subscription _SUBSCRIPTION] + [--resource-group RESOURCE_GROUP_NAME] [--show-details] + +Sorry I am not able to help with [vm list] +Try running [az find "az vm list"] to see examples of [vm list] from other users. +``` +### Developer Build ### +If you want to try an experimental release of the extension, it is recommended you do so in a [Docker container](https://www.docker.com/resources/what-container). Keep in mind that you'll need to install Docker and pull the desired [Azure CLI image](https://hub.docker.com/_/microsoft-azure-cli) from the Microsoft Container Registry before proceeding. + +#### Setting up your Docker Image #### +To run the Azure CLI Docker image as an interactive shell, run the below command by replacing `` with your desired CLI version +```bash +docker run -it mcr.microsoft.com/azure-cli: +export EXT="ai-did-you-mean-this" +pip install --upgrade --target ~/.azure/cliextensions/$EXT "git+https://github.com/christopher-o-toole/azure-cli-extensions.git@thoth-extension#subdirectory=src/$EXT&egg=$EXT" +``` +Each time you start a new shell, you'll need to login before you can start using the extension. To do so, run +```bash +az login +``` +and follow the instructions given in the prompt. Once you're logged in, try out the extension by issuing a faulty command +``` +> az account +az account: error: the following arguments are required: _subcommand +usage: az account [-h] + {list,set,show,clear,list-locations,get-access-token,lock,management-group} + ... + +Here are the most common ways users succeeded after [account] failed: + az account list + az account show +``` \ No newline at end of file diff --git a/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/__init__.py b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/__init__.py new file mode 100644 index 00000000000..8db2b74fe04 --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/__init__.py @@ -0,0 +1,52 @@ +# -------------------------------------------------------------------------------------------- +# 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 knack.events import ( + EVENT_INVOKER_CMD_TBL_LOADED +) + +from azext_ai_did_you_mean_this._help import helps # pylint: disable=unused-import +from azext_ai_did_you_mean_this._cmd_table import on_command_table_loaded + + +def inject_functions_into_core(): + from azure.cli.core.parser import AzCliCommandParser + from azext_ai_did_you_mean_this.custom import recommend_recovery_options + AzCliCommandParser.recommendation_provider = recommend_recovery_options + + +# pylint: disable=too-few-public-methods +class GlobalConfig(): + ENABLE_STYLING = False + + +class AiDidYouMeanThisCommandsLoader(AzCommandsLoader): + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + + ai_did_you_mean_this_custom = CliCommandType( + operations_tmpl='azext_ai_did_you_mean_this.custom#{}') + super().__init__(cli_ctx=cli_ctx, + custom_command_type=ai_did_you_mean_this_custom) + self.cli_ctx.register_event(EVENT_INVOKER_CMD_TBL_LOADED, on_command_table_loaded) + inject_functions_into_core() + # per https://github.com/Azure/azure-cli/pull/12601 + try: + GlobalConfig.ENABLE_STYLING = cli_ctx.enable_color + except AttributeError: + pass + + def load_command_table(self, args): + from azext_ai_did_you_mean_this.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + pass + + +COMMAND_LOADER_CLS = AiDidYouMeanThisCommandsLoader diff --git a/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/_cmd_table.py b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/_cmd_table.py new file mode 100644 index 00000000000..9d77a5db9bd --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/_cmd_table.py @@ -0,0 +1,13 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +class CommandTable(): # pylint: disable=too-few-public-methods + CMD_TBL = None + + +def on_command_table_loaded(_, **kwargs): + cmd_tbl = kwargs.pop('cmd_tbl', None) + CommandTable.CMD_TBL = cmd_tbl diff --git a/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/_const.py b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/_const.py new file mode 100644 index 00000000000..238ec3151e6 --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/_const.py @@ -0,0 +1,34 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +UPDATE_RECOMMENDATION_STR = ( + "Better failure recovery recommendations are available from the latest version of the CLI. " + "Please update for the best experience.\n" +) + +UNABLE_TO_HELP_FMT_STR = ( + '\nSorry I am not able to help with [{command}]' + '\nTry running [az find "az {command}"] to see examples of [{command}] from other users.' +) + +RECOMMENDATION_HEADER_FMT_STR = ( + '\nHere are the most common ways users succeeded after [{command}] failed:' +) + +TELEMETRY_MUST_BE_ENABLED_STR = ( + 'User must agree to telemetry before failure recovery recommendations can be presented.' +) + +TELEMETRY_MISSING_SUBSCRIPTION_ID_STR = ( + "Subscription ID was not set in telemetry." +) + +TELEMETRY_MISSING_CORRELATION_ID_STR = ( + "Correlation ID was not set in telemetry." +) + +UNABLE_TO_CALL_SERVICE_STR = ( + 'Either the subscription ID or correlation ID was not set. Aborting operation.' +) diff --git a/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/_help.py b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/_help.py new file mode 100644 index 00000000000..8c8e70d9a85 --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/_help.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.help_files import helps # pylint: disable=unused-import + +helps['ai-did-you-mean-this'] = """ + type: group + short-summary: Add recommendations for recovering from failure. +""" + +helps['ai-did-you-mean-this version'] = """ + type: command + short-summary: Prints the extension version. +""" diff --git a/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/_style.py b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/_style.py new file mode 100644 index 00000000000..f32e8452062 --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/_style.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import sys + +from azext_ai_did_you_mean_this import GlobalConfig + + +def style_message(msg): + if should_enable_styling(): + import colorama # pylint: disable=import-error + + try: + msg = colorama.Style.BRIGHT + msg + colorama.Style.RESET_ALL + except KeyError: + pass + return msg + + +def should_enable_styling(): + try: + if GlobalConfig.ENABLE_STYLING and sys.stdout.isatty(): + return True + except AttributeError: + pass + return False diff --git a/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/azext_metadata.json b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/azext_metadata.json new file mode 100644 index 00000000000..6a44beb25b4 --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.4.0" +} \ No newline at end of file diff --git a/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/commands.py b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/commands.py new file mode 100644 index 00000000000..0732b3eba2c --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/commands.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# 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 + + +def load_command_table(self, _): + + with self.command_group('ai-did-you-mean-this', is_preview=True) as g: + g.custom_command('version', 'show_extension_version') diff --git a/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/custom.py b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/custom.py new file mode 100644 index 00000000000..ede97b1c7e4 --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/custom.py @@ -0,0 +1,242 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import json +from http import HTTPStatus + +import requests +from requests import RequestException + +import azure.cli.core.telemetry as telemetry + +from knack.log import get_logger +from knack.util import CLIError # pylint: disable=unused-import + +from azext_ai_did_you_mean_this.failure_recovery_recommendation import FailureRecoveryRecommendation +from azext_ai_did_you_mean_this._style import style_message +from azext_ai_did_you_mean_this._const import ( + RECOMMENDATION_HEADER_FMT_STR, + UNABLE_TO_HELP_FMT_STR, + TELEMETRY_MUST_BE_ENABLED_STR, + TELEMETRY_MISSING_SUBSCRIPTION_ID_STR, + TELEMETRY_MISSING_CORRELATION_ID_STR, + UNABLE_TO_CALL_SERVICE_STR +) +from azext_ai_did_you_mean_this._cmd_table import CommandTable + +logger = get_logger(__name__) + + +# Commands +# note: at least one command is required in order for the CLI to load the extension. +def show_extension_version(): + print(f'Current version: 0.1.0') + + +def _log_debug(msg, *args, **kwargs): + # TODO: see if there's a way to change the log formatter locally without printing to stdout + msg = f'[Thoth]: {msg}' + logger.debug(msg, *args, **kwargs) + + +def get_parameter_table(cmd_table, command, recurse=True): + az_cli_command = cmd_table.get(command, None) + parameter_table = az_cli_command.arguments if az_cli_command else None + + # if the specified command was not found and recursive search is enabled... + if not az_cli_command and recurse: + # if there are at least two tokens separated by whitespace, remove the last token + last_delim_idx = command.rfind(' ') + if last_delim_idx != -1: + _log_debug('Removing unknown token "%s" from command.', command[last_delim_idx + 1:]) + # try to find the truncated command. + parameter_table, command = get_parameter_table(cmd_table, command[:last_delim_idx], recurse=False) + + return parameter_table, command + + +def normalize_and_sort_parameters(cmd_table, command, parameters): + from knack.deprecation import Deprecated + _log_debug('normalize_and_sort_parameters: command: "%s", parameters: "%s"', command, parameters) + + parameter_set = set() + parameter_table, command = get_parameter_table(cmd_table, command) + + if parameters: + # TODO: Avoid setting rules for global parameters manually. + rules = { + '-h': '--help', + '-o': '--output', + '--only-show-errors': None, + '--help': None, + '--output': None, + '--query': None, + '--debug': None, + '--verbose': None + } + + blocklisted = {'--debug', '--verbose'} + + if parameter_table: + for argument in parameter_table.values(): + options = argument.type.settings['options_list'] + # remove deprecated arguments. + options = (option for option in options if not isinstance(option, Deprecated)) + + # attempt to create a rule for each potential parameter. + try: + # sort parameters by decreasing length. + sorted_options = sorted(options, key=len, reverse=True) + # select the longest parameter as the standard form + standard_form = sorted_options[0] + + for option in sorted_options[1:]: + rules[option] = standard_form + + # don't apply any rules for the parameter's standard form. + rules[standard_form] = None + except TypeError: + # ignore cases in which one of the option objects is of an unsupported type. + _log_debug('Unexpected argument options `%s` of type `%s`.', options, type(options).__name__) + + for parameter in parameters: + if parameter in rules: + # normalize the parameter or do nothing if already normalized + normalized_form = rules.get(parameter, None) or parameter + # add the parameter to our result set + parameter_set.add(normalized_form) + else: + # ignore any parameters that we were unable to validate. + _log_debug('"%s" is an invalid parameter for command "%s".', parameter, command) + + # remove any special global parameters that would typically be removed by the CLI + parameter_set.difference_update(blocklisted) + + # get the list of parameters as a comma-separated list + return command, ','.join(sorted(parameter_set)) + + +def recommend_recovery_options(version, command, parameters, extension): + from timeit import default_timer as timer + start_time = timer() + elapsed_time = None + + result = [] + cmd_tbl = CommandTable.CMD_TBL + _log_debug('recommend_recovery_options: version: "%s", command: "%s", parameters: "%s", extension: "%s"', + version, command, parameters, extension) + + # if the user doesn't agree to telemetry... + if not telemetry.is_telemetry_enabled(): + _log_debug(TELEMETRY_MUST_BE_ENABLED_STR) + return result + + # if the command is empty... + if not command: + # try to get the raw command field from telemetry. + session = telemetry._session # pylint: disable=protected-access + # get the raw command parsed by the CommandInvoker object. + command = session.raw_command + if command: + _log_debug(f'Setting command to [{command}] from telemtry.') + + def append(line): + result.append(line) + + def unable_to_help(command): + msg = UNABLE_TO_HELP_FMT_STR.format(command=command) + append(msg) + + def show_recommendation_header(command): + msg = RECOMMENDATION_HEADER_FMT_STR.format(command=command) + append(style_message(msg)) + + if extension: + _log_debug('Detected extension. No action to perform.') + if not command: + _log_debug('Command is empty. No action to perform.') + + # if an extension is in-use or the command is empty... + if extension or not command: + return result + + # perform some rudimentary parsing to extract the parameters and command in a standard form + command, parameters = normalize_and_sort_parameters(cmd_tbl, command, parameters) + response = call_aladdin_service(command, parameters, version) + + # only show recommendations when we can contact the service. + if response and response.status_code == HTTPStatus.OK: + recommendations = get_recommendations_from_http_response(response) + + if recommendations: + show_recommendation_header(command) + + for recommendation in recommendations: + append(f"\t{recommendation}") + # only prompt user to use "az find" for valid CLI commands + # note: pylint has trouble resolving statically initialized variables, which is why + # we need to disable the unsupported membership test rule + elif any(cmd.startswith(command) for cmd in cmd_tbl.keys()): # pylint: disable=unsupported-membership-test + unable_to_help(command) + + elapsed_time = timer() - start_time + _log_debug('The overall time it took to process failure recovery recommendations was %.2fms.', elapsed_time * 1000) + + return result + + +def get_recommendations_from_http_response(response): + recommendations = [] + + for suggestion in response.json(): + recommendations.append(FailureRecoveryRecommendation(suggestion)) + + return recommendations + + +def call_aladdin_service(command, parameters, version): + _log_debug('call_aladdin_service: version: "%s", command: "%s", parameters: "%s"', + version, command, parameters) + + response = None + + correlation_id = telemetry._session.correlation_id # pylint: disable=protected-access + subscription_id = telemetry._get_azure_subscription_id() # pylint: disable=protected-access + + if subscription_id and correlation_id: + context = { + "sessionId": correlation_id, + "subscriptionId": subscription_id, + "versionNumber": version + } + + query = { + "command": command, + "parameters": parameters + } + + api_url = 'https://app.aladdindev.microsoft.com/api/v1.0/suggestions' + headers = {'Content-Type': 'application/json'} + + try: + response = requests.get( + api_url, + params={ + 'query': json.dumps(query), + 'clientType': 'AzureCli', + 'context': json.dumps(context) + }, + headers=headers) + except RequestException as ex: + _log_debug('requests.get() exception: %s', ex) + else: + if subscription_id is None: + _log_debug(TELEMETRY_MISSING_SUBSCRIPTION_ID_STR) + if correlation_id is None: + _log_debug(TELEMETRY_MISSING_CORRELATION_ID_STR) + + _log_debug(UNABLE_TO_CALL_SERVICE_STR) + + return response diff --git a/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/failure_recovery_recommendation.py b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/failure_recovery_recommendation.py new file mode 100644 index 00000000000..e52c9cb567b --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/failure_recovery_recommendation.py @@ -0,0 +1,64 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def assert_has_split_method(field, value): + if not getattr(value, 'split') or not callable(value.split): + raise TypeError(f'value assigned to `{field}` must contain split method') + + +class FailureRecoveryRecommendation(): + def __init__(self, data): + data['SuccessCommand'] = data.get('SuccessCommand', '') + data['SuccessCommand_Parameters'] = data.get('SuccessCommand_Parameters', '') + data['SuccessCommand_ArgumentPlaceholders'] = data.get('SuccessCommand_ArgumentPlaceholders', '') + + self._command = data['SuccessCommand'] + self._parameters = data['SuccessCommand_Parameters'] + self._placeholders = data['SuccessCommand_ArgumentPlaceholders'] + + for attr in ('_parameters', '_placeholders'): + value = getattr(self, attr) + value = '' if value == '{}' else value + setattr(self, attr, value) + + @property + def command(self): + return self._command + + @command.setter + def command(self, value): + self._command = value + + @property + def parameters(self): + return self._parameters.split(',') + + @parameters.setter + def parameters(self, value): + assert_has_split_method('parameters', value) + self._parameters = value + + @property + def placeholders(self): + return self._placeholders.split(',') + + @placeholders.setter + def placeholders(self, value): + assert_has_split_method('placeholders', value) + self._placeholders = value + + def __str__(self): + parameter_and_argument_buffer = [] + + for pair in zip(self.parameters, self.placeholders): + parameter_and_argument_buffer.append(' '.join(pair)) + + return f"az {self.command} {' '.join(parameter_and_argument_buffer)}" + + def __eq__(self, value): + return (self.command == value.command and + self.parameters == value.parameters and + self.placeholders == value.placeholders) diff --git a/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/__init__.py b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/__init__.py new file mode 100644 index 00000000000..99c0f28cd71 --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# 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/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/__init__.py b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/__init__.py new file mode 100644 index 00000000000..99c0f28cd71 --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# 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/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/_commands.py b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/_commands.py new file mode 100644 index 00000000000..32f97e1a602 --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/_commands.py @@ -0,0 +1,132 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from collections import namedtuple +from enum import Enum + +GLOBAL_ARGS = set(('--debug', '--verbose', '--help', '--only-show-errors', '--output', '--query')) +GLOBAL_ARG_BLACKLIST = set(('--debug', '--verbose')) +GLOBAL_ARG_WHITELIST = GLOBAL_ARGS.difference(GLOBAL_ARG_BLACKLIST) +GLOBAL_ARGS_SHORTHAND_MAP = {'-h': '--help', '-o': '--output'} +GLOBAL_ARG_LIST = tuple(GLOBAL_ARGS) + tuple(GLOBAL_ARGS_SHORTHAND_MAP.keys()) + +Arguments = namedtuple('Arguments', ['actual', 'expected']) +CliCommand = namedtuple('CliCommand', ['module', 'command', 'args']) + + +def get_expected_args(args): + return [arg for arg in args if arg.startswith('--')] + + +VM_MODULE_ARGS = ['-g', '--name', '-n', '--resource-group', '--subscription'] +VM_MODULE_EXPECTED_ARGS = get_expected_args(VM_MODULE_ARGS) + +VM_SHOW_ARGS = Arguments( + actual=VM_MODULE_ARGS, + expected=VM_MODULE_EXPECTED_ARGS +) + +_VM_CREATE_ARGS = ['--zone', '-z', '--vmss', '--location', '-l', '--nsg', '--subnet'] + +VM_CREATE_ARGS = Arguments( + actual=VM_MODULE_ARGS + _VM_CREATE_ARGS, + expected=VM_MODULE_EXPECTED_ARGS + get_expected_args(_VM_CREATE_ARGS) +) + +ACCOUNT_ARGS = Arguments( + actual=[], + expected=[] +) + +ACCOUNT_SET_ARGS = Arguments( + actual=['-s', '--subscription'], + expected=['--subscription'] +) + +EXTENSION_LIST_ARGS = Arguments( + actual=['--foo', '--bar'], + expected=[] +) + +AI_DID_YOU_MEAN_THIS_VERSION_ARGS = Arguments( + actual=['--baz'], + expected=[] +) + +KUSTO_CLUSTER_CREATE_ARGS = Arguments( + actual=['-l', '-g', '--no-wait'], + expected=['--location', '--resource-group', '--no-wait'] +) + + +def add_global_args(args, global_args=GLOBAL_ARG_LIST): + expected_global_args = list(GLOBAL_ARG_WHITELIST) + args.actual.extend(global_args) + args.expected.extend(expected_global_args) + return args + + +class AzCommandType(Enum): + VM_SHOW = CliCommand( + module='vm', + command='vm show', + args=add_global_args(VM_SHOW_ARGS) + ) + VM_CREATE = CliCommand( + module='vm', + command='vm create', + args=add_global_args(VM_CREATE_ARGS) + ) + ACCOUNT = CliCommand( + module='account', + command='account', + args=add_global_args(ACCOUNT_ARGS) + ) + ACCOUNT_SET = CliCommand( + module='account', + command='account set', + args=add_global_args(ACCOUNT_SET_ARGS) + ) + EXTENSION_LIST = CliCommand( + module='extension', + command='extension list', + args=add_global_args(EXTENSION_LIST_ARGS) + ) + AI_DID_YOU_MEAN_THIS_VERSION = CliCommand( + module='ai-did-you-mean-this', + command='ai-did-you-mean-this version', + args=add_global_args(AI_DID_YOU_MEAN_THIS_VERSION_ARGS) + ) + KUSTO_CLUSTER_CREATE = CliCommand( + module='kusto', + command='kusto cluster create', + args=add_global_args(KUSTO_CLUSTER_CREATE_ARGS) + ) + + def __init__(self, module, command, args): + self._expected_args = list(sorted(args.expected)) + self._args = args.actual + self._module = module + self._command = command + + @property + def parameters(self): + return self._args + + @property + def expected_parameters(self): + return ','.join(self._expected_args) + + @property + def module(self): + return self._module + + @property + def command(self): + return self._command + + +def get_commands(): + return list({command_type.command for command_type in AzCommandType}) diff --git a/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/_mock.py b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/_mock.py new file mode 100644 index 00000000000..9617c48d3ba --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/_mock.py @@ -0,0 +1,103 @@ +# -------------------------------------------------------------------------------------------- +# 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 json +import unittest.mock as mock +from enum import Enum, auto +from http import HTTPStatus +from collections import namedtuple +from contextlib import contextmanager + +import requests + +from azext_ai_did_you_mean_this.failure_recovery_recommendation import FailureRecoveryRecommendation + +# mock service call context attributes +MOCK_UUID = '00000000-0000-0000-0000-000000000000' +MOCK_VERSION = '2.4.0' + +# mock recommendation data constants +MOCK_MODEL_DIR = 'model' +MOCK_RECOMMENDATION_MODEL_FILENAME = 'recommendations.json' + + +RecommendationData = namedtuple('RecommendationData', ['recommendations', 'arguments', 'user_fault_type', 'extension']) + + +class UserFaultType(Enum): + MISSING_REQUIRED_SUBCOMMAND = auto() + NOT_IN_A_COMMAND_GROUP = auto() + EXPECTED_AT_LEAST_ONE_ARGUMENT = auto() + UNRECOGNIZED_ARGUMENTS = auto() + INVALID_JMESPATH_QUERY = auto() + NOT_APPLICABLE = auto() + + +def get_mock_recommendation_model_path(folder): + return os.path.join(folder, MOCK_MODEL_DIR, MOCK_RECOMMENDATION_MODEL_FILENAME) + + +def _parse_entity(entity): + kwargs = {} + kwargs['recommendations'] = entity.get('recommendations', []) + kwargs['arguments'] = entity.get('arguments', '') + kwargs['extension'] = entity.get('extension', None) + kwargs['user_fault_type'] = UserFaultType[entity.get('user_fault_type', 'not_applicable').upper()] + return RecommendationData(**kwargs) + + +class MockRecommendationModel(): + MODEL = None + NO_DATA = None + + @classmethod + def load(cls, path): + content = None + model = {} + + with open(os.path.join(path), 'r') as test_recommendation_data_file: + content = json.load(test_recommendation_data_file) + + for command, entity in content.items(): + model[command] = _parse_entity(entity) + + cls.MODEL = model + cls.NO_DATA = _parse_entity({}) + + @classmethod + def create_mock_aladdin_service_http_response(cls, command): + mock_response = requests.Response() + mock_response.status_code = HTTPStatus.OK.value + data = cls.get_recommendation_data(command) + mock_response._content = bytes(json.dumps(data.recommendations), 'utf-8') # pylint: disable=protected-access + return mock_response + + @classmethod + def get_recommendation_data(cls, command): + return cls.MODEL.get(command, cls.NO_DATA) + + @classmethod + def get_recommendations(cls, command): + data = cls.get_recommendation_data(command) + recommendations = [FailureRecoveryRecommendation(recommendation) for recommendation in data.recommendations] + return recommendations + + @classmethod + def get_test_cases(cls): + cases = [] + model = cls.MODEL or {} + for command, entity in model.items(): + cases.append((command, entity)) + return cases + + +@contextmanager +def mock_aladdin_service_call(command): + handlers = {} + handler = handlers.get(command, MockRecommendationModel.create_mock_aladdin_service_http_response) + + with mock.patch('requests.get', return_value=handler(command)): + yield None diff --git a/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/aladdin_scenario_test_base.py b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/aladdin_scenario_test_base.py new file mode 100644 index 00000000000..ba8215b698e --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/aladdin_scenario_test_base.py @@ -0,0 +1,152 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import re +import logging +import unittest.mock as mock + +from azure_devtools.scenario_tests import mock_in_unit_test +from azure.cli.testsdk import ScenarioTest + +from azext_ai_did_you_mean_this._const import UNABLE_TO_HELP_FMT_STR, RECOMMENDATION_HEADER_FMT_STR +from azext_ai_did_you_mean_this._cmd_table import CommandTable +from azext_ai_did_you_mean_this.tests.latest._mock import MOCK_UUID, MOCK_VERSION +from azext_ai_did_you_mean_this.custom import recommend_recovery_options +from azext_ai_did_you_mean_this.tests.latest._mock import UserFaultType + +TELEMETRY_MODULE = 'azure.cli.core.telemetry' +TELEMETRY_SESSION_OBJECT = f'{TELEMETRY_MODULE}._session' + +USER_FAULT_TYPE_KEYWORDS = { + UserFaultType.EXPECTED_AT_LEAST_ONE_ARGUMENT: 'expected', + UserFaultType.INVALID_JMESPATH_QUERY: 'jmespath', + UserFaultType.MISSING_REQUIRED_SUBCOMMAND: '_subcommand', + UserFaultType.NOT_IN_A_COMMAND_GROUP: 'command group', + UserFaultType.UNRECOGNIZED_ARGUMENTS: 'unrecognized' +} + +FMT_STR_PATTERN_REGEX = r'\[[^\]]+\]|{[^}]+}' +SUGGEST_AZ_FIND_PATTERN_REGEX = re.sub(FMT_STR_PATTERN_REGEX, r'.*', UNABLE_TO_HELP_FMT_STR) +SHOW_RECOMMENDATIONS_PATTERN_REGEX = re.sub(FMT_STR_PATTERN_REGEX, r'.*', RECOMMENDATION_HEADER_FMT_STR) + + +def patch_ids(unit_test): + def _mock_uuid(*args, **kwargs): # pylint: disable=unused-argument + return MOCK_UUID + + mock_in_unit_test(unit_test, + f'{TELEMETRY_SESSION_OBJECT}.correlation_id', + _mock_uuid()) + mock_in_unit_test(unit_test, + f'{TELEMETRY_MODULE}._get_azure_subscription_id', + _mock_uuid) + + +def patch_version(unit_test): + mock_in_unit_test(unit_test, + 'azure.cli.core.__version__', + MOCK_VERSION) + + +def patch_telemetry(unit_test): + mock_in_unit_test(unit_test, + 'azure.cli.core.telemetry.is_telemetry_enabled', + lambda: True) + + +class AladdinScenarioTest(ScenarioTest): + def __init__(self, method_name, **kwargs): + super().__init__(method_name, **kwargs) + + default_telemetry_patches = { + patch_ids, + patch_version, + patch_telemetry + } + + self._exception = None + self._exit_code = None + self._parser_error_msg = '' + self._recommendation_msg = '' + self._recommender_positional_arguments = None + + self.telemetry_patches = kwargs.pop('telemetry_patches', default_telemetry_patches) + self.recommendations = [] + + def setUp(self): + super().setUp() + + for patch in self.telemetry_patches: + patch(self) + + def cmd(self, command, checks=None, expect_failure=False, expect_user_fault_failure=False): + from azure.cli.core.azlogging import AzCliLogging + + func = recommend_recovery_options + logger_name = AzCliLogging._COMMAND_METADATA_LOGGER # pylint: disable=protected-access + base = super() + + def _hook(*args, **kwargs): + self._recommender_positional_arguments = args + result = func(*args, **kwargs) + self.recommendations = result + return result + + def run_cmd(): + base.cmd(command, checks=checks, expect_failure=expect_failure) + + with mock.patch('azext_ai_did_you_mean_this.custom.recommend_recovery_options', wraps=_hook): + with self.assertLogs(logger_name, level=logging.ERROR) as parser_logs: + if expect_user_fault_failure: + with self.assertRaises(SystemExit) as cm: + run_cmd() + + self._exception = cm.exception + self._exit_code = self._exception.code + self._parser_error_msg = '\n'.join(parser_logs.output) + self._recommendation_msg = '\n'.join(self.recommendations) + + if expect_user_fault_failure: + self.assert_cmd_was_user_fault_failure() + else: + run_cmd() + + if expect_user_fault_failure: + self.assert_cmd_table_not_empty() + self.assert_user_fault_is_of_correct_type(expect_user_fault_failure) + + def assert_user_fault_is_of_correct_type(self, expect_user_fault_failure): + # check the user fault type where applicable + if isinstance(expect_user_fault_failure, UserFaultType): + keyword = USER_FAULT_TYPE_KEYWORDS.get(expect_user_fault_failure, None) + if keyword: + self.assertRegex(self._parser_error_msg, keyword) + + def assert_cmd_was_user_fault_failure(self): + is_user_fault_failure = (isinstance(self._exception, SystemExit) and + self._exit_code == 2) + + self.assertTrue(is_user_fault_failure) + + def assert_cmd_table_not_empty(self): + self.assertIsNotNone(CommandTable.CMD_TBL) + + def assert_recommendations_were_shown(self): + self.assertRegex(self._recommendation_msg, SHOW_RECOMMENDATIONS_PATTERN_REGEX) + + def assert_az_find_was_suggested(self): + self.assertRegex(self._recommendation_msg, SUGGEST_AZ_FIND_PATTERN_REGEX) + + def assert_nothing_is_shown(self): + self.assertEqual(self._recommendation_msg, '') + + @property + def cli_version(self): + from azure.cli.core import __version__ as core_version + return core_version + + @property + def recommender_postional_arguments(self): + return self._recommender_positional_arguments diff --git a/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/model/recommendations.json b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/model/recommendations.json new file mode 100644 index 00000000000..5359be372f9 --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/model/recommendations.json @@ -0,0 +1,75 @@ +{ + "account": { + "recommendations": [ + { + "SuccessCommand": "account list", + "SuccessCommand_Parameters": "", + "SuccessCommand_ArgumentPlaceholders": "" + }, + { + "SuccessCommand": "account show", + "SuccessCommand_Parameters": "", + "SuccessCommand_ArgumentPlaceholders": "" + }, + { + "SuccessCommand": "account set", + "SuccessCommand_Parameters": "--subscription", + "SuccessCommand_ArgumentPlaceholders": "Subscription" + } + ], + "user_fault_type": "missing_required_subcommand" + + }, + "boi": { + "user_fault_type": "not_in_a_command_group" + }, + "vm show": { + "arguments": "--name \"BigJay\" --ids", + "user_fault_type": "expected_at_least_one_argument" + }, + "ai-did-you-mean-this ve": { + "user_fault_type": "not_in_a_command_group", + "extension": "ai-did-you-mean-this" + }, + "ai-did-you-mean-this version": { + "user_fault_type": "unrecognized_arguments", + "arguments": "--name \"Christopher\"", + "extension": "ai-did-you-mean-this" + }, + "extension": { + "recommendations": [ + { + "SuccessCommand": "extension list", + "SuccessCommand_Parameters": "", + "SuccessCommand_ArgumentPlaceholders": "" + } + ], + "user_fault_type": "missing_required_subcommand" + }, + "vm": { + "recommendations": [ + { + "SuccessCommand": "vm list", + "SuccessCommand_Parameters": "", + "SuccessCommand_ArgumentPlaceholders": "" + } + ], + "user_fault_type": "missing_required_subcommand", + "arguments": "--debug" + }, + "account get-access-token": { + "user_fault_type": "unrecognized_arguments", + "arguments": "--test a --debug" + }, + "vm list": { + "recommendations": [ + { + "SuccessCommand": "vm list", + "SuccessCommand_Parameters": "--output,--query", + "SuccessCommand_ArgumentPlaceholders": "json,\"[].id\"" + } + ], + "arguments": "--query \".id\"", + "user_fault_type": "invalid_jmespath_query" + } +} \ No newline at end of file diff --git a/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/test_ai_did_you_mean_this_scenario.py b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/test_ai_did_you_mean_this_scenario.py new file mode 100644 index 00000000000..fa9578d1583 --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/test_ai_did_you_mean_this_scenario.py @@ -0,0 +1,75 @@ +# -------------------------------------------------------------------------------------------- +# 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 +import unittest.mock as mock +import json +from http import HTTPStatus +from collections import defaultdict + +import requests + +from azext_ai_did_you_mean_this.custom import call_aladdin_service, get_recommendations_from_http_response +from azext_ai_did_you_mean_this._cmd_table import CommandTable +from azext_ai_did_you_mean_this.tests.latest._mock import ( + get_mock_recommendation_model_path, + mock_aladdin_service_call, + MockRecommendationModel, + UserFaultType +) +from azext_ai_did_you_mean_this.tests.latest.aladdin_scenario_test_base import AladdinScenarioTest +from azext_ai_did_you_mean_this.tests.latest._commands import AzCommandType + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class AiDidYouMeanThisScenarioTest(AladdinScenarioTest): + @classmethod + def setUpClass(cls): + super().setUpClass() + + MockRecommendationModel.load(get_mock_recommendation_model_path(TEST_DIR)) + cls.test_cases = MockRecommendationModel.get_test_cases() + + def setUp(self): + super().setUp() + + def test_ai_did_you_mean_this_aladdin_service_call(self): + for command, entity in self.test_cases: + tokens = entity.arguments.split() + parameters = [token for token in tokens if token.startswith('-')] + + with mock_aladdin_service_call(command): + response = call_aladdin_service(command, parameters, self.cli_version) + + self.assertEqual(HTTPStatus.OK, response.status_code) + recommendations = get_recommendations_from_http_response(response) + expected_recommendations = MockRecommendationModel.get_recommendations(command) + self.assertEquals(recommendations, expected_recommendations) + + def test_ai_did_you_mean_this_recommendations_for_user_fault_commands(self): + for command, entity in self.test_cases: + args = entity.arguments + command_with_args = command if not args else f'{command} {args}' + + with mock_aladdin_service_call(command): + self.cmd(command_with_args, expect_user_fault_failure=entity.user_fault_type) + + self.assert_cmd_table_not_empty() + cmd_tbl = CommandTable.CMD_TBL + + _version, _command, _parameters, _extension = self.recommender_postional_arguments + partial_command_match = command and any(cmd.startswith(command) for cmd in cmd_tbl.keys()) + self.assertEqual(_version, self.cli_version) + self.assertEqual(_command, command if partial_command_match else '') + self.assertEqual(bool(_extension), bool(entity.extension)) + + if entity.recommendations: + self.assert_recommendations_were_shown() + elif partial_command_match and not entity.extension: + self.assert_az_find_was_suggested() + else: + self.assert_nothing_is_shown() diff --git a/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/test_normalize_and_sort_parameters.py b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/test_normalize_and_sort_parameters.py new file mode 100644 index 00000000000..06729b8b39c --- /dev/null +++ b/src/ai-did-you-mean-this/azext_ai_did_you_mean_this/tests/latest/test_normalize_and_sort_parameters.py @@ -0,0 +1,81 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import unittest +from enum import Enum, auto + +from azure.cli.core.mock import DummyCli +from azure.cli.core import MainCommandsLoader + +from azext_ai_did_you_mean_this.custom import normalize_and_sort_parameters +from azext_ai_did_you_mean_this.tests.latest._commands import get_commands, AzCommandType + + +class TestNormalizeAndSortParameters(unittest.TestCase): + @classmethod + def setUpClass(cls): + super(TestNormalizeAndSortParameters, cls).setUpClass() + + from knack.events import EVENT_INVOKER_POST_CMD_TBL_CREATE + from azure.cli.core.commands.events import EVENT_INVOKER_PRE_LOAD_ARGUMENTS, EVENT_INVOKER_POST_LOAD_ARGUMENTS + from azure.cli.core.commands.arm import register_global_subscription_argument, register_ids_argument + + # setup a dummy CLI with a valid invocation object. + cls.cli = DummyCli() + cli_ctx = cls.cli.commands_loader.cli_ctx + cls.cli.invocation = cli_ctx.invocation_cls(cli_ctx=cli_ctx, + parser_cls=cli_ctx.parser_cls, + commands_loader_cls=cli_ctx.commands_loader_cls, + help_cls=cli_ctx.help_cls) + # load command table for every module + cmd_loader = cls.cli.invocation.commands_loader + cmd_loader.load_command_table(None) + + # Note: Both of the below events rely on EVENT_INVOKER_POST_CMD_TBL_CREATE. + # register handler for adding subscription argument + register_global_subscription_argument(cli_ctx) + # register handler for adding ids argument. + register_ids_argument(cli_ctx) + + cli_ctx.raise_event(EVENT_INVOKER_PRE_LOAD_ARGUMENTS, commands_loader=cmd_loader) + + # load arguments for each command + for cmd in get_commands(): + # simulate command invocation by filling in required metadata. + cmd_loader.command_name = cmd + cli_ctx.invocation.data['command_string'] = cmd + # load argument info for the given command. + cmd_loader.load_arguments(cmd) + + cli_ctx.raise_event(EVENT_INVOKER_POST_LOAD_ARGUMENTS, commands_loader=cmd_loader) + cli_ctx.raise_event(EVENT_INVOKER_POST_CMD_TBL_CREATE, commands_loader=cmd_loader) + + cls.cmd_tbl = cmd_loader.command_table + + def test_custom_normalize_and_sort_parameters(self): + for cmd in AzCommandType: + command, parameters = normalize_and_sort_parameters(self.cmd_tbl, cmd.command, cmd.parameters) + self.assertEqual(parameters, cmd.expected_parameters) + self.assertEqual(command, cmd.command) + + def test_custom_normalize_and_sort_parameters_remove_invalid_command_token(self): + for cmd in AzCommandType: + cmd_with_invalid_token = f'{cmd.command} oops' + command, parameters = normalize_and_sort_parameters(self.cmd_tbl, cmd_with_invalid_token, cmd.parameters) + self.assertEqual(parameters, cmd.expected_parameters) + self.assertEqual(command, cmd.command) + + def test_custom_normalize_and_sort_parameters_empty_parameter_list(self): + cmd = AzCommandType.ACCOUNT_SET + command, parameters = normalize_and_sort_parameters(self.cmd_tbl, cmd.command, '') + self.assertEqual(parameters, '') + self.assertEqual(command, cmd.command) + + def test_custom_normalize_and_sort_parameters_invalid_command(self): + invalid_cmd = 'Lorem ipsum.' + command, parameters = normalize_and_sort_parameters(self.cmd_tbl, invalid_cmd, ['--foo', '--baz']) + self.assertEqual(parameters, '') + # verify that recursive parsing removes the last invalid whitespace delimited token. + self.assertEqual(command, 'Lorem') diff --git a/src/ai-did-you-mean-this/setup.cfg b/src/ai-did-you-mean-this/setup.cfg new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/ai-did-you-mean-this/setup.py b/src/ai-did-you-mean-this/setup.py new file mode 100644 index 00000000000..dc93ac897f0 --- /dev/null +++ b/src/ai-did-you-mean-this/setup.py @@ -0,0 +1,55 @@ +#!/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") + +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.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +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='ai_did_you_mean_this', + version=VERSION, + description='Recommend recovery options on failure.', + # TODO: Update author and email, if applicable + author="Christopher O'Toole", + author_email='chotool@microsoft.com', + # TODO: consider pointing directly to your source code instead of the generic repo + url='https://github.com/Azure/azure-cli-extensions/ai-did-you-mean-this', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_ai_did_you_mean_this': ['azext_metadata.json']}, +) diff --git a/src/aks-preview/HISTORY.md b/src/aks-preview/HISTORY.md index 6f83c079f4d..6b5aeb291f7 100644 --- a/src/aks-preview/HISTORY.md +++ b/src/aks-preview/HISTORY.md @@ -2,6 +2,14 @@ Release History =============== +0.4.45 ++++++ +* Add "--aks-custom-headers" for "az aks nodepool add" and "az aks update" + +0.4.43 ++++++ +* Fix issues with monitoring addon enabling with CLI versions 2.4.0+ + 0.4.43 +++++ * Add support for VMSS node public IP. diff --git a/src/aks-preview/azext_aks_preview/_help.py b/src/aks-preview/azext_aks_preview/_help.py index f0983247f0a..45075dc7b35 100644 --- a/src/aks-preview/azext_aks_preview/_help.py +++ b/src/aks-preview/azext_aks_preview/_help.py @@ -181,10 +181,10 @@ long-summary: If specified, please make sure the kubernetes version is larger than 1.10.6. - name: --min-count type: int - short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specifying the value in the range of [1, 100]. + short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100]. - name: --max-count type: int - short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specifying the value in the range of [1, 100]. + short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100]. - name: --cluster-autoscaler-profile type: list short-summary: Space-separated list of key=value pairs for configuring cluster autoscaler. Pass an empty string to clear the profile. @@ -199,7 +199,7 @@ short-summary: The node resource group is the resource group where all customer's resources will be created in, such as virtual machines. - name: --uptime-sla type: bool - short-summary: Enable paid managed cluster service with high availability. + short-summary: Enable a paid managed cluster service with a financially backed SLA. - name: --attach-acr type: string short-summary: Grant the 'acrpull' role assignment to the ACR specified by name or resource ID. @@ -307,10 +307,10 @@ short-summary: Update min-count or max-count for cluster autoscaler. - name: --min-count type: int - short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specifying the value in the range of [1, 100] + short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100] - name: --max-count type: int - short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specifying the value in the range of [1, 100] + short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100] - name: --cluster-autoscaler-profile type: list short-summary: Space-separated list of key=value pairs for configuring cluster autoscaler. Pass an empty string to clear the profile. @@ -355,6 +355,9 @@ - name: --aad-tenant-id type: string short-summary: The ID of an Azure Active Directory tenant. + - name: --aks-custom-headers + type: string + short-summary: Send custom headers. When specified, format should be Key1=Value1,Key2=Value2 examples: - name: Enable cluster-autoscaler within node count range [1,5] text: az aks update --enable-cluster-autoscaler --min-count 1 --max-count 5 -g MyResourceGroup -n MyManagedCluster @@ -486,10 +489,10 @@ short-summary: Enable cluster autoscaler. - name: --min-count type: int - short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specifying the value in the range of [1, 100] + short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100] - name: --max-count type: int - short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specifying the value in the range of [1, 100] + short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100] - name: --node-taints type: string short-summary: The node taints for the node pool. You can't change the node taints through CLI after the node pool is created. @@ -511,6 +514,9 @@ - name: --mode type: string short-summary: The mode for a node pool which defines a node pool's primary function. If set as "System", AKS prefers system pods scheduling to node pools with mode `System`. Learn more at https://aka.ms/aks/nodepool/mode. + - name: --aks-custom-headers + type: string + short-summary: Send custom headers. When specified, format should be Key1=Value1,Key2=Value2 """ helps['aks nodepool scale'] = """ @@ -546,10 +552,10 @@ short-summary: Update min-count or max-count for cluster autoscaler. - name: --min-count type: int - short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specifying the value in the range of [1, 100] + short-summary: Minimun nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100] - name: --max-count type: int - short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specifying the value in the range of [1, 100] + short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100] - name: --mode type: string short-summary: The mode for a node pool which defines a node pool's primary function. If set as "System", AKS prefers system pods scheduling to node pools with mode `System`. Learn more at https://aka.ms/aks/nodepool/mode. diff --git a/src/aks-preview/azext_aks_preview/_params.py b/src/aks-preview/azext_aks_preview/_params.py index badf811cd07..338a44cc4fe 100644 --- a/src/aks-preview/azext_aks_preview/_params.py +++ b/src/aks-preview/azext_aks_preview/_params.py @@ -119,6 +119,7 @@ def load_arguments(self, _): c.argument('disable_pod_security_policy', action='store_true') c.argument('attach_acr', acr_arg_type, validator=validate_acr) c.argument('detach_acr', acr_arg_type, validator=validate_acr) + c.argument('aks_custom_headers') with self.argument_context('aks scale') as c: c.argument('nodepool_name', type=str, @@ -146,6 +147,7 @@ def load_arguments(self, _): c.argument('spot_max_price', type=float, validator=validate_spot_max_price) c.argument('labels', nargs='*', validator=validate_nodepool_labels) c.argument('mode', arg_type=get_enum_type([CONST_NODEPOOL_MODE_SYSTEM, CONST_NODEPOOL_MODE_USER])) + c.argument('aks_custom_headers') for scope in ['aks nodepool show', 'aks nodepool delete', 'aks nodepool scale', 'aks nodepool upgrade', 'aks nodepool update']: with self.argument_context(scope) as c: diff --git a/src/aks-preview/azext_aks_preview/custom.py b/src/aks-preview/azext_aks_preview/custom.py index ed15b648ae8..37a673da365 100644 --- a/src/aks-preview/azext_aks_preview/custom.py +++ b/src/aks-preview/azext_aks_preview/custom.py @@ -262,11 +262,11 @@ def load_service_principals(config_path): def _invoke_deployment(cli_ctx, resource_group_name, deployment_name, template, parameters, validate, no_wait, subscription_id=None): - from azure.mgmt.resource.resources import ResourceManagementClient - from azure.mgmt.resource.resources.models import DeploymentProperties - + from azure.cli.core.profiles import ResourceType, get_sdk + DeploymentProperties = get_sdk(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, 'DeploymentProperties', mod='models') properties = DeploymentProperties(template=template, parameters=parameters, mode='incremental') - smc = get_mgmt_service_client(cli_ctx, ResourceManagementClient, subscription_id=subscription_id).deployments + smc = get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, + subscription_id=subscription_id).deployments if validate: logger.info('==== BEGIN TEMPLATE ====') logger.info(json.dumps(template, indent=2)) @@ -1009,15 +1009,7 @@ def aks_create(cmd, # pylint: disable=too-many-locals,too-many-statements,to tier="Paid" ) - headers = {} - if aks_custom_headers is not None: - if aks_custom_headers != "": - for pair in aks_custom_headers.split(','): - parts = pair.split('=') - if len(parts) != 2: - raise CLIError('custom headers format is incorrect') - - headers[parts[0]] = parts[1] + headers = get_aks_custom_headers(aks_custom_headers) # Due to SPN replication latency, we do a few retries here max_retry = 30 @@ -1096,7 +1088,8 @@ def aks_update(cmd, # pylint: disable=too-many-statements,too-many-branches, attach_acr=None, detach_acr=None, aad_tenant_id=None, - aad_admin_group_object_ids=None): + aad_admin_group_object_ids=None, + aks_custom_headers=None): update_autoscaler = enable_cluster_autoscaler or disable_cluster_autoscaler or update_cluster_autoscaler update_acr = attach_acr is not None or detach_acr is not None update_pod_security = enable_pod_security_policy or disable_pod_security_policy @@ -1136,18 +1129,14 @@ def aks_update(cmd, # pylint: disable=too-many-statements,too-many-branches, raise CLIError('There is more than one node pool in the cluster. Please use "az aks nodepool" command ' 'to update per node pool auto scaler settings') - node_count = instance.agent_pool_profiles[0].count - if min_count is None or max_count is None: if enable_cluster_autoscaler or update_cluster_autoscaler: - raise CLIError('Please specifying both min-count and max-count when --enable-cluster-autoscaler or ' + raise CLIError('Please specify both min-count and max-count when --enable-cluster-autoscaler or ' '--update-cluster-autoscaler set.') if min_count is not None and max_count is not None: if int(min_count) > int(max_count): raise CLIError('value of min-count should be less than or equal to value of max-count.') - if int(node_count) < int(min_count) or int(node_count) > int(max_count): - raise CLIError("current node count '{}' is not in the range of min-count and max-count.".format(node_count)) if enable_cluster_autoscaler: if instance.agent_pool_profiles[0].enable_auto_scaling: @@ -1248,7 +1237,8 @@ def aks_update(cmd, # pylint: disable=too-many-statements,too-many-branches, if aad_admin_group_object_ids is not None: instance.aad_profile.admin_group_object_ids = _parse_comma_separated_list(aad_admin_group_object_ids) - return sdk_no_wait(no_wait, client.create_or_update, resource_group_name, name, instance) + headers = get_aks_custom_headers(aks_custom_headers) + return sdk_no_wait(no_wait, client.create_or_update, resource_group_name, name, instance, custom_headers=headers) def aks_show(cmd, client, resource_group_name, name): # pylint: disable=unused-argument @@ -1416,7 +1406,7 @@ def aks_kollect(cmd, # pylint: disable=too-many-statements,too-many-locals sas_token = sas_token.strip('?') deployment_yaml = urlopen( - "https://raw.githubusercontent.com/Azure/aks-periscope/v0.2/deployment/aks-periscope.yaml").read().decode() + "https://raw.githubusercontent.com/Azure/aks-periscope/latest/deployment/aks-periscope.yaml").read().decode() deployment_yaml = deployment_yaml.replace("# ", (base64.b64encode(bytes(storage_account_name, 'ascii'))).decode('ascii')) deployment_yaml = deployment_yaml.replace("# ", @@ -1963,7 +1953,7 @@ def _check_cluster_autoscaler_flag(enable_cluster_autoscaler, agent_pool_profile): if enable_cluster_autoscaler: if min_count is None or max_count is None: - raise CLIError('Please specifying both min-count and max-count when --enable-cluster-autoscaler enabled') + raise CLIError('Please specify both min-count and max-count when --enable-cluster-autoscaler enabled') if int(min_count) > int(max_count): raise CLIError('value of min-count should be less than or equal to value of max-count') if int(node_count) < int(min_count) or int(node_count) > int(max_count): @@ -2075,6 +2065,7 @@ def aks_agentpool_add(cmd, # pylint: disable=unused-argument,too-many-local spot_max_price=float('nan'), labels=None, mode="User", + aks_custom_headers=None, no_wait=False): instances = client.list(resource_group_name, cluster_name) for agentpool_profile in instances: @@ -2128,7 +2119,8 @@ def aks_agentpool_add(cmd, # pylint: disable=unused-argument,too-many-local if node_osdisk_size: agent_pool.os_disk_size_gb = int(node_osdisk_size) - return sdk_no_wait(no_wait, client.create_or_update, resource_group_name, cluster_name, nodepool_name, agent_pool) + headers = get_aks_custom_headers(aks_custom_headers) + return sdk_no_wait(no_wait, client.create_or_update, resource_group_name, cluster_name, nodepool_name, agent_pool, custom_headers=headers) def aks_agentpool_scale(cmd, # pylint: disable=unused-argument @@ -2183,17 +2175,14 @@ def aks_agentpool_update(cmd, # pylint: disable=unused-argument '"--tags" or "--mode"') instance = client.get(resource_group_name, cluster_name, nodepool_name) - node_count = instance.count if min_count is None or max_count is None: if enable_cluster_autoscaler or update_cluster_autoscaler: - raise CLIError('Please specifying both min-count and max-count when --enable-cluster-autoscaler or ' + raise CLIError('Please specify both min-count and max-count when --enable-cluster-autoscaler or ' '--update-cluster-autoscaler set.') if min_count is not None and max_count is not None: if int(min_count) > int(max_count): raise CLIError('value of min-count should be less than or equal to value of max-count.') - if int(node_count) < int(min_count) or int(node_count) > int(max_count): - raise CLIError("current node count '{}' is not in the range of min-count and max-count.".format(node_count)) if enable_cluster_autoscaler: if instance.enable_auto_scaling: @@ -2684,3 +2673,15 @@ def format_bright(msg): def format_hyperlink(the_link): return f'\033[1m{colorama.Style.BRIGHT}{colorama.Fore.BLUE}{the_link}{colorama.Style.RESET_ALL}' + + +def get_aks_custom_headers(aks_custom_headers=None): + headers = {} + if aks_custom_headers is not None: + if aks_custom_headers != "": + for pair in aks_custom_headers.split(','): + parts = pair.split('=') + if len(parts) != 2: + raise CLIError('custom headers format is incorrect') + headers[parts[0]] = parts[1] + return headers diff --git a/src/aks-preview/setup.py b/src/aks-preview/setup.py index 41999f613e5..7acb3a823c0 100644 --- a/src/aks-preview/setup.py +++ b/src/aks-preview/setup.py @@ -8,7 +8,7 @@ from codecs import open as open1 from setuptools import setup, find_packages -VERSION = "0.4.43" +VERSION = "0.4.45" CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', diff --git a/src/application-insights/HISTORY.rst b/src/application-insights/HISTORY.rst index f45725c5d5e..1e27d7f2521 100644 --- a/src/application-insights/HISTORY.rst +++ b/src/application-insights/HISTORY.rst @@ -1,3 +1,11 @@ +0.1.7 +++++++++++++++++++ + +* support linked storage account for application insights component. +* support link one log analytics workspace to application insights component. +* support setting public network access for application insights component. +* one fix for api-key creation. + 0.1.6 ++++++++++++++++++ diff --git a/src/application-insights/azext_applicationinsights/_client_factory.py b/src/application-insights/azext_applicationinsights/_client_factory.py index ba29ec88ce1..1b1a6d58eec 100644 --- a/src/application-insights/azext_applicationinsights/_client_factory.py +++ b/src/application-insights/azext_applicationinsights/_client_factory.py @@ -36,7 +36,7 @@ def cf_events(cli_ctx, _): def cf_components(cli_ctx, _): - return applicationinsights_mgmt_plane_client(cli_ctx).components + return applicationinsights_mgmt_plane_client(cli_ctx, api_version='2018-05-01-preview').components def cf_component_billing(cli_ctx, _): @@ -45,3 +45,7 @@ def cf_component_billing(cli_ctx, _): def cf_api_key(cli_ctx, _): return applicationinsights_mgmt_plane_client(cli_ctx).api_keys + + +def cf_component_linked_storage_accounts(cli_ctx, _): + return applicationinsights_mgmt_plane_client(cli_ctx).component_linked_storage_accounts diff --git a/src/application-insights/azext_applicationinsights/_help.py b/src/application-insights/azext_applicationinsights/_help.py index 044f2a6d78b..7bd517b7f1b 100644 --- a/src/application-insights/azext_applicationinsights/_help.py +++ b/src/application-insights/azext_applicationinsights/_help.py @@ -242,3 +242,28 @@ text: | az monitor app-insights events show --app 578f0e27-12e9-4631-bc02-50b965da2633 --type availabilityResults --offset 24h """ + +helps['monitor app-insights component linked-storage'] = """ + type: group + short-summary: Manage linked storage account for an Application Insights component. +""" + +helps['monitor app-insights component linked-storage show'] = """ + type: command + short-summary: Show the details of linked storage account for an Application Insights component. +""" + +helps['monitor app-insights component linked-storage link'] = """ + type: command + short-summary: Link a storage account with an Application Insights component. +""" + +helps['monitor app-insights component linked-storage update'] = """ + type: command + short-summary: Update the linked storage account for an Application Insights component. +""" + +helps['monitor app-insights component linked-storage unlink'] = """ + type: command + short-summary: Unlink a storage account with an Application Insights component. +""" diff --git a/src/application-insights/azext_applicationinsights/_params.py b/src/application-insights/azext_applicationinsights/_params.py index d4965f0e96a..8cc27377630 100644 --- a/src/application-insights/azext_applicationinsights/_params.py +++ b/src/application-insights/azext_applicationinsights/_params.py @@ -3,10 +3,10 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -# pylint: disable=line-too-long -from azure.cli.core.commands.parameters import get_datetime_type, get_location_type, tags_type, get_three_state_flag +# pylint: disable=line-too-long, too-many-statements +from azure.cli.core.commands.parameters import get_datetime_type, get_location_type, tags_type, get_three_state_flag, get_enum_type from azure.cli.command_modules.monitor.actions import get_period_type -from ._validators import validate_applications +from ._validators import validate_applications, validate_storage_account_name_or_id, validate_log_analytic_workspace_name_or_id def load_arguments(self, _): @@ -24,6 +24,15 @@ def load_arguments(self, _): c.argument('application-type', options_list=['application-type', '--type', '-t'], help="Type of application being monitored. Possible values include: 'web', 'other'. Default value: 'web' .") c.argument('kind', options_list=['--kind', '-k'], help='The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone.') + with self.argument_context('monitor app-insights component') as c: + c.argument('workspace_resource_id', options_list=['--workspace'], validator=validate_log_analytic_workspace_name_or_id, + help='Name or resource ID of a log analytics workspace') + from .vendored_sdks.mgmt_applicationinsights.models import PublicNetworkAccessType + c.argument('public_network_access_for_ingestion', options_list=['--ingestion-access'], help='The public network access type for accessing Application Insights ingestion.', + arg_type=get_enum_type(PublicNetworkAccessType)) + c.argument('public_network_access_for_query', options_list=['--query-access'], help='The public network access type for accessing Application Insights query.', + arg_type=get_enum_type(PublicNetworkAccessType)) + with self.argument_context('monitor app-insights component update-tags') as c: c.argument('tags', tags_type) @@ -65,3 +74,7 @@ def load_arguments(self, _): c.argument('start_time', arg_type=get_datetime_type(help='Start-time of time range for which to retrieve data.')) c.argument('end_time', arg_type=get_datetime_type(help='End of time range for current operation. Defaults to the current time.')) c.argument('offset', help='Filter results based on UTC hour offset.', type=get_period_type(as_timedelta=True)) + + with self.argument_context('monitor app-insights component linked-storage') as c: + c.argument('storage_account_id', options_list=['--storage-account', '-s'], validator=validate_storage_account_name_or_id, + help='Name or ID of a linked storage account.') diff --git a/src/application-insights/azext_applicationinsights/_validators.py b/src/application-insights/azext_applicationinsights/_validators.py index 1b9fbebff67..a41f07163ee 100644 --- a/src/application-insights/azext_applicationinsights/_validators.py +++ b/src/application-insights/azext_applicationinsights/_validators.py @@ -16,3 +16,31 @@ def validate_applications(namespace): raise CLIError("Specify either a full resource id or an application name and resource group.") else: raise CLIError("Resource group only allowed with a single application name.") + + +def validate_storage_account_name_or_id(cmd, namespace): + if namespace.storage_account_id: + from msrestazure.tools import resource_id + from azure.cli.core.commands.client_factory import get_subscription_id + if not is_valid_resource_id(namespace.storage_account_id): + namespace.storage_account_id = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), + resource_group=namespace.resource_group_name, + namespace='Microsoft.Storage', + type='storageAccounts', + name=namespace.storage_account_id + ) + + +def validate_log_analytic_workspace_name_or_id(cmd, namespace): + if namespace.workspace_resource_id: + from msrestazure.tools import resource_id + from azure.cli.core.commands.client_factory import get_subscription_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 + ) diff --git a/src/application-insights/azext_applicationinsights/commands.py b/src/application-insights/azext_applicationinsights/commands.py index af8384faa65..ba1fcce2faa 100644 --- a/src/application-insights/azext_applicationinsights/commands.py +++ b/src/application-insights/azext_applicationinsights/commands.py @@ -13,7 +13,8 @@ cf_query, cf_components, cf_api_key, - cf_component_billing + cf_component_billing, + cf_component_linked_storage_accounts ) @@ -63,6 +64,11 @@ def load_command_table(self, _): client_factory=cf_api_key ) + component_linked_storage_accounts_custom_sdk = CliCommandType( + operations_tmpl='azext_applicationinsights.custom#{}', + client_factory=cf_component_linked_storage_accounts + ) + with self.command_group('monitor app-insights component', command_type=components_sdk, custom_command_type=components_custom_sdk) as g: g.custom_command('create', 'create_or_update_component') g.custom_command('update', 'update_component') @@ -88,3 +94,9 @@ def load_command_table(self, _): with self.command_group('monitor app-insights', query_sdk) as g: g.custom_command('query', 'execute_query') + + with self.command_group('monitor app-insights component linked-storage', custom_command_type=component_linked_storage_accounts_custom_sdk) as g: + g.custom_show_command('show', 'get_component_linked_storage_account') + g.custom_command('link', 'create_component_linked_storage_account') + g.custom_command('update', 'update_component_linked_storage_account') + g.custom_command('unlink', 'delete_component_linked_storage_account') diff --git a/src/application-insights/azext_applicationinsights/custom.py b/src/application-insights/azext_applicationinsights/custom.py index 34e7106ebed..d9a2536f280 100644 --- a/src/application-insights/azext_applicationinsights/custom.py +++ b/src/application-insights/azext_applicationinsights/custom.py @@ -3,14 +3,16 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -# pylint: disable=line-too-long +# pylint: disable=line-too-long, protected-access from knack.util import CLIError from knack.log import get_logger from azext_applicationinsights.vendored_sdks.applicationinsights.models import ErrorResponseException +from msrestazure.azure_exceptions import CloudError from .util import get_id_from_azure_resource, get_query_targets, get_timespan, get_linked_properties logger = get_logger(__name__) +HELP_MESSAGE = " Please use `az feature register --name AIWorkspacePreview --namespace microsoft.insights` to register the feature" def execute_query(cmd, client, application, analytics_query, start_time=None, end_time=None, offset='1h', resource_group_name=None): @@ -40,17 +42,59 @@ def get_metrics_metadata(cmd, client, application, resource_group_name=None): return client.metrics.get_metadata(get_id_from_azure_resource(cmd.cli_ctx, application, resource_group=resource_group_name)) -def create_or_update_component(client, application, resource_group_name, location, tags=None, kind="web", application_type='web'): - from .vendored_sdks.mgmt_applicationinsights.models import ApplicationInsightsComponent - component = ApplicationInsightsComponent(location, kind, application_type=application_type, tags=tags) - return client.create_or_update(resource_group_name, application, component) +def create_or_update_component(cmd, client, application, resource_group_name, location, tags=None, + kind="web", application_type='web', workspace_resource_id=None, + public_network_access_for_ingestion=None, public_network_access_for_query=None): + # due to service limitation, we have to do such a hack. We must refract the logic later. + if workspace_resource_id is None: + from .vendored_sdks.mgmt_applicationinsights.v2018_05_01_preview.models import ApplicationInsightsComponent + component = ApplicationInsightsComponent(location=location, kind=kind, application_type=application_type, tags=tags, + public_network_access_for_ingestion=public_network_access_for_ingestion, + public_network_access_for_query=public_network_access_for_query) + return client.create_or_update(resource_group_name, application, component) + + from .vendored_sdks.mgmt_applicationinsights.v2020_02_02_preview.models import ApplicationInsightsComponent + component = ApplicationInsightsComponent(location=location, kind=kind, application_type=application_type, + tags=tags, workspace_resource_id=workspace_resource_id, + public_network_access_for_ingestion=public_network_access_for_ingestion, + public_network_access_for_query=public_network_access_for_query) + from ._client_factory import applicationinsights_mgmt_plane_client + client = applicationinsights_mgmt_plane_client(cmd.cli_ctx, api_version='2020-02-02-preview').components + try: + return client.create_or_update(resource_group_name, application, component) + except CloudError as ex: + ex.error._message = ex.error._message + HELP_MESSAGE + raise ex -def update_component(client, application, resource_group_name, kind=None): - existing_component = client.get(resource_group_name, application) +def update_component(cmd, client, application, resource_group_name, kind=None, workspace_resource_id=None, + public_network_access_for_ingestion=None, public_network_access_for_query=None): + from ._client_factory import applicationinsights_mgmt_plane_client + existing_component = None + if workspace_resource_id is not None: + latest_client = applicationinsights_mgmt_plane_client(cmd.cli_ctx, api_version='2020-02-02-preview').components + try: + existing_component = latest_client.get(resource_group_name, application) + except CloudError as ex: + ex.error._message = ex.error._message + HELP_MESSAGE + raise ex + existing_component.workspace_resource_id = workspace_resource_id or None + else: + existing_component = client.get(resource_group_name, application) if kind: existing_component.kind = kind - return client.create_or_update(resource_group_name, application, existing_component) + if public_network_access_for_ingestion is not None: + existing_component.public_network_access_for_ingestion = public_network_access_for_ingestion + if public_network_access_for_query is not None: + existing_component.public_network_access_for_query = public_network_access_for_query + + if hasattr(existing_component, 'workspace_resource_id') and existing_component.workspace_resource_id is not None: + client = applicationinsights_mgmt_plane_client(cmd.cli_ctx, api_version='2020-02-02-preview').components + return client.create_or_update(resource_group_name, application, existing_component) + + from .vendored_sdks.mgmt_applicationinsights.v2018_05_01_preview.models import ApplicationInsightsComponent + component = ApplicationInsightsComponent(**(vars(existing_component))) + return client.create_or_update(resource_group_name, application, component) def update_component_tags(client, application, resource_group_name, tags): @@ -61,10 +105,17 @@ def get_component(client, application, resource_group_name): return client.get(resource_group_name, application) -def show_components(client, application=None, resource_group_name=None): +def show_components(cmd, client, application=None, resource_group_name=None): + from ._client_factory import applicationinsights_mgmt_plane_client if application: if resource_group_name: - return client.get(resource_group_name, application) + latest_client = applicationinsights_mgmt_plane_client(cmd.cli_ctx, + api_version='2020-02-02-preview').components + try: + return latest_client.get(resource_group_name, application) + except CloudError: + logger.warning(HELP_MESSAGE) + return client.get(resource_group_name, application) raise CLIError("Application provided without resource group. Either specify app with resource group, or remove app.") if resource_group_name: return client.list_by_resource_group(resource_group_name) @@ -82,7 +133,9 @@ def create_api_key(cmd, client, application, resource_group_name, api_key, read_ if write_properties is None: write_properties = ['WriteAnnotations'] linked_read_properties, linked_write_properties = get_linked_properties(cmd.cli_ctx, application, resource_group_name, read_properties, write_properties) - api_key_request = APIKeyRequest(api_key, linked_read_properties, linked_write_properties) + api_key_request = APIKeyRequest(name=api_key, + linked_read_properties=linked_read_properties, + linked_write_properties=linked_write_properties) return client.create(resource_group_name, application, api_key_request) @@ -118,3 +171,19 @@ def update_component_billing(client, application, resource_group_name, cap=None, resource_name=application, data_volume_cap=billing_features.data_volume_cap, current_billing_features=billing_features.current_billing_features) + + +def get_component_linked_storage_account(client, resource_group_name, application): + return client.get(resource_group_name=resource_group_name, resource_name=application) + + +def create_component_linked_storage_account(client, resource_group_name, application, storage_account_id): + return client.create_and_update(resource_group_name=resource_group_name, resource_name=application, linked_storage_account=storage_account_id) + + +def update_component_linked_storage_account(client, resource_group_name, application, storage_account_id): + return client.update(resource_group_name=resource_group_name, resource_name=application, linked_storage_account=storage_account_id) + + +def delete_component_linked_storage_account(client, resource_group_name, application): + return client.delete(resource_group_name=resource_group_name, resource_name=application) diff --git a/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_api_key.yaml b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_api_key.yaml index 0bfa1baf516..01c0a19a671 100644 --- a/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_api_key.yaml +++ b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_api_key.yaml @@ -1,7 +1,8 @@ interactions: - request: body: '{"location": "westus", "kind": "web", "properties": {"Application_Type": - "web", "Flow_Type": "Bluefield", "Request_Source": "rest"}}' + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "RetentionInDays": + 90}}' headers: Accept: - application/json @@ -12,32 +13,32 @@ interactions: Connection: - keep-alive Content-Length: - - '132' + - '155' Content-Type: - application/json; charset=utf-8 ParameterSetName: - --app --location --kind -g --application-type User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/demoApp?api-version=2018-05-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"91001882-0000-0700-0000-5e54c0970000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"13cc755b-0ba4-4259-bb7a-5426dfb5b666","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"6a4bf3ad-4167-42de-b2e7-0baecf5b95a0","ConnectionString":"InstrumentationKey=6a4bf3ad-4167-42de-b2e7-0baecf5b95a0","Name":"demoApp","CreationDate":"2020-02-25T06:37:11.9695313+00:00","TenantId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","provisioningState":"Succeeded","SamplingPercentage":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"0800841c-0000-0700-0000-5ea2593e0000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"5a7cdf10-6b7e-4f29-b41e-545309ec2a09","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"fa2f0e5b-bf95-42fa-8e90-ba1ea72adb40","ConnectionString":"InstrumentationKey=fa2f0e5b-bf95-42fa-8e90-ba1ea72adb40","Name":"demoApp","CreationDate":"2020-04-24T03:13:02.8547884+00:00","TenantId":"114f01e8-de03-454a-ab74-723456e241cb","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '833' + - '957' content-type: - application/json; charset=utf-8 date: - - Tue, 25 Feb 2020 06:37:16 GMT + - Fri, 24 Apr 2020 03:13:05 GMT expires: - '-1' pragma: @@ -55,7 +56,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' x-powered-by: - ASP.NET status: @@ -81,16 +82,16 @@ interactions: ParameterSetName: - --app -g --api-key User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 accept-language: - en-US method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/ApiKeys?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/demoApp/ApiKeys?api-version=2015-05-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/3b4ab45d-11e3-4e30-b640-d156f12cde5f","name":"demoKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"apiKey":"0kflfmtdga2ztfecwq3er77281slb15ds5tqdzhn","createdDate":"Tue, - 25 Feb 2020 06:37:19 GMT","integrationType":null,"integrationProperty":null}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/33d84fd7-1aa2-4626-8f54-07a2a7f625c3","name":"demoKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"apiKey":"hr0zj8fh1noyasqjf65j5jv8g2qnx7bdbb4t4rnm","createdDate":"Fri, + 24 Apr 2020 03:13:08 GMT","integrationType":null,"integrationProperty":null}' headers: access-control-expose-headers: - Request-Context @@ -101,7 +102,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 25 Feb 2020 06:37:19 GMT + - Fri, 24 Apr 2020 03:13:07 GMT expires: - '-1' pragma: @@ -134,21 +135,19 @@ interactions: - monitor app-insights api-key show Connection: - keep-alive - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - --app -g --api-key User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp/ApiKeys?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/demoApp/ApiKeys?api-version=2015-05-01 response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/3b4ab45d-11e3-4e30-b640-d156f12cde5f","name":"demoKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/draft","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/extendqueries","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/search","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/aggregate","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"createdDate":"Tue, - 25 Feb 2020 06:37:19 GMT","integrationType":null,"integrationProperty":null}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/33d84fd7-1aa2-4626-8f54-07a2a7f625c3","name":"demoKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/draft","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/extendqueries","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/search","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/aggregate","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"createdDate":"Fri, + 24 Apr 2020 03:13:08 GMT","integrationType":null,"integrationProperty":null}]}' headers: access-control-expose-headers: - Request-Context @@ -159,7 +158,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 25 Feb 2020 06:37:20 GMT + - Fri, 24 Apr 2020 03:13:10 GMT expires: - '-1' pragma: @@ -199,16 +198,16 @@ interactions: ParameterSetName: - --app -g --api-key User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 accept-language: - en-US method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/ApiKeys?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/demoApp/ApiKeys?api-version=2015-05-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/ec78280f-11d8-46b7-b587-ee1789e8c63a","name":"otherKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"apiKey":"sojhjt3f7fr0xz0lbwrw6ih0u58pb1ncd1ltft2j","createdDate":"Tue, - 25 Feb 2020 06:37:24 GMT","integrationType":null,"integrationProperty":null}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/49870748-bf6a-4841-86de-09bf586c709d","name":"otherKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"apiKey":"wcffbrl38wmkgq4lp2mfrkb6aki76t8hmz6gcz0f","createdDate":"Fri, + 24 Apr 2020 03:13:13 GMT","integrationType":null,"integrationProperty":null}' headers: access-control-expose-headers: - Request-Context @@ -219,7 +218,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 25 Feb 2020 06:37:23 GMT + - Fri, 24 Apr 2020 03:13:12 GMT expires: - '-1' pragma: @@ -242,43 +241,104 @@ interactions: code: 200 message: OK - request: - body: null + body: 'b''{"name": "emptyKey", "linkedReadProperties": ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"], + "linkedWriteProperties": []}''' headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - monitor app-insights api-key show + - monitor app-insights api-key create Connection: - keep-alive + Content-Length: + - '479' Content-Type: - application/json; charset=utf-8 ParameterSetName: + - --app -g --api-key --write-properties + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/demoApp/ApiKeys?api-version=2015-05-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/0101d573-96ad-49bd-b8bb-bfc810a6a7f8","name":"emptyKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":[],"apiKey":"lrdm01sidli8s1c22vj87vhz5wdew70x0kcxpnm7","createdDate":"Fri, + 24 Apr 2020 03:13:16 GMT","integrationType":null,"integrationProperty":null}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '864' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 24 Apr 2020 03:13:16 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights api-key show + Connection: + - keep-alive + ParameterSetName: - --app -g User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp/ApiKeys?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/demoApp/ApiKeys?api-version=2015-05-01 response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/ec78280f-11d8-46b7-b587-ee1789e8c63a","name":"otherKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/draft","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/extendqueries","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/search","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/aggregate","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"createdDate":"Tue, - 25 Feb 2020 06:37:24 GMT","integrationType":null,"integrationProperty":null},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/3b4ab45d-11e3-4e30-b640-d156f12cde5f","name":"demoKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/draft","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/extendqueries","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/search","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/aggregate","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"createdDate":"Tue, - 25 Feb 2020 06:37:19 GMT","integrationType":null,"integrationProperty":null}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/0101d573-96ad-49bd-b8bb-bfc810a6a7f8","name":"emptyKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/draft","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/extendqueries","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/search","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/aggregate","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":[],"createdDate":"Fri, + 24 Apr 2020 03:13:16 GMT","integrationType":null,"integrationProperty":null},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/49870748-bf6a-4841-86de-09bf586c709d","name":"otherKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/draft","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/extendqueries","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/search","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/aggregate","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"createdDate":"Fri, + 24 Apr 2020 03:13:13 GMT","integrationType":null,"integrationProperty":null},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/33d84fd7-1aa2-4626-8f54-07a2a7f625c3","name":"demoKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/draft","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/extendqueries","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/search","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/aggregate","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"createdDate":"Fri, + 24 Apr 2020 03:13:08 GMT","integrationType":null,"integrationProperty":null}]}' headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '3662' + - '5284' content-type: - application/json; charset=utf-8 date: - - Tue, 25 Feb 2020 06:37:25 GMT + - Fri, 24 Apr 2020 03:13:18 GMT expires: - '-1' pragma: @@ -309,33 +369,32 @@ interactions: - monitor app-insights api-key delete Connection: - keep-alive - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - --app -g --api-key User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp/ApiKeys?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/demoApp/ApiKeys?api-version=2015-05-01 response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/ec78280f-11d8-46b7-b587-ee1789e8c63a","name":"otherKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/draft","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/extendqueries","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/search","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/aggregate","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"createdDate":"Tue, - 25 Feb 2020 06:37:24 GMT","integrationType":null,"integrationProperty":null},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/3b4ab45d-11e3-4e30-b640-d156f12cde5f","name":"demoKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/draft","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/extendqueries","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/search","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/aggregate","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"createdDate":"Tue, - 25 Feb 2020 06:37:19 GMT","integrationType":null,"integrationProperty":null}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/0101d573-96ad-49bd-b8bb-bfc810a6a7f8","name":"emptyKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/draft","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/extendqueries","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/search","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/aggregate","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":[],"createdDate":"Fri, + 24 Apr 2020 03:13:16 GMT","integrationType":null,"integrationProperty":null},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/49870748-bf6a-4841-86de-09bf586c709d","name":"otherKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/draft","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/extendqueries","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/search","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/aggregate","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"createdDate":"Fri, + 24 Apr 2020 03:13:13 GMT","integrationType":null,"integrationProperty":null},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/33d84fd7-1aa2-4626-8f54-07a2a7f625c3","name":"demoKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/draft","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/extendqueries","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/search","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/aggregate","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"createdDate":"Fri, + 24 Apr 2020 03:13:08 GMT","integrationType":null,"integrationProperty":null}]}' headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '3662' + - '5284' content-type: - application/json; charset=utf-8 date: - - Tue, 25 Feb 2020 06:37:27 GMT + - Fri, 24 Apr 2020 03:13:20 GMT expires: - '-1' pragma: @@ -368,21 +427,19 @@ interactions: - keep-alive Content-Length: - '0' - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - --app -g --api-key User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp/APIKeys/ec78280f-11d8-46b7-b587-ee1789e8c63a?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/demoApp/APIKeys/49870748-bf6a-4841-86de-09bf586c709d?api-version=2015-05-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/ec78280f-11d8-46b7-b587-ee1789e8c63a","name":"otherKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/draft","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/extendqueries","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/search","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/aggregate","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"createdDate":"Tue, - 25 Feb 2020 06:37:24 GMT","integrationType":null,"integrationProperty":null}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/apikeys/49870748-bf6a-4841-86de-09bf586c709d","name":"otherKey","linkedReadProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/api","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/draft","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/extendqueries","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/search","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/aggregate","/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/agentconfig"],"linkedWriteProperties":["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp/annotations"],"createdDate":"Fri, + 24 Apr 2020 03:13:13 GMT","integrationType":null,"integrationProperty":null}' headers: access-control-expose-headers: - Request-Context @@ -393,7 +450,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 25 Feb 2020 06:37:29 GMT + - Fri, 24 Apr 2020 03:13:21 GMT expires: - '-1' pragma: diff --git a/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_component.yaml b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_component.yaml index bdb83e71408..dadd83825fe 100644 --- a/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_component.yaml +++ b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_component.yaml @@ -1,7 +1,8 @@ interactions: - request: body: '{"location": "westus", "kind": "web", "properties": {"Application_Type": - "web", "Flow_Type": "Bluefield", "Request_Source": "rest"}}' + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "RetentionInDays": + 90}}' headers: Accept: - application/json @@ -12,32 +13,32 @@ interactions: Connection: - keep-alive Content-Length: - - '132' + - '155' Content-Type: - application/json; charset=utf-8 ParameterSetName: - --app --location --kind -g --application-type User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/demoApp?api-version=2018-05-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"9100fa8e-0000-0700-0000-5e54c2440000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"de019f91-2846-48f1-95e6-c810b1874a3a","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"2d696d25-dd09-4385-86bb-2aff20723016","ConnectionString":"InstrumentationKey=2d696d25-dd09-4385-86bb-2aff20723016","Name":"demoApp","CreationDate":"2020-02-25T06:44:20.0141188+00:00","TenantId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","provisioningState":"Succeeded","SamplingPercentage":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"070084f6-0000-0700-0000-5ea256a90000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"a7aa35f1-c96a-4ee9-82a4-eafae4ef2f18","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"d44e4479-7ed7-4798-82b8-b0ff8cdafeb0","ConnectionString":"InstrumentationKey=d44e4479-7ed7-4798-82b8-b0ff8cdafeb0","Name":"demoApp","CreationDate":"2020-04-24T03:02:01.0980307+00:00","TenantId":"114f01e8-de03-454a-ab74-723456e241cb","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '833' + - '957' content-type: - application/json; charset=utf-8 date: - - Tue, 25 Feb 2020 06:44:21 GMT + - Fri, 24 Apr 2020 03:02:02 GMT expires: - '-1' pragma: @@ -72,31 +73,29 @@ interactions: - monitor app-insights component billing show Connection: - keep-alive - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - --app -g User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp/currentbillingfeatures?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/demoApp/currentbillingfeatures?api-version=2015-05-01 response: body: - string: '{"CurrentBillingFeatures":["Basic"],"DataVolumeCap":{"Cap":100.0,"MaxHistoryCap":1000.0,"ResetTime":0,"WarningThreshold":90,"StopSendNotificationWhenHitThreshold":false,"StopSendNotificationWhenHitCap":false},"EndTime":"2018-04-02T13:00:00+00:00"}' + string: '{"CurrentBillingFeatures":["Basic"],"DataVolumeCap":{"Cap":100.0,"MaxHistoryCap":1000.0,"ResetTime":5,"WarningThreshold":90,"StopSendNotificationWhenHitThreshold":false,"StopSendNotificationWhenHitCap":false},"EndTime":"9999-12-31T23:59:59.9999999+00:00"}' headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '247' + - '255' content-type: - application/json; charset=utf-8 date: - - Tue, 25 Feb 2020 06:44:25 GMT + - Fri, 24 Apr 2020 03:02:09 GMT expires: - '-1' pragma: @@ -129,31 +128,29 @@ interactions: - monitor app-insights component billing update Connection: - keep-alive - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - --app -g --cap -s User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp/currentbillingfeatures?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/demoApp/currentbillingfeatures?api-version=2015-05-01 response: body: - string: '{"CurrentBillingFeatures":["Basic"],"DataVolumeCap":{"Cap":100.0,"MaxHistoryCap":1000.0,"ResetTime":0,"WarningThreshold":90,"StopSendNotificationWhenHitThreshold":false,"StopSendNotificationWhenHitCap":false},"EndTime":"2018-04-02T13:00:00+00:00"}' + string: '{"CurrentBillingFeatures":["Basic"],"DataVolumeCap":{"Cap":100.0,"MaxHistoryCap":1000.0,"ResetTime":5,"WarningThreshold":90,"StopSendNotificationWhenHitThreshold":false,"StopSendNotificationWhenHitCap":false},"EndTime":"9999-12-31T23:59:59.9999999+00:00"}' headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '247' + - '255' content-type: - application/json; charset=utf-8 date: - - Tue, 25 Feb 2020 06:44:27 GMT + - Fri, 24 Apr 2020 03:02:12 GMT expires: - '-1' pragma: @@ -194,12 +191,12 @@ interactions: ParameterSetName: - --app -g --cap -s User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp/currentbillingfeatures?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/demoApp/currentbillingfeatures?api-version=2015-05-01 response: body: string: '{"CurrentBillingFeatures":["Basic"],"DataVolumeCap":{"Cap":200.0,"MaxHistoryCap":1000.0,"ResetTime":0,"WarningThreshold":90,"StopSendNotificationWhenHitThreshold":false,"StopSendNotificationWhenHitCap":true}}' @@ -213,7 +210,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 25 Feb 2020 06:44:34 GMT + - Fri, 24 Apr 2020 03:02:15 GMT expires: - '-1' pragma: @@ -231,7 +228,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' x-powered-by: - ASP.NET status: @@ -248,31 +245,29 @@ interactions: - monitor app-insights component update Connection: - keep-alive - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - --app --kind -g User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/demoApp?api-version=2018-05-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"9100fa8e-0000-0700-0000-5e54c2440000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"de019f91-2846-48f1-95e6-c810b1874a3a","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"2d696d25-dd09-4385-86bb-2aff20723016","ConnectionString":"InstrumentationKey=2d696d25-dd09-4385-86bb-2aff20723016","Name":"demoApp","CreationDate":"2020-02-25T06:44:20.0141188+00:00","TenantId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","provisioningState":"Succeeded","SamplingPercentage":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"070084f6-0000-0700-0000-5ea256a90000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"a7aa35f1-c96a-4ee9-82a4-eafae4ef2f18","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"d44e4479-7ed7-4798-82b8-b0ff8cdafeb0","ConnectionString":"InstrumentationKey=d44e4479-7ed7-4798-82b8-b0ff8cdafeb0","Name":"demoApp","CreationDate":"2020-04-24T03:02:01.0980307+00:00","TenantId":"114f01e8-de03-454a-ab74-723456e241cb","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '833' + - '957' content-type: - application/json; charset=utf-8 date: - - Tue, 25 Feb 2020 06:44:36 GMT + - Fri, 24 Apr 2020 03:02:17 GMT expires: - '-1' pragma: @@ -296,7 +291,9 @@ interactions: message: OK - request: body: '{"location": "westus", "tags": {}, "kind": "ios", "properties": {"Application_Type": - "web", "Flow_Type": "Bluefield", "Request_Source": "rest"}}' + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "RetentionInDays": + 90, "publicNetworkAccessForIngestion": "Enabled", "publicNetworkAccessForQuery": + "Enabled"}}' headers: Accept: - application/json @@ -307,32 +304,32 @@ interactions: Connection: - keep-alive Content-Length: - - '144' + - '255' Content-Type: - application/json; charset=utf-8 ParameterSetName: - --app --kind -g User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/demoApp?api-version=2018-05-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"ios","etag":"\"91009c8f-0000-0700-0000-5e54c2570000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"de019f91-2846-48f1-95e6-c810b1874a3a","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"2d696d25-dd09-4385-86bb-2aff20723016","ConnectionString":"InstrumentationKey=2d696d25-dd09-4385-86bb-2aff20723016","Name":"demoApp","CreationDate":"2020-02-25T06:44:20.0141188+00:00","TenantId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","provisioningState":"Succeeded","SamplingPercentage":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"ios","etag":"\"07000ef8-0000-0700-0000-5ea256bc0000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"a7aa35f1-c96a-4ee9-82a4-eafae4ef2f18","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"d44e4479-7ed7-4798-82b8-b0ff8cdafeb0","ConnectionString":"InstrumentationKey=d44e4479-7ed7-4798-82b8-b0ff8cdafeb0","Name":"demoApp","CreationDate":"2020-04-24T03:02:01.0980307+00:00","TenantId":"114f01e8-de03-454a-ab74-723456e241cb","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '833' + - '957' content-type: - application/json; charset=utf-8 date: - - Tue, 25 Feb 2020 06:44:42 GMT + - Fri, 24 Apr 2020 03:02:24 GMT expires: - '-1' pragma: @@ -350,7 +347,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1199' x-powered-by: - ASP.NET status: @@ -358,7 +355,8 @@ interactions: message: OK - request: body: '{"location": "westus", "kind": "ios", "properties": {"Application_Type": - "web", "Flow_Type": "Bluefield", "Request_Source": "rest"}}' + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "RetentionInDays": + 90}}' headers: Accept: - application/json @@ -369,32 +367,32 @@ interactions: Connection: - keep-alive Content-Length: - - '132' + - '155' Content-Type: - application/json; charset=utf-8 ParameterSetName: - --app --location --kind -g --application-type User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/testApp?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/testApp?api-version=2018-05-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/testApp","name":"testApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"ios","etag":"\"9100d58f-0000-0700-0000-5e54c25f0000\"","properties":{"Ver":"v2","ApplicationId":"testApp","AppId":"1460163c-e0b2-426c-817c-0e5a8c8c44d9","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"c2211cfa-2a95-4fcd-b6bf-53f8430f53a1","ConnectionString":"InstrumentationKey=c2211cfa-2a95-4fcd-b6bf-53f8430f53a1","Name":"testApp","CreationDate":"2020-02-25T06:44:47.0858616+00:00","TenantId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","provisioningState":"Succeeded","SamplingPercentage":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/testApp","name":"testApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"ios","etag":"\"0700a8f8-0000-0700-0000-5ea256c50000\"","properties":{"Ver":"v2","ApplicationId":"testApp","AppId":"132039a5-8267-47d8-994a-1c95b97a2981","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"46097bff-27ec-47a7-80bd-cf87f3a564c6","ConnectionString":"InstrumentationKey=46097bff-27ec-47a7-80bd-cf87f3a564c6","Name":"testApp","CreationDate":"2020-04-24T03:02:29.8415209+00:00","TenantId":"114f01e8-de03-454a-ab74-723456e241cb","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '833' + - '957' content-type: - application/json; charset=utf-8 date: - - Tue, 25 Feb 2020 06:44:48 GMT + - Fri, 24 Apr 2020 03:02:31 GMT expires: - '-1' pragma: @@ -412,7 +410,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' x-powered-by: - ASP.NET status: @@ -429,29 +427,27 @@ interactions: - monitor app-insights component show Connection: - keep-alive - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - -g User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components?api-version=2018-05-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"ios","etag":"\"91009c8f-0000-0700-0000-5e54c2570000\"","properties":{"ApplicationId":"demoApp","AppId":"de019f91-2846-48f1-95e6-c810b1874a3a","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"2d696d25-dd09-4385-86bb-2aff20723016","ConnectionString":"InstrumentationKey=2d696d25-dd09-4385-86bb-2aff20723016","Name":"demoApp","CreationDate":"2020-02-25T06:44:20.0141188+00:00","TenantId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","provisioningState":"Succeeded","SamplingPercentage":null}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/testApp","name":"testApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"ios","etag":"\"9100d58f-0000-0700-0000-5e54c25f0000\"","properties":{"ApplicationId":"testApp","AppId":"1460163c-e0b2-426c-817c-0e5a8c8c44d9","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"c2211cfa-2a95-4fcd-b6bf-53f8430f53a1","ConnectionString":"InstrumentationKey=c2211cfa-2a95-4fcd-b6bf-53f8430f53a1","Name":"testApp","CreationDate":"2020-02-25T06:44:47.0858616+00:00","TenantId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","provisioningState":"Succeeded","SamplingPercentage":null}}]}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"ios","etag":"\"07000ef8-0000-0700-0000-5ea256bc0000\"","properties":{"ApplicationId":"demoApp","AppId":"a7aa35f1-c96a-4ee9-82a4-eafae4ef2f18","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"d44e4479-7ed7-4798-82b8-b0ff8cdafeb0","ConnectionString":"InstrumentationKey=d44e4479-7ed7-4798-82b8-b0ff8cdafeb0","Name":"demoApp","CreationDate":"2020-04-24T03:02:01.0980307+00:00","TenantId":"114f01e8-de03-454a-ab74-723456e241cb","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/testApp","name":"testApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"ios","etag":"\"0700a8f8-0000-0700-0000-5ea256c50000\"","properties":{"ApplicationId":"testApp","AppId":"132039a5-8267-47d8-994a-1c95b97a2981","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"46097bff-27ec-47a7-80bd-cf87f3a564c6","ConnectionString":"InstrumentationKey=46097bff-27ec-47a7-80bd-cf87f3a564c6","Name":"testApp","CreationDate":"2020-04-24T03:02:29.8415209+00:00","TenantId":"114f01e8-de03-454a-ab74-723456e241cb","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}]}' headers: cache-control: - no-cache content-length: - - '1657' + - '1905' content-type: - application/json; charset=utf-8 date: - - Tue, 25 Feb 2020 06:44:50 GMT + - Fri, 24 Apr 2020 03:02:33 GMT expires: - '-1' pragma: @@ -463,8 +459,115 @@ interactions: x-content-type-options: - nosniff x-ms-original-request-ids: - - 519849f5-579a-11ea-ba84-70bc107e5d50 - - 519849f5-579a-11ea-ba84-70bc107e5d50 + - 0a473797-85d8-11ea-97c5-70bc107e5d50 + - 0a473797-85d8-11ea-97c5-70bc107e5d50 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component show + Connection: + - keep-alive + ParameterSetName: + - -g --app + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/testApp?api-version=2020-02-02-preview + response: + body: + string: '{"error":{"code":"NoRegisteredProviderFound","message":"No registered + resource provider found for location ''westus'' and API version ''2020-02-02-preview'' + for type ''components''. The supported api-versions are ''2014-04-01, 2014-08-01, + 2014-12-01-preview, 2015-05-01, 2018-05-01-preview''. The supported locations + are '', eastus, southcentralus, northeurope, westeurope, southeastasia, westus2, + uksouth, canadacentral, centralindia, japaneast, australiaeast, koreacentral, + francecentral, centralus, eastus2, eastasia, westus, southafricanorth, northcentralus, + brazilsouth, switzerlandnorth, australiasoutheast''."}}' + headers: + cache-control: + - no-cache + content-length: + - '608' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 24 Apr 2020 03:02:35 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 400 + message: Bad Request +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component show + Connection: + - keep-alive + ParameterSetName: + - -g --app + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/testApp?api-version=2018-05-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/testApp","name":"testApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"ios","etag":"\"0700a8f8-0000-0700-0000-5ea256c50000\"","properties":{"Ver":"v2","ApplicationId":"testApp","AppId":"132039a5-8267-47d8-994a-1c95b97a2981","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"46097bff-27ec-47a7-80bd-cf87f3a564c6","ConnectionString":"InstrumentationKey=46097bff-27ec-47a7-80bd-cf87f3a564c6","Name":"testApp","CreationDate":"2020-04-24T03:02:29.8415209+00:00","TenantId":"114f01e8-de03-454a-ab74-723456e241cb","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '957' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 24 Apr 2020 03:02:36 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - 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 status: code: 200 message: OK @@ -481,17 +584,15 @@ interactions: - keep-alive Content-Length: - '0' - Content-Type: - - application/json; charset=utf-8 ParameterSetName: - --app -g User-Agent: - - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 - azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python AZURECLI/2.1.0 + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Insights/components/demoApp?api-version=2018-05-01-preview response: body: string: '' @@ -503,7 +604,7 @@ interactions: content-length: - '0' date: - - Tue, 25 Feb 2020 06:44:59 GMT + - Fri, 24 Apr 2020 03:02:43 GMT expires: - '-1' pragma: diff --git a/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_component_with_linked_storage.yaml b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_component_with_linked_storage.yaml new file mode 100644 index 00000000000..4d0145920f1 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_component_with_linked_storage.yaml @@ -0,0 +1,525 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + 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/resourcegroups/clitest.rg000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-27T08:29:38Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '428' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:30: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: '{"location": "westus", "properties": {"sku": {"name": "PerGB2018"}, "retentionInDays": + 30}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + Content-Length: + - '91' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n + 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: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/clitest000004?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"b62f4493-9090-4f5e-9f58-d4534318b46a\",\r\n \"provisioningState\": \"Creating\",\r\n + \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": + \"Mon, 27 Apr 2020 08:30:50 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": + \"Tue, 28 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/clitest000004\",\r\n + \ \"name\": \"clitest000004\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1026' + content-type: + - application/json + date: + - Mon, 27 Apr 2020 08:30:52 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: + - monitor log-analytics workspace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + 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 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/clitest000004?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"b62f4493-9090-4f5e-9f58-d4534318b46a\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": + \"Mon, 27 Apr 2020 08:30:50 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": + \"Tue, 28 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/clitest000004\",\r\n + \ \"name\": \"clitest000004\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1027' + content-type: + - application/json + date: + - Mon, 27 Apr 2020 08:31:24 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", "kind": "web", "properties": {"Application_Type": + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "WorkspaceResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000004"}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component create + Connection: + - keep-alive + Content-Length: + - '373' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --app --location --kind -g --workspace --application-type + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/demoApp?api-version=2020-02-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"1900a607-0000-0700-0000-5ea698790000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"8c7760e8-1491-4215-91b9-e22e50f4ca31","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"70c408a2-1982-4e1f-a3c9-6eabf5a352e2","Name":"demoApp","CreationDate":"2020-04-27T08:31:53.5479888+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"WorkspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000004","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '1079' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:31:56 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: 'b''b\''{"properties": {"linkedStorageAccount": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/component000002"}}\''''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component linked-storage link + Connection: + - keep-alive + Content-Length: + - '255' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --app -g -s + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp/linkedStorageAccounts/serviceprofiler?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoapp/linkedstorageaccounts/serviceprofiler\",\r\n + \ \"name\": \"serviceprofiler\",\r\n \"type\": \"microsoft.insights/components/linkedstorageaccounts\",\r\n + \ \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/component000002\"\r\n + \ }\r\n}" + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '608' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:32:22 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component linked-storage show + Connection: + - keep-alive + ParameterSetName: + - --app -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp/linkedStorageAccounts/serviceprofiler?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoapp/linkedstorageaccounts/serviceprofiler\",\r\n + \ \"name\": \"serviceprofiler\",\r\n \"type\": \"microsoft.insights/components/linkedstorageaccounts\",\r\n + \ \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/component000002\"\r\n + \ }\r\n}" + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '608' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:32:26 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed + server: + - 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 + status: + code: 200 + message: OK +- request: + body: 'b''b\''{"properties": {"linkedStorageAccount": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/component000003"}}\''''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component linked-storage update + Connection: + - keep-alive + Content-Length: + - '255' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --app -g -s + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp/linkedStorageAccounts/serviceprofiler?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/microsoft.insights/components/demoapp/linkedstorageaccounts/serviceprofiler\",\r\n + \ \"name\": \"serviceprofiler\",\r\n \"type\": \"microsoft.insights/components/linkedstorageaccounts\",\r\n + \ \"properties\": {\r\n \"linkedStorageAccount\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Storage/storageAccounts/component000003\"\r\n + \ }\r\n}" + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '608' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:32:30 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component linked-storage unlink + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --app -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp/linkedStorageAccounts/serviceprofiler?api-version=2020-03-01-preview + response: + body: + string: '' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 27 Apr 2020 08:32:34 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component linked-storage show + Connection: + - keep-alive + ParameterSetName: + - --app -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.insights/components/demoApp/linkedStorageAccounts/serviceprofiler?api-version=2020-03-01-preview + response: + body: + string: 'null' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:32:38 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 404 + message: Not Found +version: 1 diff --git a/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_component_with_linked_workspace.yaml b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_component_with_linked_workspace.yaml new file mode 100644 index 00000000000..fe6a896e48b --- /dev/null +++ b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_component_with_linked_workspace.yaml @@ -0,0 +1,946 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + 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/resourcegroups/clitest.rg000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-27T08:22:57Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '428' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:23:05 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": {"sku": {"name": "PerGB2018"}, "retentionInDays": + 30}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + Content-Length: + - '91' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n + 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: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"983849b5-158e-40d7-895e-cf64f78eedec\",\r\n \"provisioningState\": \"Creating\",\r\n + \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": + \"Mon, 27 Apr 2020 08:23:12 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": + \"Mon, 27 Apr 2020 16: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/clitest000002\",\r\n + \ \"name\": \"clitest000002\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1026' + content-type: + - application/json + date: + - Mon, 27 Apr 2020 08:23:13 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + 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 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"983849b5-158e-40d7-895e-cf64f78eedec\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": + \"Mon, 27 Apr 2020 08:23:12 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": + \"Mon, 27 Apr 2020 16: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/clitest000002\",\r\n + \ \"name\": \"clitest000002\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1027' + content-type: + - application/json + date: + - Mon, 27 Apr 2020 08:23:45 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + 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/resourcegroups/clitest.rg000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-27T08:22:57Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '428' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:23:47 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": {"sku": {"name": "PerGB2018"}, "retentionInDays": + 30}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + Content-Length: + - '91' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n + 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: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/clitest000003?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"bea273ee-b49e-4e3d-a012-5093204d0e6d\",\r\n \"provisioningState\": \"Creating\",\r\n + \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": + \"Mon, 27 Apr 2020 08:23:54 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": + \"Mon, 27 Apr 2020 10: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/clitest000003\",\r\n + \ \"name\": \"clitest000003\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1026' + content-type: + - application/json + date: + - Mon, 27 Apr 2020 08:23:55 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: + - monitor log-analytics workspace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + 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 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/clitest000003?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"bea273ee-b49e-4e3d-a012-5093204d0e6d\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": + \"Mon, 27 Apr 2020 08:23:54 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": + \"Mon, 27 Apr 2020 10: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/clitest000003\",\r\n + \ \"name\": \"clitest000003\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1027' + content-type: + - application/json + date: + - Mon, 27 Apr 2020 08:24:28 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "kind": "web", "properties": {"Application_Type": + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "RetentionInDays": + 90}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component create + Connection: + - keep-alive + Content-Length: + - '155' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --app --location --kind -g --application-type + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/demoApp?api-version=2018-05-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"1800d0ff-0000-0700-0000-5ea696c50000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"aea67cde-e179-42d5-b51f-efe4548c63c4","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"697eb707-a56f-4ae1-948a-478e3159d171","ConnectionString":"InstrumentationKey=697eb707-a56f-4ae1-948a-478e3159d171","Name":"demoApp","CreationDate":"2020-04-27T08:24:37.8571823+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '957' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:24:40 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component update + Connection: + - keep-alive + ParameterSetName: + - --app --workspace -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/demoApp?api-version=2020-02-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"1800d0ff-0000-0700-0000-5ea696c50000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"aea67cde-e179-42d5-b51f-efe4548c63c4","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"697eb707-a56f-4ae1-948a-478e3159d171","Name":"demoApp","CreationDate":"2020-04-27T08:24:37.8571823+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '880' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:24:43 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - 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 + status: + code: 200 + message: OK +- request: + body: 'b''{"location": "westus", "tags": {}, "kind": "web", "properties": {"Application_Type": + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "WorkspaceResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000002", + "publicNetworkAccessForIngestion": "Enabled", "publicNetworkAccessForQuery": + "Enabled"}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component update + Connection: + - keep-alive + Content-Length: + - '473' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --app --workspace -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/demoApp?api-version=2020-02-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"1800faff-0000-0700-0000-5ea696cf0000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"aea67cde-e179-42d5-b51f-efe4548c63c4","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"697eb707-a56f-4ae1-948a-478e3159d171","Name":"demoApp","CreationDate":"2020-04-27T08:24:37.8571823+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","WorkspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000002","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '1119' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:24:49 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component update + Connection: + - keep-alive + ParameterSetName: + - --app --workspace -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/demoApp?api-version=2020-02-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"1800faff-0000-0700-0000-5ea696cf0000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"aea67cde-e179-42d5-b51f-efe4548c63c4","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"697eb707-a56f-4ae1-948a-478e3159d171","Name":"demoApp","CreationDate":"2020-04-27T08:24:37.8571823+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","WorkspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000002","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '1119' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:24:51 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - 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 + status: + code: 200 + message: OK +- request: + body: 'b''{"location": "westus", "tags": {}, "kind": "web", "properties": {"Application_Type": + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "WorkspaceResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000003", + "publicNetworkAccessForIngestion": "Enabled", "publicNetworkAccessForQuery": + "Enabled"}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component update + Connection: + - keep-alive + Content-Length: + - '473' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --app --workspace -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/demoApp?api-version=2020-02-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"19002d00-0000-0700-0000-5ea696d60000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"aea67cde-e179-42d5-b51f-efe4548c63c4","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"697eb707-a56f-4ae1-948a-478e3159d171","Name":"demoApp","CreationDate":"2020-04-27T08:24:37.8571823+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","WorkspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000003","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '1119' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:24:56 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component update + Connection: + - keep-alive + ParameterSetName: + - --app --workspace --kind -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/demoApp?api-version=2020-02-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"19002d00-0000-0700-0000-5ea696d60000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"aea67cde-e179-42d5-b51f-efe4548c63c4","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"697eb707-a56f-4ae1-948a-478e3159d171","Name":"demoApp","CreationDate":"2020-04-27T08:24:37.8571823+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","WorkspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000003","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '1119' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:24:59 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - 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 + status: + code: 200 + message: OK +- request: + body: 'b''{"location": "westus", "tags": {}, "kind": "ios", "properties": {"Application_Type": + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "WorkspaceResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000002", + "publicNetworkAccessForIngestion": "Enabled", "publicNetworkAccessForQuery": + "Enabled"}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component update + Connection: + - keep-alive + Content-Length: + - '473' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --app --workspace --kind -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/demoApp?api-version=2020-02-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"ios","etag":"\"19007500-0000-0700-0000-5ea696ea0000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"aea67cde-e179-42d5-b51f-efe4548c63c4","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"697eb707-a56f-4ae1-948a-478e3159d171","Name":"demoApp","CreationDate":"2020-04-27T08:24:37.8571823+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","WorkspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000002","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '1119' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:25:19 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: 'b''{"location": "westus", "kind": "ios", "properties": {"Application_Type": + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "WorkspaceResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000003"}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component create + Connection: + - keep-alive + Content-Length: + - '373' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --app --workspace --location --kind -g --application-type + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/testApp?api-version=2020-02-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/testApp","name":"testApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"ios","etag":"\"19000801-0000-0700-0000-5ea6970b0000\"","properties":{"Ver":"v2","ApplicationId":"testApp","AppId":"6d710c63-8820-4729-b78c-8344fd5adce2","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"869dc5d3-0c6e-42ee-b873-fbd1ad8c31fd","Name":"testApp","CreationDate":"2020-04-27T08:25:47.5261462+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"WorkspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000003","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '1079' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:25:49 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component update + Connection: + - keep-alive + ParameterSetName: + - --app --kind -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/testApp?api-version=2018-05-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/testApp","name":"testApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"ios","etag":"\"19000801-0000-0700-0000-5ea6970b0000\"","properties":{"Ver":"v2","ApplicationId":"testApp","AppId":"6d710c63-8820-4729-b78c-8344fd5adce2","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"869dc5d3-0c6e-42ee-b873-fbd1ad8c31fd","ConnectionString":"InstrumentationKey=869dc5d3-0c6e-42ee-b873-fbd1ad8c31fd","Name":"testApp","CreationDate":"2020-04-27T08:25:47.5261462+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"WorkspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000003","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '1156' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:25:52 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - 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 + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "tags": {}, "kind": "ios", "properties": {"Application_Type": + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "publicNetworkAccessForIngestion": + "Enabled", "publicNetworkAccessForQuery": "Enabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component update + Connection: + - keep-alive + Content-Length: + - '232' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --app --kind -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/testApp?api-version=2018-05-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/testApp","name":"testApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"ios","etag":"\"19003b01-0000-0700-0000-5ea697120000\"","properties":{"Ver":"v2","ApplicationId":"testApp","AppId":"6d710c63-8820-4729-b78c-8344fd5adce2","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"869dc5d3-0c6e-42ee-b873-fbd1ad8c31fd","ConnectionString":"InstrumentationKey=869dc5d3-0c6e-42ee-b873-fbd1ad8c31fd","Name":"testApp","CreationDate":"2020-04-27T08:25:47.5261462+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '917' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 08:25:55 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_component_with_public_network_access.yaml b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_component_with_public_network_access.yaml new file mode 100644 index 00000000000..ef3f191ce37 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_component_with_public_network_access.yaml @@ -0,0 +1,827 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + 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/resourcegroups/clitest.rg000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-27T06:55:02Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '428' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 06:55:10 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": {"sku": {"name": "PerGB2018"}, "retentionInDays": + 30}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + Content-Length: + - '91' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n + 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: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"464dcbb5-8819-4ba0-8d6e-67606ba327cb\",\r\n \"provisioningState\": \"Creating\",\r\n + \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": + \"Mon, 27 Apr 2020 06:55:23 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": + \"Mon, 27 Apr 2020 21: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/clitest000002\",\r\n + \ \"name\": \"clitest000002\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1026' + content-type: + - application/json + date: + - Mon, 27 Apr 2020 06:55:24 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: + - '1197' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + 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 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/clitest000002?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"464dcbb5-8819-4ba0-8d6e-67606ba327cb\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": + \"Mon, 27 Apr 2020 06:55:23 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": + \"Mon, 27 Apr 2020 21: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/clitest000002\",\r\n + \ \"name\": \"clitest000002\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1027' + content-type: + - application/json + date: + - Mon, 27 Apr 2020 06:55:55 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 workspace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + 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/resourcegroups/clitest.rg000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001","name":"clitest.rg000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-27T06:55:02Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '428' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 06:55:57 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": {"sku": {"name": "PerGB2018"}, "retentionInDays": + 30}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + Content-Length: + - '91' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n + 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: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/clitest000003?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"17962751-b050-4e2e-b086-2a3d10b42343\",\r\n \"provisioningState\": \"Creating\",\r\n + \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": + \"Mon, 27 Apr 2020 06:56:06 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": + \"Mon, 27 Apr 2020 14: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/clitest000003\",\r\n + \ \"name\": \"clitest000003\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1026' + content-type: + - application/json + date: + - Mon, 27 Apr 2020 06:56:07 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor log-analytics workspace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + 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 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest.rg000001/providers/Microsoft.OperationalInsights/workspaces/clitest000003?api-version=2020-03-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\": + \"17962751-b050-4e2e-b086-2a3d10b42343\",\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \"lastSkuUpdate\": + \"Mon, 27 Apr 2020 06:56:06 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\n + \ \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\": 1,\r\n + \ \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n },\r\n + \ \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n \"quotaNextResetTime\": + \"Mon, 27 Apr 2020 14: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/clitest000003\",\r\n + \ \"name\": \"clitest000003\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\",\r\n + \ \"location\": \"westus\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1027' + content-type: + - application/json + date: + - Mon, 27 Apr 2020 06:56:39 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "kind": "web", "properties": {"Application_Type": + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "RetentionInDays": + 90}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component create + Connection: + - keep-alive + Content-Length: + - '155' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --app --location --kind -g --application-type + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/demoApp?api-version=2018-05-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"1800ea8a-0000-0700-0000-5ea6822f0000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"f448d256-9440-4108-ab46-8d981bc5cdb6","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"05c3355e-312c-4535-93c3-092995b4c998","ConnectionString":"InstrumentationKey=05c3355e-312c-4535-93c3-092995b4c998","Name":"demoApp","CreationDate":"2020-04-27T06:56:47.271582+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '956' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 06:56:49 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component update + Connection: + - keep-alive + ParameterSetName: + - --app --query-access --ingestion-access -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/demoApp?api-version=2018-05-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"1800ea8a-0000-0700-0000-5ea6822f0000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"f448d256-9440-4108-ab46-8d981bc5cdb6","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"05c3355e-312c-4535-93c3-092995b4c998","ConnectionString":"InstrumentationKey=05c3355e-312c-4535-93c3-092995b4c998","Name":"demoApp","CreationDate":"2020-04-27T06:56:47.271582+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '956' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 06:56:52 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - 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 + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "tags": {}, "kind": "web", "properties": {"Application_Type": + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "RetentionInDays": + 90, "publicNetworkAccessForIngestion": "Enabled", "publicNetworkAccessForQuery": + "Enabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component update + Connection: + - keep-alive + Content-Length: + - '255' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --app --query-access --ingestion-access -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/demoApp?api-version=2018-05-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"1800268b-0000-0700-0000-5ea682350000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"f448d256-9440-4108-ab46-8d981bc5cdb6","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"05c3355e-312c-4535-93c3-092995b4c998","ConnectionString":"InstrumentationKey=05c3355e-312c-4535-93c3-092995b4c998","Name":"demoApp","CreationDate":"2020-04-27T06:56:47.271582+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '956' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 06:56:54 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component update + Connection: + - keep-alive + ParameterSetName: + - --app --workspace --query-access --ingestion-access -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/demoApp?api-version=2020-02-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"1800268b-0000-0700-0000-5ea682350000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"f448d256-9440-4108-ab46-8d981bc5cdb6","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"05c3355e-312c-4535-93c3-092995b4c998","Name":"demoApp","CreationDate":"2020-04-27T06:56:47.271582+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '879' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 06:56:57 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - 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 + status: + code: 200 + message: OK +- request: + body: 'b''{"location": "westus", "tags": {}, "kind": "web", "properties": {"Application_Type": + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "WorkspaceResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000002", + "publicNetworkAccessForIngestion": "Disabled", "publicNetworkAccessForQuery": + "Disabled"}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component update + Connection: + - keep-alive + Content-Length: + - '475' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --app --workspace --query-access --ingestion-access -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/demoApp?api-version=2020-02-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/demoApp","name":"demoApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"18004e8b-0000-0700-0000-5ea6823c0000\"","properties":{"Ver":"v2","ApplicationId":"demoApp","AppId":"f448d256-9440-4108-ab46-8d981bc5cdb6","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"05c3355e-312c-4535-93c3-092995b4c998","Name":"demoApp","CreationDate":"2020-04-27T06:56:47.271582+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"Retention":"P90D","WorkspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000002","publicNetworkAccessForIngestion":"Disabled","publicNetworkAccessForQuery":"Disabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '1120' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 06:57:01 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: 'b''{"location": "westus", "kind": "web", "properties": {"Application_Type": + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "WorkspaceResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000003", + "publicNetworkAccessForIngestion": "Disabled", "publicNetworkAccessForQuery": + "Enabled"}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component create + Connection: + - keep-alive + Content-Length: + - '462' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --app --workspace --location --query-access --ingestion-access -g --application-type + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/testApp?api-version=2020-02-02-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/testApp","name":"testApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"18009c8b-0000-0700-0000-5ea682480000\"","properties":{"Ver":"v2","ApplicationId":"testApp","AppId":"33ebfb02-f196-4fe9-baaf-14f44b722442","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"edb44ffb-496c-4d0b-a8fd-7e4a1b47799b","Name":"testApp","CreationDate":"2020-04-27T06:57:11.5863937+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"WorkspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000003","publicNetworkAccessForIngestion":"Disabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '1080' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 06:57:13 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component update + Connection: + - keep-alive + ParameterSetName: + - --app --kind -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/testApp?api-version=2018-05-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/testApp","name":"testApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"18009c8b-0000-0700-0000-5ea682480000\"","properties":{"Ver":"v2","ApplicationId":"testApp","AppId":"33ebfb02-f196-4fe9-baaf-14f44b722442","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"edb44ffb-496c-4d0b-a8fd-7e4a1b47799b","ConnectionString":"InstrumentationKey=edb44ffb-496c-4d0b-a8fd-7e4a1b47799b","Name":"testApp","CreationDate":"2020-04-27T06:57:11.5863937+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"WorkspaceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.OperationalInsights/workspaces/clitest000003","publicNetworkAccessForIngestion":"Disabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '1157' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 06:57:16 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - 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 + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "tags": {}, "kind": "ios", "properties": {"Application_Type": + "web", "Flow_Type": "Bluefield", "Request_Source": "rest", "publicNetworkAccessForIngestion": + "Disabled", "publicNetworkAccessForQuery": "Enabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights component update + Connection: + - keep-alive + Content-Length: + - '233' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --app --kind -g + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-applicationinsights/0.2.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.Insights/components/testApp?api-version=2018-05-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/microsoft.insights/components/testApp","name":"testApp","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"ios","etag":"\"1800c68b-0000-0700-0000-5ea6824e0000\"","properties":{"Ver":"v2","ApplicationId":"testApp","AppId":"33ebfb02-f196-4fe9-baaf-14f44b722442","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"edb44ffb-496c-4d0b-a8fd-7e4a1b47799b","ConnectionString":"InstrumentationKey=edb44ffb-496c-4d0b-a8fd-7e4a1b47799b","Name":"testApp","CreationDate":"2020-04-27T06:57:11.5863937+00:00","TenantId":"57947cb5-aadd-4b6c-9e8e-27f545bb7bf5","provisioningState":"Succeeded","SamplingPercentage":null,"publicNetworkAccessForIngestion":"Disabled","publicNetworkAccessForQuery":"Enabled"}}' + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '918' + content-type: + - application/json; charset=utf-8 + date: + - Mon, 27 Apr 2020 06:57:22 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_metrics_show.yaml b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_metrics_show.yaml index e93f37588e6..ca8b29fc84c 100644 --- a/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_metrics_show.yaml +++ b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_metrics_show.yaml @@ -60,10 +60,10 @@ interactions: accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ace-test/providers/microsoft.insights/components/ace-test?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ace-test/providers/Microsoft.Insights/components/ace-test?api-version=2015-05-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ace-test/providers/microsoft.insights/components/ace-test","name":"ace-test","type":"microsoft.insights/components","location":"westus2","tags":{},"kind":"Node.JS","etag":"\"08005c73-0000-0000-0000-59f3fe650000\"","properties":{"Ver":"v2","ApplicationId":"ace-test","AppId":"578f0e27-12e9-4631-bc02-50b965da2633","Application_Type":"Node.JS","Flow_Type":"Redfield","Request_Source":"IbizaAIExtension","InstrumentationKey":"1145833f-6099-4855-9cb1-557cea26389e","Name":"ace-test","CreationDate":"2017-10-28T03:49:57.2801146+00:00","PackageId":null,"TenantId":"056f3d78-504f-4b60-b19a-276b6f1687db","HockeyAppId":"","HockeyAppToken":null,"provisioningState":"Succeeded","SamplingPercentage":null,"CustomMetricsOptedInType":null,"Retention":null}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ace-test/providers/Microsoft.Insights/components/ace-test","name":"ace-test","type":"Microsoft.Insights/components","location":"westus2","tags":{},"kind":"Node.JS","etag":"\"08005c73-0000-0000-0000-59f3fe650000\"","properties":{"Ver":"v2","ApplicationId":"ace-test","AppId":"578f0e27-12e9-4631-bc02-50b965da2633","Application_Type":"Node.JS","Flow_Type":"Redfield","Request_Source":"IbizaAIExtension","InstrumentationKey":"1145833f-6099-4855-9cb1-557cea26389e","Name":"ace-test","CreationDate":"2017-10-28T03:49:57.2801146+00:00","PackageId":null,"TenantId":"056f3d78-504f-4b60-b19a-276b6f1687db","HockeyAppId":"","HockeyAppToken":null,"provisioningState":"Succeeded","SamplingPercentage":null,"CustomMetricsOptedInType":null,"Retention":null}}' headers: access-control-expose-headers: - Request-Context diff --git a/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_query_execute.yaml b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_query_execute.yaml index 517d90b6118..4432874c755 100644 --- a/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_query_execute.yaml +++ b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_query_execute.yaml @@ -64,9 +64,9 @@ interactions: azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ace-test/providers/microsoft.insights/components/ace-test?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ace-test/providers/Microsoft.Insights/components/ace-test?api-version=2015-05-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ace-test/providers/microsoft.insights/components/ace-test","name":"ace-test","type":"microsoft.insights/components","location":"westus2","tags":{},"kind":"Node.JS","etag":"\"08005c73-0000-0000-0000-59f3fe650000\"","properties":{"Ver":"v2","ApplicationId":"ace-test","AppId":"578f0e27-12e9-4631-bc02-50b965da2633","Application_Type":"Node.JS","Flow_Type":"Redfield","Request_Source":"IbizaAIExtension","InstrumentationKey":"1145833f-6099-4855-9cb1-557cea26389e","Name":"ace-test","CreationDate":"2017-10-28T03:49:57.2801146+00:00","PackageId":null,"TenantId":"056f3d78-504f-4b60-b19a-276b6f1687db","HockeyAppId":"","HockeyAppToken":null,"provisioningState":"Succeeded","SamplingPercentage":null,"CustomMetricsOptedInType":null}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ace-test/providers/Microsoft.Insights/components/ace-test","name":"ace-test","type":"Microsoft.Insights/components","location":"westus2","tags":{},"kind":"Node.JS","etag":"\"08005c73-0000-0000-0000-59f3fe650000\"","properties":{"Ver":"v2","ApplicationId":"ace-test","AppId":"578f0e27-12e9-4631-bc02-50b965da2633","Application_Type":"Node.JS","Flow_Type":"Redfield","Request_Source":"IbizaAIExtension","InstrumentationKey":"1145833f-6099-4855-9cb1-557cea26389e","Name":"ace-test","CreationDate":"2017-10-28T03:49:57.2801146+00:00","PackageId":null,"TenantId":"056f3d78-504f-4b60-b19a-276b6f1687db","HockeyAppId":"","HockeyAppToken":null,"provisioningState":"Succeeded","SamplingPercentage":null,"CustomMetricsOptedInType":null}}'} headers: access-control-expose-headers: [Request-Context] cache-control: [no-cache] @@ -122,9 +122,9 @@ interactions: azure-mgmt-applicationinsights/0.1.1 Azure-SDK-For-Python] accept-language: [en-US] method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ace-test/providers/microsoft.insights/components/ace-test?api-version=2015-05-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ace-test/providers/Microsoft.Insights/components/ace-test?api-version=2015-05-01 response: - body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ace-test/providers/microsoft.insights/components/ace-test","name":"ace-test","type":"microsoft.insights/components","location":"westus2","tags":{},"kind":"Node.JS","etag":"\"08005c73-0000-0000-0000-59f3fe650000\"","properties":{"Ver":"v2","ApplicationId":"ace-test","AppId":"578f0e27-12e9-4631-bc02-50b965da2633","Application_Type":"Node.JS","Flow_Type":"Redfield","Request_Source":"IbizaAIExtension","InstrumentationKey":"1145833f-6099-4855-9cb1-557cea26389e","Name":"ace-test","CreationDate":"2017-10-28T03:49:57.2801146+00:00","PackageId":null,"TenantId":"056f3d78-504f-4b60-b19a-276b6f1687db","HockeyAppId":"","HockeyAppToken":null,"provisioningState":"Succeeded","SamplingPercentage":null,"CustomMetricsOptedInType":null}}'} + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ace-test/providers/Microsoft.Insights/components/ace-test","name":"ace-test","type":"Microsoft.Insights/components","location":"westus2","tags":{},"kind":"Node.JS","etag":"\"08005c73-0000-0000-0000-59f3fe650000\"","properties":{"Ver":"v2","ApplicationId":"ace-test","AppId":"578f0e27-12e9-4631-bc02-50b965da2633","Application_Type":"Node.JS","Flow_Type":"Redfield","Request_Source":"IbizaAIExtension","InstrumentationKey":"1145833f-6099-4855-9cb1-557cea26389e","Name":"ace-test","CreationDate":"2017-10-28T03:49:57.2801146+00:00","PackageId":null,"TenantId":"056f3d78-504f-4b60-b19a-276b6f1687db","HockeyAppId":"","HockeyAppToken":null,"provisioningState":"Succeeded","SamplingPercentage":null,"CustomMetricsOptedInType":null}}'} headers: access-control-expose-headers: [Request-Context] cache-control: [no-cache] diff --git a/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_mgmt.py b/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_mgmt.py index 6ca55a9ec3a..e0766d01526 100644 --- a/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_mgmt.py +++ b/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_mgmt.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=line-too-long -from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest, StorageAccountPreparer class ApplicationInsightsManagementClientTests(ScenarioTest): @@ -54,6 +54,10 @@ def test_component(self, resource_group, location): apps = self.cmd('az monitor app-insights component show -g {resource_group}').get_output_in_json() assert len(apps) == 2 + self.cmd('az monitor app-insights component show -g {resource_group} --app {name_b}', checks=[ + self.check('name', '{name_b}') + ]) + self.cmd('az monitor app-insights component delete --app {name_a} -g {resource_group}', checks=[self.is_empty()]) return @@ -66,6 +70,7 @@ def test_api_key(self, resource_group, location): 'name': 'demoApp', 'apiKey': 'demoKey', 'apiKeyB': 'otherKey', + 'apiKeyC': 'emptyKey', 'kind': 'web', 'application_type': 'web' }) @@ -83,10 +88,140 @@ def test_api_key(self, resource_group, location): api_key = self.cmd('az monitor app-insights api-key create --app {name} -g {resource_group} --api-key {apiKeyB}').get_output_in_json() assert (api_key['apiKey'] is not None) + api_key = self.cmd('az monitor app-insights api-key create --app {name} -g {resource_group} --api-key {apiKeyC} --write-properties ""').get_output_in_json() + assert len(api_key['linkedReadProperties']) >= 2 # Some are not user configurable but will be added automatically + assert len(api_key['linkedWriteProperties']) == 0 + api_keys = self.cmd('az monitor app-insights api-key show --app {name} -g {resource_group}').get_output_in_json() - assert len(api_keys) == 2 + assert len(api_keys) == 3 self.cmd('az monitor app-insights api-key delete --app {name} -g {resource_group} --api-key {apiKeyB}', checks=[ self.check('name', '{apiKeyB}') ]) return + + @ResourceGroupPreparer(parameter_name_for_location='location') + @StorageAccountPreparer(name_prefix='component', kind='StorageV2') + @StorageAccountPreparer(name_prefix='component', kind='StorageV2', parameter_name='storage_account_2') + def test_component_with_linked_storage(self, resource_group, location, storage_account, storage_account_2): + self.kwargs.update({ + 'loc': location, + 'resource_group': resource_group, + 'name_a': 'demoApp', + 'kind': 'web', + 'application_type': 'web', + 'storage_account': storage_account, + 'ws_1': self.create_random_name('clitest', 20), + 'storage_account_2': storage_account_2 + }) + self.cmd('monitor log-analytics workspace create -g {resource_group} -n {ws_1}') + self.cmd( + 'monitor app-insights component create --app {name_a} --location {loc} --kind {kind} -g {resource_group} --workspace {ws_1} --application-type {application_type}', + checks=[ + self.check('name', '{name_a}'), + self.check('location', '{loc}'), + self.check('kind', '{kind}'), + self.check('applicationType', '{application_type}'), + self.check('applicationId', '{name_a}'), + self.check('provisioningState', 'Succeeded'), + ]) + + output_json = self.cmd('monitor app-insights component linked-storage link --app {name_a} -g {resource_group} -s {storage_account}').get_output_in_json() + assert self.kwargs['storage_account'] in output_json['linkedStorageAccount'] + output_json = self.cmd('monitor app-insights component linked-storage show --app {name_a} -g {resource_group}').get_output_in_json() + assert self.kwargs['storage_account'] in output_json['linkedStorageAccount'] + output_json = self.cmd('monitor app-insights component linked-storage update --app {name_a} -g {resource_group} -s {storage_account_2}').get_output_in_json() + assert self.kwargs['storage_account_2'] in output_json['linkedStorageAccount'] + self.cmd('monitor app-insights component linked-storage unlink --app {name_a} -g {resource_group}') + with self.assertRaisesRegexp(SystemExit, '3'): + self.cmd('monitor app-insights component linked-storage show --app {name_a} -g {resource_group}') + + @ResourceGroupPreparer(parameter_name_for_location='location') + def test_component_with_linked_workspace(self, resource_group, location): + self.kwargs.update({ + 'loc': location, + 'resource_group': resource_group, + 'name_a': 'demoApp', + 'name_b': 'testApp', + 'kind': 'web', + 'application_type': 'web', + 'ws_1': self.create_random_name('clitest', 20), + 'ws_2': self.create_random_name('clitest', 20) + }) + + self.cmd('monitor log-analytics workspace create -g {resource_group} -n {ws_1}') + self.cmd('monitor log-analytics workspace create -g {resource_group} -n {ws_2}') + self.cmd( + 'monitor app-insights component create --app {name_a} --location {loc} --kind {kind} -g {resource_group} --application-type {application_type}', + checks=[ + self.check('name', '{name_a}'), + self.check('location', '{loc}'), + self.check('kind', '{kind}'), + self.check('applicationType', '{application_type}'), + self.check('applicationId', '{name_a}'), + self.check('provisioningState', 'Succeeded'), + ]) + + self.kwargs.update({ + 'kind': 'ios' + }) + + output_json = self.cmd('az monitor app-insights component update --app {name_a} --workspace {ws_1} -g {resource_group}').get_output_in_json() + assert self.kwargs['ws_1'] in output_json['workspaceResourceId'] + output_json = self.cmd('az monitor app-insights component update --app {name_a} --workspace {ws_2} -g {resource_group}').get_output_in_json() + assert self.kwargs['ws_2'] in output_json['workspaceResourceId'] + + output_json = self.cmd('az monitor app-insights component update --app {name_a} --workspace {ws_1} --kind {kind} -g {resource_group}').get_output_in_json() + assert self.kwargs['ws_1'] in output_json['workspaceResourceId'] + assert output_json['kind'] == self.kwargs['kind'] + output_json = self.cmd('az monitor app-insights component create --app {name_b} --workspace {ws_2} --location {loc} --kind {kind} -g {resource_group} --application-type {application_type}').get_output_in_json() + assert self.kwargs['ws_2'] in output_json['workspaceResourceId'] + assert output_json['kind'] == self.kwargs['kind'] + output_json = self.cmd('az monitor app-insights component update --app {name_b} --kind {kind} -g {resource_group}').get_output_in_json() + assert output_json['kind'] == self.kwargs['kind'] + + @ResourceGroupPreparer(parameter_name_for_location='location') + def test_component_with_public_network_access(self, resource_group, location): + self.kwargs.update({ + 'loc': location, + 'resource_group': resource_group, + 'name_a': 'demoApp', + 'name_b': 'testApp', + 'kind': 'web', + 'application_type': 'web', + 'ws_1': self.create_random_name('clitest', 20), + 'ws_2': self.create_random_name('clitest', 20) + }) + + self.cmd('monitor log-analytics workspace create -g {resource_group} -n {ws_1}') + self.cmd('monitor log-analytics workspace create -g {resource_group} -n {ws_2}') + self.cmd( + 'monitor app-insights component create --app {name_a} --location {loc} --kind {kind} -g {resource_group} --application-type {application_type}', + checks=[ + self.check('name', '{name_a}'), + self.check('location', '{loc}'), + self.check('kind', '{kind}'), + self.check('applicationType', '{application_type}'), + self.check('applicationId', '{name_a}'), + self.check('provisioningState', 'Succeeded'), + ]) + + output_json = self.cmd('az monitor app-insights component update --app {name_a} --query-access Enabled --ingestion-access Enabled -g {resource_group}').get_output_in_json() + assert output_json['publicNetworkAccessForIngestion'] == 'Enabled' + assert output_json['publicNetworkAccessForQuery'] == 'Enabled' + output_json = self.cmd('az monitor app-insights component update --app {name_a} --workspace {ws_1} --query-access Disabled --ingestion-access Disabled -g {resource_group}').get_output_in_json() + assert self.kwargs['ws_1'] in output_json['workspaceResourceId'] + assert output_json['publicNetworkAccessForIngestion'] == 'Disabled' + assert output_json['publicNetworkAccessForQuery'] == 'Disabled' + output_json = self.cmd('az monitor app-insights component create --app {name_b} --workspace {ws_2} --location {loc} --query-access Enabled --ingestion-access Disabled -g {resource_group} --application-type {application_type}').get_output_in_json() + assert self.kwargs['ws_2'] in output_json['workspaceResourceId'] + assert output_json['publicNetworkAccessForIngestion'] == 'Disabled' + assert output_json['publicNetworkAccessForQuery'] == 'Enabled' + + self.kwargs.update({ + 'kind': 'ios' + }) + + self.cmd('az monitor app-insights component update --app {name_b} --kind {kind} -g {resource_group}', checks=[ + self.check('kind', '{kind}') + ]) diff --git a/src/application-insights/azext_applicationinsights/util.py b/src/application-insights/azext_applicationinsights/util.py index 0550e1e5d6b..ad4ecb0c045 100644 --- a/src/application-insights/azext_applicationinsights/util.py +++ b/src/application-insights/azext_applicationinsights/util.py @@ -6,17 +6,19 @@ from datetime import datetime import dateutil.parser # pylint: disable=import-error from msrestazure.tools import is_valid_resource_id, parse_resource_id -from azext_applicationinsights._client_factory import cf_components, applicationinsights_mgmt_plane_client +from azext_applicationinsights._client_factory import applicationinsights_mgmt_plane_client def get_id_from_azure_resource(cli_ctx, app, resource_group=None): if is_valid_resource_id(app): parsed = parse_resource_id(app) resource_group, name, subscription = parsed["resource_group"], parsed["name"], parsed["subscription"] - client = applicationinsights_mgmt_plane_client(cli_ctx, subscription_id=subscription).components + client = applicationinsights_mgmt_plane_client(cli_ctx, subscription_id=subscription, + api_version='2015-05-01').components return client.get(resource_group, name).app_id if resource_group: - return cf_components(cli_ctx, None).get(resource_group, app).app_id + client = applicationinsights_mgmt_plane_client(cli_ctx, api_version='2015-05-01').components + return client.get(resource_group, app).app_id return app @@ -63,12 +65,12 @@ def get_linked_properties(cli_ctx, app, resource_group, read_properties=None, wr if isinstance(read_properties, list): propLen = len(read_properties) - linked_read_properties = ['{}/{}'.format(tmpl, roles[read_properties[i]]) for i in range(propLen)] + linked_read_properties = ['{}/{}'.format(tmpl, roles[read_properties[i]]) for i in range(propLen) if read_properties[i]] # pylint: disable=line-too-long else: linked_read_properties = ['{}/{}'.format(tmpl, roles[read_properties])] if isinstance(write_properties, list): propLen = len(write_properties) - linked_write_properties = ['{}/{}'.format(tmpl, roles[write_properties[i]]) for i in range(propLen)] + linked_write_properties = ['{}/{}'.format(tmpl, roles[write_properties[i]]) for i in range(propLen) if write_properties[i]] # pylint: disable=line-too-long else: linked_write_properties = ['{}/{}'.format(tmpl, roles[write_properties])] return linked_read_properties, linked_write_properties diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/__init__.py index e33c5d13ed5..298512941d9 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/__init__.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .application_insights_management_client import ApplicationInsightsManagementClient -from .version import VERSION +from ._configuration import ApplicationInsightsManagementClientConfiguration +from ._application_insights_management_client import ApplicationInsightsManagementClient +__all__ = ['ApplicationInsightsManagementClient', 'ApplicationInsightsManagementClientConfiguration'] -__all__ = ['ApplicationInsightsManagementClient'] +from .version import VERSION __version__ = VERSION diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/_application_insights_management_client.py new file mode 100644 index 00000000000..d2d1abb1bbf --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/_application_insights_management_client.py @@ -0,0 +1,455 @@ +# 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 azure.profiles import KnownProfiles, ProfileDefinition +from azure.profiles.multiapiclient import MultiApiClientMixin +from ._configuration import ApplicationInsightsManagementClientConfiguration + + + +class ApplicationInsightsManagementClient(MultiApiClientMixin, SDKClient): + """Composite Swagger for Application Insights Management Client + + This ready contains multiple API versions, to help you deal with all Azure clouds + (Azure Stack, Azure Government, Azure China, etc.). + By default, uses latest API version available on public Azure. + For production, you should stick a particular api-version and/or profile. + The profile sets a mapping between the operation group and an API version. + The api-version parameter sets the default API version if the operation + group is not described in the profile. + + :ivar config: Configuration for client. + :vartype config: ApplicationInsightsManagementClientConfiguration + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: 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 str api_version: API version to use if no profile is provided, or if + missing in profile. + :param str base_url: Service URL + :param profile: A profile definition, from KnownProfiles to dict. + :type profile: azure.profiles.KnownProfiles + """ + + DEFAULT_API_VERSION = '2020-03-01-preview' + _PROFILE_TAG = "azure.mgmt.applicationinsights.ApplicationInsightsManagementClient" + LATEST_PROFILE = ProfileDefinition({ + _PROFILE_TAG: { + None: DEFAULT_API_VERSION, + 'analytics_items': '2015-05-01', + 'annotations': '2015-05-01', + 'api_keys': '2015-05-01', + 'component_available_features': '2015-05-01', + 'component_current_billing_features': '2015-05-01', + 'component_current_pricing_plan': '2017-10-01', + 'component_feature_capabilities': '2015-05-01', + 'component_quota_status': '2015-05-01', + 'components': '2020-02-02-preview', + 'ea_subscription_list_migration_date': '2017-10-01', + 'ea_subscription_migrate_to_new_pricing_model': '2017-10-01', + 'ea_subscription_rollback_to_legacy_pricing_model': '2017-10-01', + 'export_configurations': '2015-05-01', + 'favorites': '2015-05-01', + 'operations': '2015-05-01', + 'proactive_detection_configurations': '2018-05-01-preview', + 'queries': '2019-09-01-preview', + 'query_packs': '2019-09-01-preview', + 'web_test_locations': '2015-05-01', + 'web_tests': '2015-05-01', + 'work_item_configurations': '2015-05-01', + 'workbook_templates': '2019-10-17-preview', + 'workbooks': '2018-06-17-preview', + }}, + _PROFILE_TAG + " latest" + ) + + def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default): + self.config = ApplicationInsightsManagementClientConfiguration(credentials, subscription_id, base_url) + super(ApplicationInsightsManagementClient, self).__init__( + credentials, + self.config, + api_version=api_version, + profile=profile + ) + + @classmethod + def _models_dict(cls, api_version): + return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} + + @classmethod + def models(cls, api_version=DEFAULT_API_VERSION): + """Module depends on the API version: + + * 2015-05-01: :mod:`v2015_05_01.models` + * 2017-10-01: :mod:`v2017_10_01.models` + * 2018-05-01-preview: :mod:`v2018_05_01_preview.models` + * 2018-06-17-preview: :mod:`v2018_06_17_preview.models` + * 2019-09-01-preview: :mod:`v2019_09_01_preview.models` + * 2019-10-17-preview: :mod:`v2019_10_17_preview.models` + * 2020-02-02-preview: :mod:`v2020_02_02_preview.models` + * 2020-03-01-preview: :mod:`v2020_03_01_preview.models` + """ + if api_version == '2015-05-01': + from .v2015_05_01 import models + return models + elif api_version == '2017-10-01': + from .v2017_10_01 import models + return models + elif api_version == '2018-05-01-preview': + from .v2018_05_01_preview import models + return models + elif api_version == '2018-06-17-preview': + from .v2018_06_17_preview import models + return models + elif api_version == '2019-09-01-preview': + from .v2019_09_01_preview import models + return models + elif api_version == '2019-10-17-preview': + from .v2019_10_17_preview import models + return models + elif api_version == '2020-02-02-preview': + from .v2020_02_02_preview import models + return models + elif api_version == '2020-03-01-preview': + from .v2020_03_01_preview import models + return models + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + + @property + def analytics_items(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`AnalyticsItemsOperations` + """ + api_version = self._get_api_version('analytics_items') + if api_version == '2015-05-01': + from .v2015_05_01.operations import AnalyticsItemsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def annotations(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`AnnotationsOperations` + """ + api_version = self._get_api_version('annotations') + if api_version == '2015-05-01': + from .v2015_05_01.operations import AnnotationsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def api_keys(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`APIKeysOperations` + """ + api_version = self._get_api_version('api_keys') + if api_version == '2015-05-01': + from .v2015_05_01.operations import APIKeysOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def component_available_features(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`ComponentAvailableFeaturesOperations` + """ + api_version = self._get_api_version('component_available_features') + if api_version == '2015-05-01': + from .v2015_05_01.operations import ComponentAvailableFeaturesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def component_current_billing_features(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`ComponentCurrentBillingFeaturesOperations` + """ + api_version = self._get_api_version('component_current_billing_features') + if api_version == '2015-05-01': + from .v2015_05_01.operations import ComponentCurrentBillingFeaturesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def component_current_pricing_plan(self): + """Instance depends on the API version: + + * 2017-10-01: :class:`ComponentCurrentPricingPlanOperations` + """ + api_version = self._get_api_version('component_current_pricing_plan') + if api_version == '2017-10-01': + from .v2017_10_01.operations import ComponentCurrentPricingPlanOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def component_feature_capabilities(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`ComponentFeatureCapabilitiesOperations` + """ + api_version = self._get_api_version('component_feature_capabilities') + if api_version == '2015-05-01': + from .v2015_05_01.operations import ComponentFeatureCapabilitiesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def component_linked_storage_accounts(self): + """Instance depends on the API version: + + * 2020-03-01-preview: :class:`ComponentLinkedStorageAccountsOperations` + """ + api_version = self._get_api_version('component_linked_storage_accounts') + if api_version == '2020-03-01-preview': + from .v2020_03_01_preview.operations import ComponentLinkedStorageAccountsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def component_quota_status(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`ComponentQuotaStatusOperations` + """ + api_version = self._get_api_version('component_quota_status') + if api_version == '2015-05-01': + from .v2015_05_01.operations import ComponentQuotaStatusOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def components(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`ComponentsOperations` + * 2018-05-01-preview: :class:`ComponentsOperations` + * 2020-02-02-preview: :class:`ComponentsOperations` + """ + api_version = self._get_api_version('components') + if api_version == '2015-05-01': + from .v2015_05_01.operations import ComponentsOperations as OperationClass + elif api_version == '2018-05-01-preview': + from .v2018_05_01_preview.operations import ComponentsOperations as OperationClass + elif api_version == '2020-02-02-preview': + from .v2020_02_02_preview.operations import ComponentsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def ea_subscription_list_migration_date(self): + """Instance depends on the API version: + + * 2017-10-01: :class:`EASubscriptionListMigrationDateOperations` + """ + api_version = self._get_api_version('ea_subscription_list_migration_date') + if api_version == '2017-10-01': + from .v2017_10_01.operations import EASubscriptionListMigrationDateOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def ea_subscription_migrate_to_new_pricing_model(self): + """Instance depends on the API version: + + * 2017-10-01: :class:`EASubscriptionMigrateToNewPricingModelOperations` + """ + api_version = self._get_api_version('ea_subscription_migrate_to_new_pricing_model') + if api_version == '2017-10-01': + from .v2017_10_01.operations import EASubscriptionMigrateToNewPricingModelOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def ea_subscription_rollback_to_legacy_pricing_model(self): + """Instance depends on the API version: + + * 2017-10-01: :class:`EASubscriptionRollbackToLegacyPricingModelOperations` + """ + api_version = self._get_api_version('ea_subscription_rollback_to_legacy_pricing_model') + if api_version == '2017-10-01': + from .v2017_10_01.operations import EASubscriptionRollbackToLegacyPricingModelOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def export_configurations(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`ExportConfigurationsOperations` + """ + api_version = self._get_api_version('export_configurations') + if api_version == '2015-05-01': + from .v2015_05_01.operations import ExportConfigurationsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def favorites(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`FavoritesOperations` + """ + api_version = self._get_api_version('favorites') + if api_version == '2015-05-01': + from .v2015_05_01.operations import FavoritesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def operations(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2015-05-01': + from .v2015_05_01.operations import Operations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def proactive_detection_configurations(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`ProactiveDetectionConfigurationsOperations` + * 2018-05-01-preview: :class:`ProactiveDetectionConfigurationsOperations` + """ + api_version = self._get_api_version('proactive_detection_configurations') + if api_version == '2015-05-01': + from .v2015_05_01.operations import ProactiveDetectionConfigurationsOperations as OperationClass + elif api_version == '2018-05-01-preview': + from .v2018_05_01_preview.operations import ProactiveDetectionConfigurationsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def queries(self): + """Instance depends on the API version: + + * 2019-09-01-preview: :class:`QueriesOperations` + """ + api_version = self._get_api_version('queries') + if api_version == '2019-09-01-preview': + from .v2019_09_01_preview.operations import QueriesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def query_packs(self): + """Instance depends on the API version: + + * 2019-09-01-preview: :class:`QueryPacksOperations` + """ + api_version = self._get_api_version('query_packs') + if api_version == '2019-09-01-preview': + from .v2019_09_01_preview.operations import QueryPacksOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def web_test_locations(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`WebTestLocationsOperations` + """ + api_version = self._get_api_version('web_test_locations') + if api_version == '2015-05-01': + from .v2015_05_01.operations import WebTestLocationsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def web_tests(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`WebTestsOperations` + """ + api_version = self._get_api_version('web_tests') + if api_version == '2015-05-01': + from .v2015_05_01.operations import WebTestsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def work_item_configurations(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`WorkItemConfigurationsOperations` + """ + api_version = self._get_api_version('work_item_configurations') + if api_version == '2015-05-01': + from .v2015_05_01.operations import WorkItemConfigurationsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def workbook_templates(self): + """Instance depends on the API version: + + * 2019-10-17-preview: :class:`WorkbookTemplatesOperations` + """ + api_version = self._get_api_version('workbook_templates') + if api_version == '2019-10-17-preview': + from .v2019_10_17_preview.operations import WorkbookTemplatesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def workbooks(self): + """Instance depends on the API version: + + * 2015-05-01: :class:`WorkbooksOperations` + * 2018-06-17-preview: :class:`WorkbooksOperations` + """ + api_version = self._get_api_version('workbooks') + if api_version == '2015-05-01': + from .v2015_05_01.operations import WorkbooksOperations as OperationClass + elif api_version == '2018-06-17-preview': + from .v2018_06_17_preview.operations import WorkbooksOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/_configuration.py new file mode 100644 index 00000000000..6c855295a4b --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/_configuration.py @@ -0,0 +1,48 @@ +# 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 ApplicationInsightsManagementClientConfiguration(AzureConfiguration): + """Configuration for ApplicationInsightsManagementClient + 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: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(ApplicationInsightsManagementClientConfiguration, 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-applicationinsights/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/application_insights_management_client.py deleted file mode 100644 index 241589ea580..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/application_insights_management_client.py +++ /dev/null @@ -1,116 +0,0 @@ -# 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 ServiceClient -from msrest import Serializer, Deserializer -from msrestazure import AzureConfiguration -from .version import VERSION -from .operations.operations import Operations -from .operations.components_operations import ComponentsOperations -from .operations.web_tests_operations import WebTestsOperations -from .operations.export_configurations_operations import ExportConfigurationsOperations -from .operations.proactive_detection_configurations_operations import ProactiveDetectionConfigurationsOperations -from .operations.component_current_billing_features_operations import ComponentCurrentBillingFeaturesOperations -from .operations.component_quota_status_operations import ComponentQuotaStatusOperations -from .operations.api_keys_operations import APIKeysOperations -from . import models - - -class ApplicationInsightsManagementClientConfiguration(AzureConfiguration): - """Configuration for ApplicationInsightsManagementClient - 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: The Azure subscription ID. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, 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 not base_url: - base_url = 'https://management.azure.com' - - super(ApplicationInsightsManagementClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-applicationinsights/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client - - :ivar config: Configuration for client. - :vartype config: ApplicationInsightsManagementClientConfiguration - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.applicationinsights.operations.Operations - :ivar components: Components operations - :vartype components: azure.mgmt.applicationinsights.operations.ComponentsOperations - :ivar web_tests: WebTests operations - :vartype web_tests: azure.mgmt.applicationinsights.operations.WebTestsOperations - :ivar export_configurations: ExportConfigurations operations - :vartype export_configurations: azure.mgmt.applicationinsights.operations.ExportConfigurationsOperations - :ivar proactive_detection_configurations: ProactiveDetectionConfigurations operations - :vartype proactive_detection_configurations: azure.mgmt.applicationinsights.operations.ProactiveDetectionConfigurationsOperations - :ivar component_current_billing_features: ComponentCurrentBillingFeatures operations - :vartype component_current_billing_features: azure.mgmt.applicationinsights.operations.ComponentCurrentBillingFeaturesOperations - :ivar component_quota_status: ComponentQuotaStatus operations - :vartype component_quota_status: azure.mgmt.applicationinsights.operations.ComponentQuotaStatusOperations - :ivar api_keys: APIKeys operations - :vartype api_keys: azure.mgmt.applicationinsights.operations.APIKeysOperations - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The Azure subscription ID. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - - self.config = ApplicationInsightsManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2015-05-01' - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self.config, self._serialize, self._deserialize) - self.components = ComponentsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.web_tests = WebTestsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.export_configurations = ExportConfigurationsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.proactive_detection_configurations = ProactiveDetectionConfigurationsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.component_current_billing_features = ComponentCurrentBillingFeaturesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.component_quota_status = ComponentQuotaStatusOperations( - self._client, self.config, self._serialize, self._deserialize) - self.api_keys = APIKeysOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models.py new file mode 100644 index 00000000000..b2518264a52 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models.py @@ -0,0 +1,14 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from .v2015_05_01.models import * +from .v2017_10_01.models import * +from .v2018_05_01_preview.models import * +from .v2018_06_17_preview.models import * +from .v2019_09_01_preview.models import * +from .v2019_10_17_preview.models import * +from .v2020_02_02_preview.models import * +from .v2020_03_01_preview.models import * diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/__init__.py deleted file mode 100644 index 40e594f9b55..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/__init__.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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 .error_response import ErrorResponse, ErrorResponseException -from .operation_display import OperationDisplay -from .operation import Operation -from .resource import Resource -from .tags_resource import TagsResource -from .application_insights_component import ApplicationInsightsComponent -from .web_test_geolocation import WebTestGeolocation -from .web_test_properties_configuration import WebTestPropertiesConfiguration -from .web_test import WebTest -from .application_insights_component_export_request import ApplicationInsightsComponentExportRequest -from .application_insights_component_export_configuration import ApplicationInsightsComponentExportConfiguration -from .application_insights_component_proactive_detection_configuration_rule_definitions import ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions -from .application_insights_component_proactive_detection_configuration import ApplicationInsightsComponentProactiveDetectionConfiguration -from .application_insights_component_data_volume_cap import ApplicationInsightsComponentDataVolumeCap -from .application_insights_component_billing_features import ApplicationInsightsComponentBillingFeatures -from .application_insights_component_quota_status import ApplicationInsightsComponentQuotaStatus -from .api_key_request import APIKeyRequest -from .application_insights_component_api_key import ApplicationInsightsComponentAPIKey -from .operation_paged import OperationPaged -from .application_insights_component_paged import ApplicationInsightsComponentPaged -from .web_test_paged import WebTestPaged -from .application_insights_component_api_key_paged import ApplicationInsightsComponentAPIKeyPaged -from .application_insights_management_client_enums import ( - ApplicationType, - FlowType, - RequestSource, - WebTestKind, -) - -__all__ = [ - 'ErrorResponse', 'ErrorResponseException', - 'OperationDisplay', - 'Operation', - 'Resource', - 'TagsResource', - 'ApplicationInsightsComponent', - 'WebTestGeolocation', - 'WebTestPropertiesConfiguration', - 'WebTest', - 'ApplicationInsightsComponentExportRequest', - 'ApplicationInsightsComponentExportConfiguration', - 'ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions', - 'ApplicationInsightsComponentProactiveDetectionConfiguration', - 'ApplicationInsightsComponentDataVolumeCap', - 'ApplicationInsightsComponentBillingFeatures', - 'ApplicationInsightsComponentQuotaStatus', - 'APIKeyRequest', - 'ApplicationInsightsComponentAPIKey', - 'OperationPaged', - 'ApplicationInsightsComponentPaged', - 'WebTestPaged', - 'ApplicationInsightsComponentAPIKeyPaged', - 'ApplicationType', - 'FlowType', - 'RequestSource', - 'WebTestKind', -] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/api_key_request.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/api_key_request.py deleted file mode 100644 index a802d1544b8..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/api_key_request.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 - - -class APIKeyRequest(Model): - """An Application Insights component API Key createion request definition. - - :param name: The name of the API Key. - :type name: str - :param linked_read_properties: The read access rights of this API Key. - :type linked_read_properties: list[str] - :param linked_write_properties: The write access rights of this API Key. - :type linked_write_properties: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'linked_read_properties': {'key': 'linkedReadProperties', 'type': '[str]'}, - 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, - } - - def __init__(self, name=None, linked_read_properties=None, linked_write_properties=None): - super(APIKeyRequest, self).__init__() - self.name = name - self.linked_read_properties = linked_read_properties - self.linked_write_properties = linked_write_properties diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component.py deleted file mode 100644 index f3c11134bfe..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component.py +++ /dev/null @@ -1,132 +0,0 @@ -# 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 .resource import Resource - - -class ApplicationInsightsComponent(Resource): - """An Application Insights component definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Azure resource Id - :vartype id: str - :ivar name: Azure resource name - :vartype name: str - :ivar type: Azure resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param kind: The kind of application that this component refers to, used - to customize UI. This value is a freeform string, values should typically - be one of the following: web, ios, other, store, java, phone. - :type kind: str - :ivar application_id: The unique ID of your application. This field - mirrors the 'Name' field and cannot be changed. - :vartype application_id: str - :ivar app_id: Application Insights Unique ID for your Application. - :vartype app_id: str - :param application_type: Type of application being monitored. Possible - values include: 'web', 'other'. Default value: "web" . - :type application_type: str or - ~azure.mgmt.applicationinsights.models.ApplicationType - :param flow_type: Used by the Application Insights system to determine - what kind of flow this component was created by. This is to be set to - 'Bluefield' when creating/updating a component via the REST API. Possible - values include: 'Bluefield'. Default value: "Bluefield" . - :type flow_type: str or ~azure.mgmt.applicationinsights.models.FlowType - :param request_source: Describes what tool created this Application - Insights component. Customers using this API should set this to the - default 'rest'. Possible values include: 'rest'. Default value: "rest" . - :type request_source: str or - ~azure.mgmt.applicationinsights.models.RequestSource - :ivar instrumentation_key: Application Insights Instrumentation key. A - read-only value that applications can use to identify the destination for - all telemetry sent to Azure Application Insights. This value will be - supplied upon construction of each new Application Insights component. - :vartype instrumentation_key: str - :ivar creation_date: Creation Date for the Application Insights component, - in ISO 8601 format. - :vartype creation_date: datetime - :ivar tenant_id: Azure Tenant Id. - :vartype tenant_id: str - :param hockey_app_id: The unique application ID created when a new - application is added to HockeyApp, used for communications with HockeyApp. - :type hockey_app_id: str - :ivar hockey_app_token: Token used to authenticate communications with - between Application Insights and HockeyApp. - :vartype hockey_app_token: str - :ivar provisioning_state: Current state of this component: whether or not - is has been provisioned within the resource group it is defined. Users - cannot change this value but are able to read from it. Values will include - Succeeded, Deploying, Canceled, and Failed. - :vartype provisioning_state: str - :param sampling_percentage: Percentage of the data produced by the - application being monitored that is being sampled for Application Insights - telemetry. - :type sampling_percentage: float - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'kind': {'required': True}, - 'application_id': {'readonly': True}, - 'app_id': {'readonly': True}, - 'application_type': {'required': True}, - 'instrumentation_key': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'hockey_app_token': {'readonly': True}, - 'provisioning_state': {'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}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'application_id': {'key': 'properties.ApplicationId', 'type': 'str'}, - 'app_id': {'key': 'properties.AppId', 'type': 'str'}, - 'application_type': {'key': 'properties.Application_Type', 'type': 'str'}, - 'flow_type': {'key': 'properties.Flow_Type', 'type': 'str'}, - 'request_source': {'key': 'properties.Request_Source', 'type': 'str'}, - 'instrumentation_key': {'key': 'properties.InstrumentationKey', 'type': 'str'}, - 'creation_date': {'key': 'properties.CreationDate', 'type': 'iso-8601'}, - 'tenant_id': {'key': 'properties.TenantId', 'type': 'str'}, - 'hockey_app_id': {'key': 'properties.HockeyAppId', 'type': 'str'}, - 'hockey_app_token': {'key': 'properties.HockeyAppToken', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'sampling_percentage': {'key': 'properties.SamplingPercentage', 'type': 'float'}, - } - - def __init__(self, location, kind, tags=None, application_type="web", flow_type="Bluefield", request_source="rest", hockey_app_id=None, sampling_percentage=None): - super(ApplicationInsightsComponent, self).__init__(location=location, tags=tags) - self.kind = kind - self.application_id = None - self.app_id = None - self.application_type = application_type - self.flow_type = flow_type - self.request_source = request_source - self.instrumentation_key = None - self.creation_date = None - self.tenant_id = None - self.hockey_app_id = hockey_app_id - self.hockey_app_token = None - self.provisioning_state = None - self.sampling_percentage = sampling_percentage diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_api_key.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_api_key.py deleted file mode 100644 index b5d76a45250..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_api_key.py +++ /dev/null @@ -1,58 +0,0 @@ -# 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 - - -class ApplicationInsightsComponentAPIKey(Model): - """Properties that define an API key of an Application Insights Component. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The unique ID of the API key inside an Applciation Insights - component. It is auto generated when the API key is created. - :vartype id: str - :ivar api_key: The API key value. It will be only return once when the API - Key was created. - :vartype api_key: str - :param created_date: The create date of this API key. - :type created_date: str - :param name: The name of the API key. - :type name: str - :param linked_read_properties: The read access rights of this API Key. - :type linked_read_properties: list[str] - :param linked_write_properties: The write access rights of this API Key. - :type linked_write_properties: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'api_key': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'api_key': {'key': 'apiKey', 'type': 'str'}, - 'created_date': {'key': 'createdDate', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'linked_read_properties': {'key': 'linkedReadProperties', 'type': '[str]'}, - 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, - } - - def __init__(self, created_date=None, name=None, linked_read_properties=None, linked_write_properties=None): - super(ApplicationInsightsComponentAPIKey, self).__init__() - self.id = None - self.api_key = None - self.created_date = created_date - self.name = name - self.linked_read_properties = linked_read_properties - self.linked_write_properties = linked_write_properties diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_billing_features.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_billing_features.py deleted file mode 100644 index c6a653660cd..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_billing_features.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 - - -class ApplicationInsightsComponentBillingFeatures(Model): - """An Application Insights component billing features. - - :param data_volume_cap: An Application Insights component daily data - volumne cap - :type data_volume_cap: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentDataVolumeCap - :param current_billing_features: Current enabled pricing plan. When the - component is in the Enterprise plan, this will list both 'Basic' and - 'Application Insights Enterprise'. - :type current_billing_features: list[str] - """ - - _attribute_map = { - 'data_volume_cap': {'key': 'DataVolumeCap', 'type': 'ApplicationInsightsComponentDataVolumeCap'}, - 'current_billing_features': {'key': 'CurrentBillingFeatures', 'type': '[str]'}, - } - - def __init__(self, data_volume_cap=None, current_billing_features=None): - super(ApplicationInsightsComponentBillingFeatures, self).__init__() - self.data_volume_cap = data_volume_cap - self.current_billing_features = current_billing_features diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_data_volume_cap.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_data_volume_cap.py deleted file mode 100644 index 3fd7a709fc2..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_data_volume_cap.py +++ /dev/null @@ -1,59 +0,0 @@ -# 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 - - -class ApplicationInsightsComponentDataVolumeCap(Model): - """An Application Insights component daily data volumne cap. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param cap: Daily data volume cap in GB. - :type cap: float - :ivar reset_time: Daily data volume cap UTC reset hour. - :vartype reset_time: int - :param warning_threshold: Reserved, not used for now. - :type warning_threshold: int - :param stop_send_notification_when_hit_threshold: Reserved, not used for - now. - :type stop_send_notification_when_hit_threshold: bool - :param stop_send_notification_when_hit_cap: Do not send a notification - email when the daily data volume cap is met. - :type stop_send_notification_when_hit_cap: bool - :ivar max_history_cap: Maximum daily data volume cap that the user can set - for this component. - :vartype max_history_cap: float - """ - - _validation = { - 'reset_time': {'readonly': True}, - 'max_history_cap': {'readonly': True}, - } - - _attribute_map = { - 'cap': {'key': 'Cap', 'type': 'float'}, - 'reset_time': {'key': 'ResetTime', 'type': 'int'}, - 'warning_threshold': {'key': 'WarningThreshold', 'type': 'int'}, - 'stop_send_notification_when_hit_threshold': {'key': 'StopSendNotificationWhenHitThreshold', 'type': 'bool'}, - 'stop_send_notification_when_hit_cap': {'key': 'StopSendNotificationWhenHitCap', 'type': 'bool'}, - 'max_history_cap': {'key': 'MaxHistoryCap', 'type': 'float'}, - } - - def __init__(self, cap=None, warning_threshold=None, stop_send_notification_when_hit_threshold=None, stop_send_notification_when_hit_cap=None): - super(ApplicationInsightsComponentDataVolumeCap, self).__init__() - self.cap = cap - self.reset_time = None - self.warning_threshold = warning_threshold - self.stop_send_notification_when_hit_threshold = stop_send_notification_when_hit_threshold - self.stop_send_notification_when_hit_cap = stop_send_notification_when_hit_cap - self.max_history_cap = None diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_export_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_export_configuration.py deleted file mode 100644 index 33a28500dd7..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_export_configuration.py +++ /dev/null @@ -1,142 +0,0 @@ -# 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 - - -class ApplicationInsightsComponentExportConfiguration(Model): - """Properties that define a Continuous Export configuration. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar export_id: The unique ID of the export configuration inside an - Applciation Insights component. It is auto generated when the Continuous - Export configuration is created. - :vartype export_id: str - :ivar instrumentation_key: The instrumentation key of the Application - Insights component. - :vartype instrumentation_key: str - :param record_types: This comma separated list of document types that will - be exported. The possible values include 'Requests', 'Event', - 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', - 'PerformanceCounters', 'Availability', 'Messages'. - :type record_types: str - :ivar application_name: The name of the Application Insights component. - :vartype application_name: str - :ivar subscription_id: The subscription of the Application Insights - component. - :vartype subscription_id: str - :ivar resource_group: The resource group of the Application Insights - component. - :vartype resource_group: str - :ivar destination_storage_subscription_id: The destination storage account - subscription ID. - :vartype destination_storage_subscription_id: str - :ivar destination_storage_location_id: The destination account location - ID. - :vartype destination_storage_location_id: str - :ivar destination_account_id: The name of destination account. - :vartype destination_account_id: str - :ivar destination_type: The destination type. - :vartype destination_type: str - :ivar is_user_enabled: This will be 'true' if the Continuous Export - configuration is enabled, otherwise it will be 'false'. - :vartype is_user_enabled: str - :ivar last_user_update: Last time the Continuous Export configuration was - updated. - :vartype last_user_update: str - :param notification_queue_enabled: Deprecated - :type notification_queue_enabled: str - :ivar export_status: This indicates current Continuous Export - configuration status. The possible values are 'Preparing', 'Success', - 'Failure'. - :vartype export_status: str - :ivar last_success_time: The last time data was successfully delivered to - the destination storage container for this Continuous Export - configuration. - :vartype last_success_time: str - :ivar last_gap_time: The last time the Continuous Export configuration - started failing. - :vartype last_gap_time: str - :ivar permanent_error_reason: This is the reason the Continuous Export - configuration started failing. It can be 'AzureStorageNotFound' or - 'AzureStorageAccessDenied'. - :vartype permanent_error_reason: str - :ivar storage_name: The name of the destination storage account. - :vartype storage_name: str - :ivar container_name: The name of the destination storage container. - :vartype container_name: str - """ - - _validation = { - 'export_id': {'readonly': True}, - 'instrumentation_key': {'readonly': True}, - 'application_name': {'readonly': True}, - 'subscription_id': {'readonly': True}, - 'resource_group': {'readonly': True}, - 'destination_storage_subscription_id': {'readonly': True}, - 'destination_storage_location_id': {'readonly': True}, - 'destination_account_id': {'readonly': True}, - 'destination_type': {'readonly': True}, - 'is_user_enabled': {'readonly': True}, - 'last_user_update': {'readonly': True}, - 'export_status': {'readonly': True}, - 'last_success_time': {'readonly': True}, - 'last_gap_time': {'readonly': True}, - 'permanent_error_reason': {'readonly': True}, - 'storage_name': {'readonly': True}, - 'container_name': {'readonly': True}, - } - - _attribute_map = { - 'export_id': {'key': 'ExportId', 'type': 'str'}, - 'instrumentation_key': {'key': 'InstrumentationKey', 'type': 'str'}, - 'record_types': {'key': 'RecordTypes', 'type': 'str'}, - 'application_name': {'key': 'ApplicationName', 'type': 'str'}, - 'subscription_id': {'key': 'SubscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'ResourceGroup', 'type': 'str'}, - 'destination_storage_subscription_id': {'key': 'DestinationStorageSubscriptionId', 'type': 'str'}, - 'destination_storage_location_id': {'key': 'DestinationStorageLocationId', 'type': 'str'}, - 'destination_account_id': {'key': 'DestinationAccountId', 'type': 'str'}, - 'destination_type': {'key': 'DestinationType', 'type': 'str'}, - 'is_user_enabled': {'key': 'IsUserEnabled', 'type': 'str'}, - 'last_user_update': {'key': 'LastUserUpdate', 'type': 'str'}, - 'notification_queue_enabled': {'key': 'NotificationQueueEnabled', 'type': 'str'}, - 'export_status': {'key': 'ExportStatus', 'type': 'str'}, - 'last_success_time': {'key': 'LastSuccessTime', 'type': 'str'}, - 'last_gap_time': {'key': 'LastGapTime', 'type': 'str'}, - 'permanent_error_reason': {'key': 'PermanentErrorReason', 'type': 'str'}, - 'storage_name': {'key': 'StorageName', 'type': 'str'}, - 'container_name': {'key': 'ContainerName', 'type': 'str'}, - } - - def __init__(self, record_types=None, notification_queue_enabled=None): - super(ApplicationInsightsComponentExportConfiguration, self).__init__() - self.export_id = None - self.instrumentation_key = None - self.record_types = record_types - self.application_name = None - self.subscription_id = None - self.resource_group = None - self.destination_storage_subscription_id = None - self.destination_storage_location_id = None - self.destination_account_id = None - self.destination_type = None - self.is_user_enabled = None - self.last_user_update = None - self.notification_queue_enabled = notification_queue_enabled - self.export_status = None - self.last_success_time = None - self.last_gap_time = None - self.permanent_error_reason = None - self.storage_name = None - self.container_name = None diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_export_request.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_export_request.py deleted file mode 100644 index c35eb10ab56..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_export_request.py +++ /dev/null @@ -1,69 +0,0 @@ -# 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 - - -class ApplicationInsightsComponentExportRequest(Model): - """An Application Insights component Continuous Export configuration request - definition. - - :param record_types: The document types to be exported, as comma separated - values. Allowed values include 'Requests', 'Event', 'Exceptions', - 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', - 'PerformanceCounters', 'Availability', 'Messages'. - :type record_types: str - :param destination_type: The Continuous Export destination type. This has - to be 'Blob'. - :type destination_type: str - :param destination_address: The SAS URL for the destination storage - container. It must grant write permission. - :type destination_address: str - :param is_enabled: Set to 'true' to create a Continuous Export - configuration as enabled, otherwise set it to 'false'. - :type is_enabled: str - :param notification_queue_enabled: Deprecated - :type notification_queue_enabled: str - :param notification_queue_uri: Deprecated - :type notification_queue_uri: str - :param destination_storage_subscription_id: The subscription ID of the - destination storage container. - :type destination_storage_subscription_id: str - :param destination_storage_location_id: The location ID of the destination - storage container. - :type destination_storage_location_id: str - :param destination_account_id: The name of destination storage account. - :type destination_account_id: str - """ - - _attribute_map = { - 'record_types': {'key': 'RecordTypes', 'type': 'str'}, - 'destination_type': {'key': 'DestinationType', 'type': 'str'}, - 'destination_address': {'key': 'DestinationAddress', 'type': 'str'}, - 'is_enabled': {'key': 'IsEnabled', 'type': 'str'}, - 'notification_queue_enabled': {'key': 'NotificationQueueEnabled', 'type': 'str'}, - 'notification_queue_uri': {'key': 'NotificationQueueUri', 'type': 'str'}, - 'destination_storage_subscription_id': {'key': 'DestinationStorageSubscriptionId', 'type': 'str'}, - 'destination_storage_location_id': {'key': 'DestinationStorageLocationId', 'type': 'str'}, - 'destination_account_id': {'key': 'DestinationAccountId', 'type': 'str'}, - } - - def __init__(self, record_types=None, destination_type=None, destination_address=None, is_enabled=None, notification_queue_enabled=None, notification_queue_uri=None, destination_storage_subscription_id=None, destination_storage_location_id=None, destination_account_id=None): - super(ApplicationInsightsComponentExportRequest, self).__init__() - self.record_types = record_types - self.destination_type = destination_type - self.destination_address = destination_address - self.is_enabled = is_enabled - self.notification_queue_enabled = notification_queue_enabled - self.notification_queue_uri = notification_queue_uri - self.destination_storage_subscription_id = destination_storage_subscription_id - self.destination_storage_location_id = destination_storage_location_id - self.destination_account_id = destination_account_id diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_proactive_detection_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_proactive_detection_configuration.py deleted file mode 100644 index 14734b3c0f6..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_proactive_detection_configuration.py +++ /dev/null @@ -1,52 +0,0 @@ -# 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 - - -class ApplicationInsightsComponentProactiveDetectionConfiguration(Model): - """Properties that define a ProactiveDetection configuration. - - :param name: The rule name - :type name: str - :param enabled: A flag that indicates whether this rule is enabled by the - user - :type enabled: bool - :param send_emails_to_subscription_owners: A flag that indicated whether - notifications on this rule should be sent to subscription owners - :type send_emails_to_subscription_owners: bool - :param custom_emails: Custom email addresses for this rule notifications - :type custom_emails: list[str] - :param last_updated_time: The last time this rule was updated - :type last_updated_time: str - :param rule_definitions: Static definitions of the ProactiveDetection - configuration rule (same values for all components). - :type rule_definitions: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions - """ - - _attribute_map = { - 'name': {'key': 'Name', 'type': 'str'}, - 'enabled': {'key': 'Enabled', 'type': 'bool'}, - 'send_emails_to_subscription_owners': {'key': 'SendEmailsToSubscriptionOwners', 'type': 'bool'}, - 'custom_emails': {'key': 'CustomEmails', 'type': '[str]'}, - 'last_updated_time': {'key': 'LastUpdatedTime', 'type': 'str'}, - 'rule_definitions': {'key': 'RuleDefinitions', 'type': 'ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions'}, - } - - def __init__(self, name=None, enabled=None, send_emails_to_subscription_owners=None, custom_emails=None, last_updated_time=None, rule_definitions=None): - super(ApplicationInsightsComponentProactiveDetectionConfiguration, self).__init__() - self.name = name - self.enabled = enabled - self.send_emails_to_subscription_owners = send_emails_to_subscription_owners - self.custom_emails = custom_emails - self.last_updated_time = last_updated_time - self.rule_definitions = rule_definitions diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions.py deleted file mode 100644 index 8fafb0a49a2..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_proactive_detection_configuration_rule_definitions.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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 - - -class ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions(Model): - """Static definitions of the ProactiveDetection configuration rule (same - values for all components). - - :param name: The rule name - :type name: str - :param display_name: The rule name as it is displayed in UI - :type display_name: str - :param description: The rule description - :type description: str - :param help_url: URL which displays aditional info about the proactive - detection rule - :type help_url: str - :param is_hidden: A flag indicating whether the rule is hidden (from the - UI) - :type is_hidden: bool - :param is_enabled_by_default: A flag indicating whether the rule is - enabled by default - :type is_enabled_by_default: bool - :param is_in_preview: A flag indicating whether the rule is in preview - :type is_in_preview: bool - :param supports_email_notifications: A flag indicating whether email - notifications are supported for detections for this rule - :type supports_email_notifications: bool - """ - - _attribute_map = { - 'name': {'key': 'Name', 'type': 'str'}, - 'display_name': {'key': 'DisplayName', 'type': 'str'}, - 'description': {'key': 'Description', 'type': 'str'}, - 'help_url': {'key': 'HelpUrl', 'type': 'str'}, - 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, - 'is_enabled_by_default': {'key': 'IsEnabledByDefault', 'type': 'bool'}, - 'is_in_preview': {'key': 'IsInPreview', 'type': 'bool'}, - 'supports_email_notifications': {'key': 'SupportsEmailNotifications', 'type': 'bool'}, - } - - def __init__(self, name=None, display_name=None, description=None, help_url=None, is_hidden=None, is_enabled_by_default=None, is_in_preview=None, supports_email_notifications=None): - super(ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions, self).__init__() - self.name = name - self.display_name = display_name - self.description = description - self.help_url = help_url - self.is_hidden = is_hidden - self.is_enabled_by_default = is_enabled_by_default - self.is_in_preview = is_in_preview - self.supports_email_notifications = supports_email_notifications diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_quota_status.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_quota_status.py deleted file mode 100644 index 6b559a50061..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_quota_status.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 - - -class ApplicationInsightsComponentQuotaStatus(Model): - """An Application Insights component daily data volume cap status. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar app_id: The Application ID for the Application Insights component. - :vartype app_id: str - :ivar should_be_throttled: The daily data volume cap is met, and data - ingestion will be stopped. - :vartype should_be_throttled: bool - :ivar expiration_time: Date and time when the daily data volume cap will - be reset, and data ingestion will resume. - :vartype expiration_time: str - """ - - _validation = { - 'app_id': {'readonly': True}, - 'should_be_throttled': {'readonly': True}, - 'expiration_time': {'readonly': True}, - } - - _attribute_map = { - 'app_id': {'key': 'AppId', 'type': 'str'}, - 'should_be_throttled': {'key': 'ShouldBeThrottled', 'type': 'bool'}, - 'expiration_time': {'key': 'ExpirationTime', 'type': 'str'}, - } - - def __init__(self): - super(ApplicationInsightsComponentQuotaStatus, self).__init__() - self.app_id = None - self.should_be_throttled = None - self.expiration_time = None diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/error_response.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/error_response.py deleted file mode 100644 index ba4967dac93..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/error_response.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 ErrorResponse(Model): - """Error reponse indicates Insights service is not able to process the - incoming request. The reason is provided in the error message. - - :param code: Error code. - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__(self, code=None, message=None): - super(ErrorResponse, self).__init__() - self.code = code - self.message = message - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/operation.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/operation.py deleted file mode 100644 index ff52ee65e1f..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/operation.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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 - - -class Operation(Model): - """CDN REST API operation. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.applicationinsights.models.OperationDisplay - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__(self, name=None, display=None): - super(Operation, self).__init__() - self.name = name - self.display = display diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/operation_display.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/operation_display.py deleted file mode 100644 index 1bd751e13fa..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/operation_display.py +++ /dev/null @@ -1,37 +0,0 @@ -# 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 - - -class OperationDisplay(Model): - """The object that represents the operation. - - :param provider: Service provider: Microsoft.Cdn - :type provider: str - :param resource: Resource on which the operation is performed: Profile, - endpoint, etc. - :type resource: str - :param operation: Operation type: Read, write, 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=None, resource=None, operation=None): - super(OperationDisplay, self).__init__() - self.provider = provider - self.resource = resource - self.operation = operation diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/resource.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/resource.py deleted file mode 100644 index 1552cf70c86..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/resource.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 - - -class Resource(Model): - """An azure resource object. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Azure resource Id - :vartype id: str - :ivar name: Azure resource name - :vartype name: str - :ivar type: Azure resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': 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}'}, - } - - def __init__(self, location, tags=None): - super(Resource, self).__init__() - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/web_test.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/web_test.py deleted file mode 100644 index 103aa8c9c06..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/web_test.py +++ /dev/null @@ -1,117 +0,0 @@ -# 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 .resource import Resource - - -class WebTest(Resource): - """An Application Insights web test definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Azure resource Id - :vartype id: str - :ivar name: Azure resource name - :vartype name: str - :ivar type: Azure resource type - :vartype type: str - :param location: Resource location - :type location: str - :param tags: Resource tags - :type tags: dict[str, str] - :param kind: The kind of web test that this web test watches. Choices are - ping and multistep. Possible values include: 'ping', 'multistep'. Default - value: "ping" . - :type kind: str or ~azure.mgmt.applicationinsights.models.WebTestKind - :param synthetic_monitor_id: Unique ID of this WebTest. This is typically - the same value as the Name field. - :type synthetic_monitor_id: str - :param web_test_name: User defined name if this WebTest. - :type web_test_name: str - :param description: Purpose/user defined descriptive test for this - WebTest. - :type description: str - :param enabled: Is the test actively being monitored. - :type enabled: bool - :param frequency: Interval in seconds between test runs for this WebTest. - Default value is 300. Default value: 300 . - :type frequency: int - :param timeout: Seconds until this WebTest will timeout and fail. Default - value is 30. Default value: 30 . - :type timeout: int - :param web_test_kind: The kind of web test this is, valid choices are ping - and multistep. Possible values include: 'ping', 'multistep'. Default - value: "ping" . - :type web_test_kind: str or - ~azure.mgmt.applicationinsights.models.WebTestKind - :param retry_enabled: Allow for retries should this WebTest fail. - :type retry_enabled: bool - :param locations: A list of where to physically run the tests from to give - global coverage for accessibility of your application. - :type locations: - list[~azure.mgmt.applicationinsights.models.WebTestGeolocation] - :param configuration: An XML configuration specification for a WebTest. - :type configuration: - ~azure.mgmt.applicationinsights.models.WebTestPropertiesConfiguration - :ivar provisioning_state: Current state of this component, whether or not - is has been provisioned within the resource group it is defined. Users - cannot change this value but are able to read from it. Values will include - Succeeded, Deploying, Canceled, and Failed. - :vartype provisioning_state: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'synthetic_monitor_id': {'required': True}, - 'web_test_name': {'required': True}, - 'web_test_kind': {'required': True}, - 'locations': {'required': True}, - 'provisioning_state': {'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}'}, - 'kind': {'key': 'kind', 'type': 'WebTestKind'}, - 'synthetic_monitor_id': {'key': 'properties.SyntheticMonitorId', 'type': 'str'}, - 'web_test_name': {'key': 'properties.Name', 'type': 'str'}, - 'description': {'key': 'properties.Description', 'type': 'str'}, - 'enabled': {'key': 'properties.Enabled', 'type': 'bool'}, - 'frequency': {'key': 'properties.Frequency', 'type': 'int'}, - 'timeout': {'key': 'properties.Timeout', 'type': 'int'}, - 'web_test_kind': {'key': 'properties.Kind', 'type': 'WebTestKind'}, - 'retry_enabled': {'key': 'properties.RetryEnabled', 'type': 'bool'}, - 'locations': {'key': 'properties.Locations', 'type': '[WebTestGeolocation]'}, - 'configuration': {'key': 'properties.Configuration', 'type': 'WebTestPropertiesConfiguration'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__(self, location, synthetic_monitor_id, web_test_name, locations, tags=None, kind="ping", description=None, enabled=None, frequency=300, timeout=30, web_test_kind="ping", retry_enabled=None, configuration=None): - super(WebTest, self).__init__(location=location, tags=tags) - self.kind = kind - self.synthetic_monitor_id = synthetic_monitor_id - self.web_test_name = web_test_name - self.description = description - self.enabled = enabled - self.frequency = frequency - self.timeout = timeout - self.web_test_kind = web_test_kind - self.retry_enabled = retry_enabled - self.locations = locations - self.configuration = configuration - self.provisioning_state = None diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/web_test_geolocation.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/web_test_geolocation.py deleted file mode 100644 index 8c52d9c31b8..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/web_test_geolocation.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 - - -class WebTestGeolocation(Model): - """Geo-physical location to run a web test from. You must specify one or more - locations for the test to run from. - - :param location: Location ID for the webtest to run from. - :type location: str - """ - - _attribute_map = { - 'location': {'key': 'Id', 'type': 'str'}, - } - - def __init__(self, location=None): - super(WebTestGeolocation, self).__init__() - self.location = location diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/web_test_properties_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/web_test_properties_configuration.py deleted file mode 100644 index 6ddd1ec152c..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/web_test_properties_configuration.py +++ /dev/null @@ -1,29 +0,0 @@ -# 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 - - -class WebTestPropertiesConfiguration(Model): - """An XML configuration specification for a WebTest. - - :param web_test: The XML specification of a WebTest to run against an - application. - :type web_test: str - """ - - _attribute_map = { - 'web_test': {'key': 'WebTest', 'type': 'str'}, - } - - def __init__(self, web_test=None): - super(WebTestPropertiesConfiguration, self).__init__() - self.web_test = web_test diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/__init__.py deleted file mode 100644 index d8de45a083e..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .operations import Operations -from .components_operations import ComponentsOperations -from .web_tests_operations import WebTestsOperations -from .export_configurations_operations import ExportConfigurationsOperations -from .proactive_detection_configurations_operations import ProactiveDetectionConfigurationsOperations -from .component_current_billing_features_operations import ComponentCurrentBillingFeaturesOperations -from .component_quota_status_operations import ComponentQuotaStatusOperations -from .api_keys_operations import APIKeysOperations - -__all__ = [ - 'Operations', - 'ComponentsOperations', - 'WebTestsOperations', - 'ExportConfigurationsOperations', - 'ProactiveDetectionConfigurationsOperations', - 'ComponentCurrentBillingFeaturesOperations', - 'ComponentQuotaStatusOperations', - 'APIKeysOperations', -] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/__init__.py new file mode 100644 index 00000000000..298512941d9 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/__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 ApplicationInsightsManagementClientConfiguration +from ._application_insights_management_client import ApplicationInsightsManagementClient +__all__ = ['ApplicationInsightsManagementClient', 'ApplicationInsightsManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/_application_insights_management_client.py new file mode 100644 index 00000000000..59e90899d57 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/_application_insights_management_client.py @@ -0,0 +1,124 @@ +# 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 ApplicationInsightsManagementClientConfiguration +from .operations import Operations +from .operations import AnnotationsOperations +from .operations import APIKeysOperations +from .operations import ExportConfigurationsOperations +from .operations import ComponentCurrentBillingFeaturesOperations +from .operations import ComponentQuotaStatusOperations +from .operations import ComponentFeatureCapabilitiesOperations +from .operations import ComponentAvailableFeaturesOperations +from .operations import ProactiveDetectionConfigurationsOperations +from .operations import ComponentsOperations +from .operations import WorkItemConfigurationsOperations +from .operations import FavoritesOperations +from .operations import WebTestLocationsOperations +from .operations import WebTestsOperations +from .operations import AnalyticsItemsOperations +from .operations import WorkbooksOperations +from . import models + + +class ApplicationInsightsManagementClient(SDKClient): + """Composite Swagger for Application Insights Management Client + + :ivar config: Configuration for client. + :vartype config: ApplicationInsightsManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.applicationinsights.v2015_05_01.operations.Operations + :ivar annotations: Annotations operations + :vartype annotations: azure.mgmt.applicationinsights.v2015_05_01.operations.AnnotationsOperations + :ivar api_keys: APIKeys operations + :vartype api_keys: azure.mgmt.applicationinsights.v2015_05_01.operations.APIKeysOperations + :ivar export_configurations: ExportConfigurations operations + :vartype export_configurations: azure.mgmt.applicationinsights.v2015_05_01.operations.ExportConfigurationsOperations + :ivar component_current_billing_features: ComponentCurrentBillingFeatures operations + :vartype component_current_billing_features: azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentCurrentBillingFeaturesOperations + :ivar component_quota_status: ComponentQuotaStatus operations + :vartype component_quota_status: azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentQuotaStatusOperations + :ivar component_feature_capabilities: ComponentFeatureCapabilities operations + :vartype component_feature_capabilities: azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentFeatureCapabilitiesOperations + :ivar component_available_features: ComponentAvailableFeatures operations + :vartype component_available_features: azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentAvailableFeaturesOperations + :ivar proactive_detection_configurations: ProactiveDetectionConfigurations operations + :vartype proactive_detection_configurations: azure.mgmt.applicationinsights.v2015_05_01.operations.ProactiveDetectionConfigurationsOperations + :ivar components: Components operations + :vartype components: azure.mgmt.applicationinsights.v2015_05_01.operations.ComponentsOperations + :ivar work_item_configurations: WorkItemConfigurations operations + :vartype work_item_configurations: azure.mgmt.applicationinsights.v2015_05_01.operations.WorkItemConfigurationsOperations + :ivar favorites: Favorites operations + :vartype favorites: azure.mgmt.applicationinsights.v2015_05_01.operations.FavoritesOperations + :ivar web_test_locations: WebTestLocations operations + :vartype web_test_locations: azure.mgmt.applicationinsights.v2015_05_01.operations.WebTestLocationsOperations + :ivar web_tests: WebTests operations + :vartype web_tests: azure.mgmt.applicationinsights.v2015_05_01.operations.WebTestsOperations + :ivar analytics_items: AnalyticsItems operations + :vartype analytics_items: azure.mgmt.applicationinsights.v2015_05_01.operations.AnalyticsItemsOperations + :ivar workbooks: Workbooks operations + :vartype workbooks: azure.mgmt.applicationinsights.v2015_05_01.operations.WorkbooksOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ApplicationInsightsManagementClientConfiguration(credentials, subscription_id, base_url) + super(ApplicationInsightsManagementClient, 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-05-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.annotations = AnnotationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.api_keys = APIKeysOperations( + self._client, self.config, self._serialize, self._deserialize) + self.export_configurations = ExportConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.component_current_billing_features = ComponentCurrentBillingFeaturesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.component_quota_status = ComponentQuotaStatusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.component_feature_capabilities = ComponentFeatureCapabilitiesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.component_available_features = ComponentAvailableFeaturesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.proactive_detection_configurations = ProactiveDetectionConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.components = ComponentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.work_item_configurations = WorkItemConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.favorites = FavoritesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.web_test_locations = WebTestLocationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.web_tests = WebTestsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.analytics_items = AnalyticsItemsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.workbooks = WorkbooksOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/_configuration.py new file mode 100644 index 00000000000..6c855295a4b --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/_configuration.py @@ -0,0 +1,48 @@ +# 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 ApplicationInsightsManagementClientConfiguration(AzureConfiguration): + """Configuration for ApplicationInsightsManagementClient + 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: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(ApplicationInsightsManagementClientConfiguration, 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-applicationinsights/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/__init__.py new file mode 100644 index 00000000000..44a11647cfb --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/__init__.py @@ -0,0 +1,191 @@ +# 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 Annotation + from ._models_py3 import AnnotationError, AnnotationErrorException + from ._models_py3 import APIKeyRequest + from ._models_py3 import ApplicationInsightsComponent + from ._models_py3 import ApplicationInsightsComponentAnalyticsItem + from ._models_py3 import ApplicationInsightsComponentAnalyticsItemProperties + from ._models_py3 import ApplicationInsightsComponentAPIKey + from ._models_py3 import ApplicationInsightsComponentAvailableFeatures + from ._models_py3 import ApplicationInsightsComponentBillingFeatures + from ._models_py3 import ApplicationInsightsComponentDataVolumeCap + from ._models_py3 import ApplicationInsightsComponentExportConfiguration + from ._models_py3 import ApplicationInsightsComponentExportRequest + from ._models_py3 import ApplicationInsightsComponentFavorite + from ._models_py3 import ApplicationInsightsComponentFeature + from ._models_py3 import ApplicationInsightsComponentFeatureCapabilities + from ._models_py3 import ApplicationInsightsComponentFeatureCapability + from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfiguration + from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions + from ._models_py3 import ApplicationInsightsComponentQuotaStatus + from ._models_py3 import ApplicationInsightsComponentWebTestLocation + from ._models_py3 import ComponentPurgeBody + from ._models_py3 import ComponentPurgeBodyFilters + from ._models_py3 import ComponentPurgeResponse + from ._models_py3 import ComponentPurgeStatusResponse + from ._models_py3 import ComponentsResource + from ._models_py3 import ErrorFieldContract + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import InnerError + from ._models_py3 import LinkProperties + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import PrivateLinkScopedResource + from ._models_py3 import TagsResource + from ._models_py3 import WebTest + from ._models_py3 import WebTestGeolocation + from ._models_py3 import WebTestPropertiesConfiguration + from ._models_py3 import WebtestsResource + from ._models_py3 import Workbook + from ._models_py3 import WorkbookError, WorkbookErrorException + from ._models_py3 import WorkbookResource + from ._models_py3 import WorkItemConfiguration + from ._models_py3 import WorkItemConfigurationError, WorkItemConfigurationErrorException + from ._models_py3 import WorkItemCreateConfiguration +except (SyntaxError, ImportError): + from ._models import Annotation + from ._models import AnnotationError, AnnotationErrorException + from ._models import APIKeyRequest + from ._models import ApplicationInsightsComponent + from ._models import ApplicationInsightsComponentAnalyticsItem + from ._models import ApplicationInsightsComponentAnalyticsItemProperties + from ._models import ApplicationInsightsComponentAPIKey + from ._models import ApplicationInsightsComponentAvailableFeatures + from ._models import ApplicationInsightsComponentBillingFeatures + from ._models import ApplicationInsightsComponentDataVolumeCap + from ._models import ApplicationInsightsComponentExportConfiguration + from ._models import ApplicationInsightsComponentExportRequest + from ._models import ApplicationInsightsComponentFavorite + from ._models import ApplicationInsightsComponentFeature + from ._models import ApplicationInsightsComponentFeatureCapabilities + from ._models import ApplicationInsightsComponentFeatureCapability + from ._models import ApplicationInsightsComponentProactiveDetectionConfiguration + from ._models import ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions + from ._models import ApplicationInsightsComponentQuotaStatus + from ._models import ApplicationInsightsComponentWebTestLocation + from ._models import ComponentPurgeBody + from ._models import ComponentPurgeBodyFilters + from ._models import ComponentPurgeResponse + from ._models import ComponentPurgeStatusResponse + from ._models import ComponentsResource + from ._models import ErrorFieldContract + from ._models import ErrorResponse, ErrorResponseException + from ._models import InnerError + from ._models import LinkProperties + from ._models import Operation + from ._models import OperationDisplay + from ._models import PrivateLinkScopedResource + from ._models import TagsResource + from ._models import WebTest + from ._models import WebTestGeolocation + from ._models import WebTestPropertiesConfiguration + from ._models import WebtestsResource + from ._models import Workbook + from ._models import WorkbookError, WorkbookErrorException + from ._models import WorkbookResource + from ._models import WorkItemConfiguration + from ._models import WorkItemConfigurationError, WorkItemConfigurationErrorException + from ._models import WorkItemCreateConfiguration +from ._paged_models import AnnotationPaged +from ._paged_models import ApplicationInsightsComponentAPIKeyPaged +from ._paged_models import ApplicationInsightsComponentPaged +from ._paged_models import ApplicationInsightsComponentWebTestLocationPaged +from ._paged_models import OperationPaged +from ._paged_models import WebTestPaged +from ._paged_models import WorkbookPaged +from ._paged_models import WorkItemConfigurationPaged +from ._application_insights_management_client_enums import ( + ApplicationType, + FlowType, + RequestSource, + PurgeState, + PublicNetworkAccessType, + FavoriteType, + WebTestKind, + ItemScope, + ItemType, + SharedTypeKind, + FavoriteSourceType, + ItemScopePath, + ItemTypeParameter, + CategoryType, +) + +__all__ = [ + 'Annotation', + 'AnnotationError', 'AnnotationErrorException', + 'APIKeyRequest', + 'ApplicationInsightsComponent', + 'ApplicationInsightsComponentAnalyticsItem', + 'ApplicationInsightsComponentAnalyticsItemProperties', + 'ApplicationInsightsComponentAPIKey', + 'ApplicationInsightsComponentAvailableFeatures', + 'ApplicationInsightsComponentBillingFeatures', + 'ApplicationInsightsComponentDataVolumeCap', + 'ApplicationInsightsComponentExportConfiguration', + 'ApplicationInsightsComponentExportRequest', + 'ApplicationInsightsComponentFavorite', + 'ApplicationInsightsComponentFeature', + 'ApplicationInsightsComponentFeatureCapabilities', + 'ApplicationInsightsComponentFeatureCapability', + 'ApplicationInsightsComponentProactiveDetectionConfiguration', + 'ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions', + 'ApplicationInsightsComponentQuotaStatus', + 'ApplicationInsightsComponentWebTestLocation', + 'ComponentPurgeBody', + 'ComponentPurgeBodyFilters', + 'ComponentPurgeResponse', + 'ComponentPurgeStatusResponse', + 'ComponentsResource', + 'ErrorFieldContract', + 'ErrorResponse', 'ErrorResponseException', + 'InnerError', + 'LinkProperties', + 'Operation', + 'OperationDisplay', + 'PrivateLinkScopedResource', + 'TagsResource', + 'WebTest', + 'WebTestGeolocation', + 'WebTestPropertiesConfiguration', + 'WebtestsResource', + 'Workbook', + 'WorkbookError', 'WorkbookErrorException', + 'WorkbookResource', + 'WorkItemConfiguration', + 'WorkItemConfigurationError', 'WorkItemConfigurationErrorException', + 'WorkItemCreateConfiguration', + 'OperationPaged', + 'AnnotationPaged', + 'ApplicationInsightsComponentAPIKeyPaged', + 'ApplicationInsightsComponentPaged', + 'WorkItemConfigurationPaged', + 'ApplicationInsightsComponentWebTestLocationPaged', + 'WebTestPaged', + 'WorkbookPaged', + 'ApplicationType', + 'FlowType', + 'RequestSource', + 'PurgeState', + 'PublicNetworkAccessType', + 'FavoriteType', + 'WebTestKind', + 'ItemScope', + 'ItemType', + 'SharedTypeKind', + 'FavoriteSourceType', + 'ItemScopePath', + 'ItemTypeParameter', + 'CategoryType', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_application_insights_management_client_enums.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_application_insights_management_client_enums.py new file mode 100644 index 00000000000..64bf85e818c --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_application_insights_management_client_enums.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ApplicationType(str, Enum): + + web = "web" + other = "other" + + +class FlowType(str, Enum): + + bluefield = "Bluefield" + + +class RequestSource(str, Enum): + + rest = "rest" + + +class PurgeState(str, Enum): + + pending = "pending" + completed = "completed" + + +class PublicNetworkAccessType(str, Enum): + + enabled = "Enabled" #: Enables connectivity to Application Insights through public DNS. + disabled = "Disabled" #: Disables public connectivity to Application Insights through public DNS. + + +class FavoriteType(str, Enum): + + shared = "shared" + user = "user" + + +class WebTestKind(str, Enum): + + ping = "ping" + multistep = "multistep" + + +class ItemScope(str, Enum): + + shared = "shared" + user = "user" + + +class ItemType(str, Enum): + + query = "query" + function = "function" + folder = "folder" + recent = "recent" + + +class SharedTypeKind(str, Enum): + + user = "user" + shared = "shared" + + +class FavoriteSourceType(str, Enum): + + retention = "retention" + notebook = "notebook" + sessions = "sessions" + events = "events" + userflows = "userflows" + funnel = "funnel" + impact = "impact" + segmentation = "segmentation" + + +class ItemScopePath(str, Enum): + + analytics_items = "analyticsItems" + myanalytics_items = "myanalyticsItems" + + +class ItemTypeParameter(str, Enum): + + none = "none" + query = "query" + function = "function" + folder = "folder" + recent = "recent" + + +class CategoryType(str, Enum): + + workbook = "workbook" + tsg = "TSG" + performance = "performance" + retention = "retention" diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_models.py new file mode 100644 index 00000000000..472d68d4503 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_models.py @@ -0,0 +1,1933 @@ +# 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 Annotation(Model): + """Annotation associated with an application insights resource. + + :param annotation_name: Name of annotation + :type annotation_name: str + :param category: Category of annotation, free form + :type category: str + :param event_time: Time when event occurred + :type event_time: datetime + :param id: Unique Id for annotation + :type id: str + :param properties: Serialized JSON object for detailed properties + :type properties: str + :param related_annotation: Related parent annotation if any. Default + value: "null" . + :type related_annotation: str + """ + + _attribute_map = { + 'annotation_name': {'key': 'AnnotationName', 'type': 'str'}, + 'category': {'key': 'Category', 'type': 'str'}, + 'event_time': {'key': 'EventTime', 'type': 'iso-8601'}, + 'id': {'key': 'Id', 'type': 'str'}, + 'properties': {'key': 'Properties', 'type': 'str'}, + 'related_annotation': {'key': 'RelatedAnnotation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Annotation, self).__init__(**kwargs) + self.annotation_name = kwargs.get('annotation_name', None) + self.category = kwargs.get('category', None) + self.event_time = kwargs.get('event_time', None) + self.id = kwargs.get('id', None) + self.properties = kwargs.get('properties', None) + self.related_annotation = kwargs.get('related_annotation', "null") + + +class AnnotationError(Model): + """Error associated with trying to create annotation with Id that already + exist. + + :param code: Error detail code and explanation + :type code: str + :param message: Error message + :type message: str + :param innererror: + :type innererror: + ~azure.mgmt.applicationinsights.v2015_05_01.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + } + + def __init__(self, **kwargs): + super(AnnotationError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.innererror = kwargs.get('innererror', None) + + +class AnnotationErrorException(HttpOperationError): + """Server responsed with exception of type: 'AnnotationError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(AnnotationErrorException, self).__init__(deserialize, response, 'AnnotationError', *args) + + +class APIKeyRequest(Model): + """An Application Insights component API Key creation request definition. + + :param name: The name of the API Key. + :type name: str + :param linked_read_properties: The read access rights of this API Key. + :type linked_read_properties: list[str] + :param linked_write_properties: The write access rights of this API Key. + :type linked_write_properties: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'linked_read_properties': {'key': 'linkedReadProperties', 'type': '[str]'}, + 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(APIKeyRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.linked_read_properties = kwargs.get('linked_read_properties', None) + self.linked_write_properties = kwargs.get('linked_write_properties', None) + + +class ComponentsResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, **kwargs): + super(ComponentsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class ApplicationInsightsComponent(ComponentsResource): + """An Application Insights component definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. The kind of application that this component refers + to, used to customize UI. This value is a freeform string, values should + typically be one of the following: web, ios, other, store, java, phone. + :type kind: str + :ivar application_id: The unique ID of your application. This field + mirrors the 'Name' field and cannot be changed. + :vartype application_id: str + :ivar app_id: Application Insights Unique ID for your Application. + :vartype app_id: str + :param application_type: Required. Type of application being monitored. + Possible values include: 'web', 'other'. Default value: "web" . + :type application_type: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationType + :param flow_type: Used by the Application Insights system to determine + what kind of flow this component was created by. This is to be set to + 'Bluefield' when creating/updating a component via the REST API. Possible + values include: 'Bluefield'. Default value: "Bluefield" . + :type flow_type: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.FlowType + :param request_source: Describes what tool created this Application + Insights component. Customers using this API should set this to the + default 'rest'. Possible values include: 'rest'. Default value: "rest" . + :type request_source: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.RequestSource + :ivar instrumentation_key: Application Insights Instrumentation key. A + read-only value that applications can use to identify the destination for + all telemetry sent to Azure Application Insights. This value will be + supplied upon construction of each new Application Insights component. + :vartype instrumentation_key: str + :ivar creation_date: Creation Date for the Application Insights component, + in ISO 8601 format. + :vartype creation_date: datetime + :ivar tenant_id: Azure Tenant Id. + :vartype tenant_id: str + :param hockey_app_id: The unique application ID created when a new + application is added to HockeyApp, used for communications with HockeyApp. + :type hockey_app_id: str + :ivar hockey_app_token: Token used to authenticate communications with + between Application Insights and HockeyApp. + :vartype hockey_app_token: str + :ivar provisioning_state: Current state of this component: whether or not + is has been provisioned within the resource group it is defined. Users + cannot change this value but are able to read from it. Values will include + Succeeded, Deploying, Canceled, and Failed. + :vartype provisioning_state: str + :param sampling_percentage: Percentage of the data produced by the + application being monitored that is being sampled for Application Insights + telemetry. + :type sampling_percentage: float + :ivar connection_string: Application Insights component connection string. + :vartype connection_string: str + :param retention_in_days: Retention period in days. Default value: 90 . + :type retention_in_days: int + :param disable_ip_masking: Disable IP masking. + :type disable_ip_masking: bool + :param immediate_purge_data_on30_days: Purge data immediately after 30 + days. + :type immediate_purge_data_on30_days: bool + :ivar private_link_scoped_resources: List of linked private link scope + resources. + :vartype private_link_scoped_resources: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.PrivateLinkScopedResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'application_id': {'readonly': True}, + 'app_id': {'readonly': True}, + 'application_type': {'required': True}, + 'instrumentation_key': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'hockey_app_token': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'connection_string': {'readonly': True}, + 'private_link_scoped_resources': {'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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'application_id': {'key': 'properties.ApplicationId', 'type': 'str'}, + 'app_id': {'key': 'properties.AppId', 'type': 'str'}, + 'application_type': {'key': 'properties.Application_Type', 'type': 'str'}, + 'flow_type': {'key': 'properties.Flow_Type', 'type': 'str'}, + 'request_source': {'key': 'properties.Request_Source', 'type': 'str'}, + 'instrumentation_key': {'key': 'properties.InstrumentationKey', 'type': 'str'}, + 'creation_date': {'key': 'properties.CreationDate', 'type': 'iso-8601'}, + 'tenant_id': {'key': 'properties.TenantId', 'type': 'str'}, + 'hockey_app_id': {'key': 'properties.HockeyAppId', 'type': 'str'}, + 'hockey_app_token': {'key': 'properties.HockeyAppToken', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sampling_percentage': {'key': 'properties.SamplingPercentage', 'type': 'float'}, + 'connection_string': {'key': 'properties.ConnectionString', 'type': 'str'}, + 'retention_in_days': {'key': 'properties.RetentionInDays', 'type': 'int'}, + 'disable_ip_masking': {'key': 'properties.DisableIpMasking', 'type': 'bool'}, + 'immediate_purge_data_on30_days': {'key': 'properties.ImmediatePurgeDataOn30Days', 'type': 'bool'}, + 'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponent, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.application_id = None + self.app_id = None + self.application_type = kwargs.get('application_type', "web") + self.flow_type = kwargs.get('flow_type', "Bluefield") + self.request_source = kwargs.get('request_source', "rest") + self.instrumentation_key = None + self.creation_date = None + self.tenant_id = None + self.hockey_app_id = kwargs.get('hockey_app_id', None) + self.hockey_app_token = None + self.provisioning_state = None + self.sampling_percentage = kwargs.get('sampling_percentage', None) + self.connection_string = None + self.retention_in_days = kwargs.get('retention_in_days', 90) + self.disable_ip_masking = kwargs.get('disable_ip_masking', None) + self.immediate_purge_data_on30_days = kwargs.get('immediate_purge_data_on30_days', None) + self.private_link_scoped_resources = None + + +class ApplicationInsightsComponentAnalyticsItem(Model): + """Properties that define an Analytics item that is associated to an + Application Insights component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Internally assigned unique id of the item definition. + :type id: str + :param name: The user-defined name of the item. + :type name: str + :param content: The content of this item + :type content: str + :ivar version: This instance's version of the data model. This can change + as new features are added. + :vartype version: str + :param scope: Enum indicating if this item definition is owned by a + specific user or is shared between all users with access to the + Application Insights component. Possible values include: 'shared', 'user' + :type scope: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemScope + :param type: Enum indicating the type of the Analytics item. Possible + values include: 'query', 'function', 'folder', 'recent' + :type type: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemType + :ivar time_created: Date and time in UTC when this item was created. + :vartype time_created: str + :ivar time_modified: Date and time in UTC of the last modification that + was made to this item. + :vartype time_modified: str + :param properties: + :type properties: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAnalyticsItemProperties + """ + + _validation = { + 'version': {'readonly': True}, + 'time_created': {'readonly': True}, + 'time_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'Id', 'type': 'str'}, + 'name': {'key': 'Name', 'type': 'str'}, + 'content': {'key': 'Content', 'type': 'str'}, + 'version': {'key': 'Version', 'type': 'str'}, + 'scope': {'key': 'Scope', 'type': 'str'}, + 'type': {'key': 'Type', 'type': 'str'}, + 'time_created': {'key': 'TimeCreated', 'type': 'str'}, + 'time_modified': {'key': 'TimeModified', 'type': 'str'}, + 'properties': {'key': 'Properties', 'type': 'ApplicationInsightsComponentAnalyticsItemProperties'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentAnalyticsItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.content = kwargs.get('content', None) + self.version = None + self.scope = kwargs.get('scope', None) + self.type = kwargs.get('type', None) + self.time_created = None + self.time_modified = None + self.properties = kwargs.get('properties', None) + + +class ApplicationInsightsComponentAnalyticsItemProperties(Model): + """A set of properties that can be defined in the context of a specific item + type. Each type may have its own properties. + + :param function_alias: A function alias, used when the type of the item is + Function + :type function_alias: str + """ + + _attribute_map = { + 'function_alias': {'key': 'functionAlias', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentAnalyticsItemProperties, self).__init__(**kwargs) + self.function_alias = kwargs.get('function_alias', None) + + +class ApplicationInsightsComponentAPIKey(Model): + """Properties that define an API key of an Application Insights Component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique ID of the API key inside an Application Insights + component. It is auto generated when the API key is created. + :vartype id: str + :ivar api_key: The API key value. It will be only return once when the API + Key was created. + :vartype api_key: str + :param created_date: The create date of this API key. + :type created_date: str + :param name: The name of the API key. + :type name: str + :param linked_read_properties: The read access rights of this API Key. + :type linked_read_properties: list[str] + :param linked_write_properties: The write access rights of this API Key. + :type linked_write_properties: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'api_key': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'api_key': {'key': 'apiKey', 'type': 'str'}, + 'created_date': {'key': 'createdDate', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'linked_read_properties': {'key': 'linkedReadProperties', 'type': '[str]'}, + 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentAPIKey, self).__init__(**kwargs) + self.id = None + self.api_key = None + self.created_date = kwargs.get('created_date', None) + self.name = kwargs.get('name', None) + self.linked_read_properties = kwargs.get('linked_read_properties', None) + self.linked_write_properties = kwargs.get('linked_write_properties', None) + + +class ApplicationInsightsComponentAvailableFeatures(Model): + """An Application Insights component available features. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar result: A list of Application Insights component feature. + :vartype result: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFeature] + """ + + _validation = { + 'result': {'readonly': True}, + } + + _attribute_map = { + 'result': {'key': 'Result', 'type': '[ApplicationInsightsComponentFeature]'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentAvailableFeatures, self).__init__(**kwargs) + self.result = None + + +class ApplicationInsightsComponentBillingFeatures(Model): + """An Application Insights component billing features. + + :param data_volume_cap: An Application Insights component daily data + volume cap + :type data_volume_cap: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentDataVolumeCap + :param current_billing_features: Current enabled pricing plan. When the + component is in the Enterprise plan, this will list both 'Basic' and + 'Application Insights Enterprise'. + :type current_billing_features: list[str] + """ + + _attribute_map = { + 'data_volume_cap': {'key': 'DataVolumeCap', 'type': 'ApplicationInsightsComponentDataVolumeCap'}, + 'current_billing_features': {'key': 'CurrentBillingFeatures', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentBillingFeatures, self).__init__(**kwargs) + self.data_volume_cap = kwargs.get('data_volume_cap', None) + self.current_billing_features = kwargs.get('current_billing_features', None) + + +class ApplicationInsightsComponentDataVolumeCap(Model): + """An Application Insights component daily data volume cap. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param cap: Daily data volume cap in GB. + :type cap: float + :ivar reset_time: Daily data volume cap UTC reset hour. + :vartype reset_time: int + :param warning_threshold: Reserved, not used for now. + :type warning_threshold: int + :param stop_send_notification_when_hit_threshold: Reserved, not used for + now. + :type stop_send_notification_when_hit_threshold: bool + :param stop_send_notification_when_hit_cap: Do not send a notification + email when the daily data volume cap is met. + :type stop_send_notification_when_hit_cap: bool + :ivar max_history_cap: Maximum daily data volume cap that the user can set + for this component. + :vartype max_history_cap: float + """ + + _validation = { + 'reset_time': {'readonly': True}, + 'max_history_cap': {'readonly': True}, + } + + _attribute_map = { + 'cap': {'key': 'Cap', 'type': 'float'}, + 'reset_time': {'key': 'ResetTime', 'type': 'int'}, + 'warning_threshold': {'key': 'WarningThreshold', 'type': 'int'}, + 'stop_send_notification_when_hit_threshold': {'key': 'StopSendNotificationWhenHitThreshold', 'type': 'bool'}, + 'stop_send_notification_when_hit_cap': {'key': 'StopSendNotificationWhenHitCap', 'type': 'bool'}, + 'max_history_cap': {'key': 'MaxHistoryCap', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentDataVolumeCap, self).__init__(**kwargs) + self.cap = kwargs.get('cap', None) + self.reset_time = None + self.warning_threshold = kwargs.get('warning_threshold', None) + self.stop_send_notification_when_hit_threshold = kwargs.get('stop_send_notification_when_hit_threshold', None) + self.stop_send_notification_when_hit_cap = kwargs.get('stop_send_notification_when_hit_cap', None) + self.max_history_cap = None + + +class ApplicationInsightsComponentExportConfiguration(Model): + """Properties that define a Continuous Export configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar export_id: The unique ID of the export configuration inside an + Application Insights component. It is auto generated when the Continuous + Export configuration is created. + :vartype export_id: str + :ivar instrumentation_key: The instrumentation key of the Application + Insights component. + :vartype instrumentation_key: str + :param record_types: This comma separated list of document types that will + be exported. The possible values include 'Requests', 'Event', + 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', + 'PerformanceCounters', 'Availability', 'Messages'. + :type record_types: str + :ivar application_name: The name of the Application Insights component. + :vartype application_name: str + :ivar subscription_id: The subscription of the Application Insights + component. + :vartype subscription_id: str + :ivar resource_group: The resource group of the Application Insights + component. + :vartype resource_group: str + :ivar destination_storage_subscription_id: The destination storage account + subscription ID. + :vartype destination_storage_subscription_id: str + :ivar destination_storage_location_id: The destination account location + ID. + :vartype destination_storage_location_id: str + :ivar destination_account_id: The name of destination account. + :vartype destination_account_id: str + :ivar destination_type: The destination type. + :vartype destination_type: str + :ivar is_user_enabled: This will be 'true' if the Continuous Export + configuration is enabled, otherwise it will be 'false'. + :vartype is_user_enabled: str + :ivar last_user_update: Last time the Continuous Export configuration was + updated. + :vartype last_user_update: str + :param notification_queue_enabled: Deprecated + :type notification_queue_enabled: str + :ivar export_status: This indicates current Continuous Export + configuration status. The possible values are 'Preparing', 'Success', + 'Failure'. + :vartype export_status: str + :ivar last_success_time: The last time data was successfully delivered to + the destination storage container for this Continuous Export + configuration. + :vartype last_success_time: str + :ivar last_gap_time: The last time the Continuous Export configuration + started failing. + :vartype last_gap_time: str + :ivar permanent_error_reason: This is the reason the Continuous Export + configuration started failing. It can be 'AzureStorageNotFound' or + 'AzureStorageAccessDenied'. + :vartype permanent_error_reason: str + :ivar storage_name: The name of the destination storage account. + :vartype storage_name: str + :ivar container_name: The name of the destination storage container. + :vartype container_name: str + """ + + _validation = { + 'export_id': {'readonly': True}, + 'instrumentation_key': {'readonly': True}, + 'application_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'destination_storage_subscription_id': {'readonly': True}, + 'destination_storage_location_id': {'readonly': True}, + 'destination_account_id': {'readonly': True}, + 'destination_type': {'readonly': True}, + 'is_user_enabled': {'readonly': True}, + 'last_user_update': {'readonly': True}, + 'export_status': {'readonly': True}, + 'last_success_time': {'readonly': True}, + 'last_gap_time': {'readonly': True}, + 'permanent_error_reason': {'readonly': True}, + 'storage_name': {'readonly': True}, + 'container_name': {'readonly': True}, + } + + _attribute_map = { + 'export_id': {'key': 'ExportId', 'type': 'str'}, + 'instrumentation_key': {'key': 'InstrumentationKey', 'type': 'str'}, + 'record_types': {'key': 'RecordTypes', 'type': 'str'}, + 'application_name': {'key': 'ApplicationName', 'type': 'str'}, + 'subscription_id': {'key': 'SubscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'ResourceGroup', 'type': 'str'}, + 'destination_storage_subscription_id': {'key': 'DestinationStorageSubscriptionId', 'type': 'str'}, + 'destination_storage_location_id': {'key': 'DestinationStorageLocationId', 'type': 'str'}, + 'destination_account_id': {'key': 'DestinationAccountId', 'type': 'str'}, + 'destination_type': {'key': 'DestinationType', 'type': 'str'}, + 'is_user_enabled': {'key': 'IsUserEnabled', 'type': 'str'}, + 'last_user_update': {'key': 'LastUserUpdate', 'type': 'str'}, + 'notification_queue_enabled': {'key': 'NotificationQueueEnabled', 'type': 'str'}, + 'export_status': {'key': 'ExportStatus', 'type': 'str'}, + 'last_success_time': {'key': 'LastSuccessTime', 'type': 'str'}, + 'last_gap_time': {'key': 'LastGapTime', 'type': 'str'}, + 'permanent_error_reason': {'key': 'PermanentErrorReason', 'type': 'str'}, + 'storage_name': {'key': 'StorageName', 'type': 'str'}, + 'container_name': {'key': 'ContainerName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentExportConfiguration, self).__init__(**kwargs) + self.export_id = None + self.instrumentation_key = None + self.record_types = kwargs.get('record_types', None) + self.application_name = None + self.subscription_id = None + self.resource_group = None + self.destination_storage_subscription_id = None + self.destination_storage_location_id = None + self.destination_account_id = None + self.destination_type = None + self.is_user_enabled = None + self.last_user_update = None + self.notification_queue_enabled = kwargs.get('notification_queue_enabled', None) + self.export_status = None + self.last_success_time = None + self.last_gap_time = None + self.permanent_error_reason = None + self.storage_name = None + self.container_name = None + + +class ApplicationInsightsComponentExportRequest(Model): + """An Application Insights component Continuous Export configuration request + definition. + + :param record_types: The document types to be exported, as comma separated + values. Allowed values include 'Requests', 'Event', 'Exceptions', + 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', + 'PerformanceCounters', 'Availability', 'Messages'. + :type record_types: str + :param destination_type: The Continuous Export destination type. This has + to be 'Blob'. + :type destination_type: str + :param destination_address: The SAS URL for the destination storage + container. It must grant write permission. + :type destination_address: str + :param is_enabled: Set to 'true' to create a Continuous Export + configuration as enabled, otherwise set it to 'false'. + :type is_enabled: str + :param notification_queue_enabled: Deprecated + :type notification_queue_enabled: str + :param notification_queue_uri: Deprecated + :type notification_queue_uri: str + :param destination_storage_subscription_id: The subscription ID of the + destination storage container. + :type destination_storage_subscription_id: str + :param destination_storage_location_id: The location ID of the destination + storage container. + :type destination_storage_location_id: str + :param destination_account_id: The name of destination storage account. + :type destination_account_id: str + """ + + _attribute_map = { + 'record_types': {'key': 'RecordTypes', 'type': 'str'}, + 'destination_type': {'key': 'DestinationType', 'type': 'str'}, + 'destination_address': {'key': 'DestinationAddress', 'type': 'str'}, + 'is_enabled': {'key': 'IsEnabled', 'type': 'str'}, + 'notification_queue_enabled': {'key': 'NotificationQueueEnabled', 'type': 'str'}, + 'notification_queue_uri': {'key': 'NotificationQueueUri', 'type': 'str'}, + 'destination_storage_subscription_id': {'key': 'DestinationStorageSubscriptionId', 'type': 'str'}, + 'destination_storage_location_id': {'key': 'DestinationStorageLocationId', 'type': 'str'}, + 'destination_account_id': {'key': 'DestinationAccountId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentExportRequest, self).__init__(**kwargs) + self.record_types = kwargs.get('record_types', None) + self.destination_type = kwargs.get('destination_type', None) + self.destination_address = kwargs.get('destination_address', None) + self.is_enabled = kwargs.get('is_enabled', None) + self.notification_queue_enabled = kwargs.get('notification_queue_enabled', None) + self.notification_queue_uri = kwargs.get('notification_queue_uri', None) + self.destination_storage_subscription_id = kwargs.get('destination_storage_subscription_id', None) + self.destination_storage_location_id = kwargs.get('destination_storage_location_id', None) + self.destination_account_id = kwargs.get('destination_account_id', None) + + +class ApplicationInsightsComponentFavorite(Model): + """Properties that define a favorite that is associated to an Application + Insights component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The user-defined name of the favorite. + :type name: str + :param config: Configuration of this particular favorite, which are driven + by the Azure portal UX. Configuration data is a string containing valid + JSON + :type config: str + :param version: This instance's version of the data model. This can change + as new features are added that can be marked favorite. Current examples + include MetricsExplorer (ME) and Search. + :type version: str + :ivar favorite_id: Internally assigned unique id of the favorite + definition. + :vartype favorite_id: str + :param favorite_type: Enum indicating if this favorite definition is owned + by a specific user or is shared between all users with access to the + Application Insights component. Possible values include: 'shared', 'user' + :type favorite_type: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.FavoriteType + :param source_type: The source of the favorite definition. + :type source_type: str + :ivar time_modified: Date and time in UTC of the last modification that + was made to this favorite definition. + :vartype time_modified: str + :param tags: A list of 0 or more tags that are associated with this + favorite definition + :type tags: list[str] + :param category: Favorite category, as defined by the user at creation + time. + :type category: str + :param is_generated_from_template: Flag denoting wether or not this + favorite was generated from a template. + :type is_generated_from_template: bool + :ivar user_id: Unique user id of the specific user that owns this + favorite. + :vartype user_id: str + """ + + _validation = { + 'favorite_id': {'readonly': True}, + 'time_modified': {'readonly': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'config': {'key': 'Config', 'type': 'str'}, + 'version': {'key': 'Version', 'type': 'str'}, + 'favorite_id': {'key': 'FavoriteId', 'type': 'str'}, + 'favorite_type': {'key': 'FavoriteType', 'type': 'FavoriteType'}, + 'source_type': {'key': 'SourceType', 'type': 'str'}, + 'time_modified': {'key': 'TimeModified', 'type': 'str'}, + 'tags': {'key': 'Tags', 'type': '[str]'}, + 'category': {'key': 'Category', 'type': 'str'}, + 'is_generated_from_template': {'key': 'IsGeneratedFromTemplate', 'type': 'bool'}, + 'user_id': {'key': 'UserId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentFavorite, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.config = kwargs.get('config', None) + self.version = kwargs.get('version', None) + self.favorite_id = None + self.favorite_type = kwargs.get('favorite_type', None) + self.source_type = kwargs.get('source_type', None) + self.time_modified = None + self.tags = kwargs.get('tags', None) + self.category = kwargs.get('category', None) + self.is_generated_from_template = kwargs.get('is_generated_from_template', None) + self.user_id = None + + +class ApplicationInsightsComponentFeature(Model): + """An Application Insights component daily data volume cap status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar feature_name: The pricing feature name. + :vartype feature_name: str + :ivar meter_id: The meter id used for the feature. + :vartype meter_id: str + :ivar meter_rate_frequency: The meter rate for the feature's meter. + :vartype meter_rate_frequency: str + :ivar resouce_id: Reserved, not used now. + :vartype resouce_id: str + :ivar is_hidden: Reserved, not used now. + :vartype is_hidden: bool + :ivar capabilities: A list of Application Insights component feature + capability. + :vartype capabilities: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFeatureCapability] + :ivar title: Display name of the feature. + :vartype title: str + :ivar is_main_feature: Whether can apply addon feature on to it. + :vartype is_main_feature: bool + :ivar supported_addon_features: The add on features on main feature. + :vartype supported_addon_features: str + """ + + _validation = { + 'feature_name': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_rate_frequency': {'readonly': True}, + 'resouce_id': {'readonly': True}, + 'is_hidden': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'title': {'readonly': True}, + 'is_main_feature': {'readonly': True}, + 'supported_addon_features': {'readonly': True}, + } + + _attribute_map = { + 'feature_name': {'key': 'FeatureName', 'type': 'str'}, + 'meter_id': {'key': 'MeterId', 'type': 'str'}, + 'meter_rate_frequency': {'key': 'MeterRateFrequency', 'type': 'str'}, + 'resouce_id': {'key': 'ResouceId', 'type': 'str'}, + 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, + 'capabilities': {'key': 'Capabilities', 'type': '[ApplicationInsightsComponentFeatureCapability]'}, + 'title': {'key': 'Title', 'type': 'str'}, + 'is_main_feature': {'key': 'IsMainFeature', 'type': 'bool'}, + 'supported_addon_features': {'key': 'SupportedAddonFeatures', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentFeature, self).__init__(**kwargs) + self.feature_name = None + self.meter_id = None + self.meter_rate_frequency = None + self.resouce_id = None + self.is_hidden = None + self.capabilities = None + self.title = None + self.is_main_feature = None + self.supported_addon_features = None + + +class ApplicationInsightsComponentFeatureCapabilities(Model): + """An Application Insights component feature capabilities. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar support_export_data: Whether allow to use continuous export feature. + :vartype support_export_data: bool + :ivar burst_throttle_policy: Reserved, not used now. + :vartype burst_throttle_policy: str + :ivar metadata_class: Reserved, not used now. + :vartype metadata_class: str + :ivar live_stream_metrics: Reserved, not used now. + :vartype live_stream_metrics: bool + :ivar application_map: Reserved, not used now. + :vartype application_map: bool + :ivar work_item_integration: Whether allow to use work item integration + feature. + :vartype work_item_integration: bool + :ivar power_bi_integration: Reserved, not used now. + :vartype power_bi_integration: bool + :ivar open_schema: Reserved, not used now. + :vartype open_schema: bool + :ivar proactive_detection: Reserved, not used now. + :vartype proactive_detection: bool + :ivar analytics_integration: Reserved, not used now. + :vartype analytics_integration: bool + :ivar multiple_step_web_test: Whether allow to use multiple steps web test + feature. + :vartype multiple_step_web_test: bool + :ivar api_access_level: Reserved, not used now. + :vartype api_access_level: str + :ivar tracking_type: The application insights component used tracking + type. + :vartype tracking_type: str + :ivar daily_cap: Daily data volume cap in GB. + :vartype daily_cap: float + :ivar daily_cap_reset_time: Daily data volume cap UTC reset hour. + :vartype daily_cap_reset_time: float + :ivar throttle_rate: Reserved, not used now. + :vartype throttle_rate: float + """ + + _validation = { + 'support_export_data': {'readonly': True}, + 'burst_throttle_policy': {'readonly': True}, + 'metadata_class': {'readonly': True}, + 'live_stream_metrics': {'readonly': True}, + 'application_map': {'readonly': True}, + 'work_item_integration': {'readonly': True}, + 'power_bi_integration': {'readonly': True}, + 'open_schema': {'readonly': True}, + 'proactive_detection': {'readonly': True}, + 'analytics_integration': {'readonly': True}, + 'multiple_step_web_test': {'readonly': True}, + 'api_access_level': {'readonly': True}, + 'tracking_type': {'readonly': True}, + 'daily_cap': {'readonly': True}, + 'daily_cap_reset_time': {'readonly': True}, + 'throttle_rate': {'readonly': True}, + } + + _attribute_map = { + 'support_export_data': {'key': 'SupportExportData', 'type': 'bool'}, + 'burst_throttle_policy': {'key': 'BurstThrottlePolicy', 'type': 'str'}, + 'metadata_class': {'key': 'MetadataClass', 'type': 'str'}, + 'live_stream_metrics': {'key': 'LiveStreamMetrics', 'type': 'bool'}, + 'application_map': {'key': 'ApplicationMap', 'type': 'bool'}, + 'work_item_integration': {'key': 'WorkItemIntegration', 'type': 'bool'}, + 'power_bi_integration': {'key': 'PowerBIIntegration', 'type': 'bool'}, + 'open_schema': {'key': 'OpenSchema', 'type': 'bool'}, + 'proactive_detection': {'key': 'ProactiveDetection', 'type': 'bool'}, + 'analytics_integration': {'key': 'AnalyticsIntegration', 'type': 'bool'}, + 'multiple_step_web_test': {'key': 'MultipleStepWebTest', 'type': 'bool'}, + 'api_access_level': {'key': 'ApiAccessLevel', 'type': 'str'}, + 'tracking_type': {'key': 'TrackingType', 'type': 'str'}, + 'daily_cap': {'key': 'DailyCap', 'type': 'float'}, + 'daily_cap_reset_time': {'key': 'DailyCapResetTime', 'type': 'float'}, + 'throttle_rate': {'key': 'ThrottleRate', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentFeatureCapabilities, self).__init__(**kwargs) + self.support_export_data = None + self.burst_throttle_policy = None + self.metadata_class = None + self.live_stream_metrics = None + self.application_map = None + self.work_item_integration = None + self.power_bi_integration = None + self.open_schema = None + self.proactive_detection = None + self.analytics_integration = None + self.multiple_step_web_test = None + self.api_access_level = None + self.tracking_type = None + self.daily_cap = None + self.daily_cap_reset_time = None + self.throttle_rate = None + + +class ApplicationInsightsComponentFeatureCapability(Model): + """An Application Insights component feature capability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the capability. + :vartype name: str + :ivar description: The description of the capability. + :vartype description: str + :ivar value: The value of the capability. + :vartype value: str + :ivar unit: The unit of the capability. + :vartype unit: str + :ivar meter_id: The meter used for the capability. + :vartype meter_id: str + :ivar meter_rate_frequency: The meter rate of the meter. + :vartype meter_rate_frequency: str + """ + + _validation = { + 'name': {'readonly': True}, + 'description': {'readonly': True}, + 'value': {'readonly': True}, + 'unit': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_rate_frequency': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'description': {'key': 'Description', 'type': 'str'}, + 'value': {'key': 'Value', 'type': 'str'}, + 'unit': {'key': 'Unit', 'type': 'str'}, + 'meter_id': {'key': 'MeterId', 'type': 'str'}, + 'meter_rate_frequency': {'key': 'MeterRateFrequency', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentFeatureCapability, self).__init__(**kwargs) + self.name = None + self.description = None + self.value = None + self.unit = None + self.meter_id = None + self.meter_rate_frequency = None + + +class ApplicationInsightsComponentProactiveDetectionConfiguration(Model): + """Properties that define a ProactiveDetection configuration. + + :param name: The rule name + :type name: str + :param enabled: A flag that indicates whether this rule is enabled by the + user + :type enabled: bool + :param send_emails_to_subscription_owners: A flag that indicated whether + notifications on this rule should be sent to subscription owners + :type send_emails_to_subscription_owners: bool + :param custom_emails: Custom email addresses for this rule notifications + :type custom_emails: list[str] + :param last_updated_time: The last time this rule was updated + :type last_updated_time: str + :param rule_definitions: Static definitions of the ProactiveDetection + configuration rule (same values for all components). + :type rule_definitions: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'enabled': {'key': 'Enabled', 'type': 'bool'}, + 'send_emails_to_subscription_owners': {'key': 'SendEmailsToSubscriptionOwners', 'type': 'bool'}, + 'custom_emails': {'key': 'CustomEmails', 'type': '[str]'}, + 'last_updated_time': {'key': 'LastUpdatedTime', 'type': 'str'}, + 'rule_definitions': {'key': 'RuleDefinitions', 'type': 'ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentProactiveDetectionConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.enabled = kwargs.get('enabled', None) + self.send_emails_to_subscription_owners = kwargs.get('send_emails_to_subscription_owners', None) + self.custom_emails = kwargs.get('custom_emails', None) + self.last_updated_time = kwargs.get('last_updated_time', None) + self.rule_definitions = kwargs.get('rule_definitions', None) + + +class ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions(Model): + """Static definitions of the ProactiveDetection configuration rule (same + values for all components). + + :param name: The rule name + :type name: str + :param display_name: The rule name as it is displayed in UI + :type display_name: str + :param description: The rule description + :type description: str + :param help_url: URL which displays additional info about the proactive + detection rule + :type help_url: str + :param is_hidden: A flag indicating whether the rule is hidden (from the + UI) + :type is_hidden: bool + :param is_enabled_by_default: A flag indicating whether the rule is + enabled by default + :type is_enabled_by_default: bool + :param is_in_preview: A flag indicating whether the rule is in preview + :type is_in_preview: bool + :param supports_email_notifications: A flag indicating whether email + notifications are supported for detections for this rule + :type supports_email_notifications: bool + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'display_name': {'key': 'DisplayName', 'type': 'str'}, + 'description': {'key': 'Description', 'type': 'str'}, + 'help_url': {'key': 'HelpUrl', 'type': 'str'}, + 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, + 'is_enabled_by_default': {'key': 'IsEnabledByDefault', 'type': 'bool'}, + 'is_in_preview': {'key': 'IsInPreview', 'type': 'bool'}, + 'supports_email_notifications': {'key': 'SupportsEmailNotifications', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.help_url = kwargs.get('help_url', None) + self.is_hidden = kwargs.get('is_hidden', None) + self.is_enabled_by_default = kwargs.get('is_enabled_by_default', None) + self.is_in_preview = kwargs.get('is_in_preview', None) + self.supports_email_notifications = kwargs.get('supports_email_notifications', None) + + +class ApplicationInsightsComponentQuotaStatus(Model): + """An Application Insights component daily data volume cap status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar app_id: The Application ID for the Application Insights component. + :vartype app_id: str + :ivar should_be_throttled: The daily data volume cap is met, and data + ingestion will be stopped. + :vartype should_be_throttled: bool + :ivar expiration_time: Date and time when the daily data volume cap will + be reset, and data ingestion will resume. + :vartype expiration_time: str + """ + + _validation = { + 'app_id': {'readonly': True}, + 'should_be_throttled': {'readonly': True}, + 'expiration_time': {'readonly': True}, + } + + _attribute_map = { + 'app_id': {'key': 'AppId', 'type': 'str'}, + 'should_be_throttled': {'key': 'ShouldBeThrottled', 'type': 'bool'}, + 'expiration_time': {'key': 'ExpirationTime', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentQuotaStatus, self).__init__(**kwargs) + self.app_id = None + self.should_be_throttled = None + self.expiration_time = None + + +class ApplicationInsightsComponentWebTestLocation(Model): + """Properties that define a web test location available to an Application + Insights Component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar display_name: The display name of the web test location. + :vartype display_name: str + :ivar tag: Internally defined geographic location tag. + :vartype tag: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'tag': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'DisplayName', 'type': 'str'}, + 'tag': {'key': 'Tag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentWebTestLocation, self).__init__(**kwargs) + self.display_name = None + self.tag = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ComponentPurgeBody(Model): + """Describes the body of a purge request for an App Insights component. + + All required parameters must be populated in order to send to Azure. + + :param table: Required. Table from which to purge data. + :type table: str + :param filters: Required. The set of columns and filters (queries) to run + over them to purge the resulting data. + :type filters: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ComponentPurgeBodyFilters] + """ + + _validation = { + 'table': {'required': True}, + 'filters': {'required': True}, + } + + _attribute_map = { + 'table': {'key': 'table', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': '[ComponentPurgeBodyFilters]'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeBody, self).__init__(**kwargs) + self.table = kwargs.get('table', None) + self.filters = kwargs.get('filters', None) + + +class ComponentPurgeBodyFilters(Model): + """User-defined filters to return data which will be purged from the table. + + :param column: The column of the table over which the given query should + run + :type column: str + :param operator: A query operator to evaluate over the provided column and + value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, + and have the same behavior as they would in a KQL query. + :type operator: str + :param value: the value for the operator to function over. This can be a + number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of + values. + :type value: object + :param key: When filtering over custom dimensions, this key will be used + as the name of the custom dimension. + :type key: str + """ + + _attribute_map = { + 'column': {'key': 'column', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeBodyFilters, self).__init__(**kwargs) + self.column = kwargs.get('column', None) + self.operator = kwargs.get('operator', None) + self.value = kwargs.get('value', None) + self.key = kwargs.get('key', None) + + +class ComponentPurgeResponse(Model): + """Response containing operationId for a specific purge action. + + All required parameters must be populated in order to send to Azure. + + :param operation_id: Required. Id to use when querying for status for a + particular purge operation. + :type operation_id: str + """ + + _validation = { + 'operation_id': {'required': True}, + } + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeResponse, self).__init__(**kwargs) + self.operation_id = kwargs.get('operation_id', None) + + +class ComponentPurgeStatusResponse(Model): + """Response containing status for a specific purge operation. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Status of the operation represented by the + requested Id. Possible values include: 'pending', 'completed' + :type status: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.PurgeState + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeStatusResponse, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + + +class ErrorFieldContract(Model): + """Error Field contract. + + :param code: Property level error code. + :type code: str + :param message: Human-readable representation of property-level error. + :type message: str + :param target: Property name. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorFieldContract, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + + +class ErrorResponse(Model): + """Error response indicates Insights service is not able to process the + incoming request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class InnerError(Model): + """Inner error. + + :param diagnosticcontext: Provides correlation for request + :type diagnosticcontext: str + :param time: Request time + :type time: datetime + """ + + _attribute_map = { + 'diagnosticcontext': {'key': 'diagnosticcontext', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(InnerError, self).__init__(**kwargs) + self.diagnosticcontext = kwargs.get('diagnosticcontext', None) + self.time = kwargs.get('time', None) + + +class LinkProperties(Model): + """Contains a sourceId and workbook resource id to link two resources. + + :param source_id: The source Azure resource id + :type source_id: str + :param target_id: The workbook Azure resource id + :type target_id: str + :param category: The category of workbook + :type category: str + """ + + _attribute_map = { + 'source_id': {'key': 'sourceId', 'type': 'str'}, + 'target_id': {'key': 'targetId', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LinkProperties, self).__init__(**kwargs) + self.source_id = kwargs.get('source_id', None) + self.target_id = kwargs.get('target_id', None) + self.category = kwargs.get('category', None) + + +class Operation(Model): + """CDN REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.applicationinsights.v2015_05_01.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): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Cdn + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, 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 PrivateLinkScopedResource(Model): + """The private link scope resource reference. + + :param resource_id: The full resource Id of the private link scope + resource. + :type resource_id: str + :param scope_id: The private link scope unique Identifier. + :type scope_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'ResourceId', 'type': 'str'}, + 'scope_id': {'key': 'ScopeId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkScopedResource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.scope_id = kwargs.get('scope_id', None) + + +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a WebTest instance. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TagsResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class WebtestsResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, **kwargs): + super(WebtestsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class WebTest(WebtestsResource): + """An Application Insights web test definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: The kind of web test that this web test watches. Choices are + ping and multistep. Possible values include: 'ping', 'multistep'. Default + value: "ping" . + :type kind: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestKind + :param synthetic_monitor_id: Required. Unique ID of this WebTest. This is + typically the same value as the Name field. + :type synthetic_monitor_id: str + :param web_test_name: Required. User defined name if this WebTest. + :type web_test_name: str + :param description: Purpose/user defined descriptive test for this + WebTest. + :type description: str + :param enabled: Is the test actively being monitored. + :type enabled: bool + :param frequency: Interval in seconds between test runs for this WebTest. + Default value is 300. Default value: 300 . + :type frequency: int + :param timeout: Seconds until this WebTest will timeout and fail. Default + value is 30. Default value: 30 . + :type timeout: int + :param web_test_kind: Required. The kind of web test this is, valid + choices are ping and multistep. Possible values include: 'ping', + 'multistep'. Default value: "ping" . + :type web_test_kind: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestKind + :param retry_enabled: Allow for retries should this WebTest fail. + :type retry_enabled: bool + :param locations: Required. A list of where to physically run the tests + from to give global coverage for accessibility of your application. + :type locations: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestGeolocation] + :param configuration: An XML configuration specification for a WebTest. + :type configuration: + ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestPropertiesConfiguration + :ivar provisioning_state: Current state of this component, whether or not + is has been provisioned within the resource group it is defined. Users + cannot change this value but are able to read from it. Values will include + Succeeded, Deploying, Canceled, and Failed. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'synthetic_monitor_id': {'required': True}, + 'web_test_name': {'required': True}, + 'web_test_kind': {'required': True}, + 'locations': {'required': True}, + 'provisioning_state': {'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}'}, + 'kind': {'key': 'kind', 'type': 'WebTestKind'}, + 'synthetic_monitor_id': {'key': 'properties.SyntheticMonitorId', 'type': 'str'}, + 'web_test_name': {'key': 'properties.Name', 'type': 'str'}, + 'description': {'key': 'properties.Description', 'type': 'str'}, + 'enabled': {'key': 'properties.Enabled', 'type': 'bool'}, + 'frequency': {'key': 'properties.Frequency', 'type': 'int'}, + 'timeout': {'key': 'properties.Timeout', 'type': 'int'}, + 'web_test_kind': {'key': 'properties.Kind', 'type': 'WebTestKind'}, + 'retry_enabled': {'key': 'properties.RetryEnabled', 'type': 'bool'}, + 'locations': {'key': 'properties.Locations', 'type': '[WebTestGeolocation]'}, + 'configuration': {'key': 'properties.Configuration', 'type': 'WebTestPropertiesConfiguration'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WebTest, self).__init__(**kwargs) + self.kind = kwargs.get('kind', "ping") + self.synthetic_monitor_id = kwargs.get('synthetic_monitor_id', None) + self.web_test_name = kwargs.get('web_test_name', None) + self.description = kwargs.get('description', None) + self.enabled = kwargs.get('enabled', None) + self.frequency = kwargs.get('frequency', 300) + self.timeout = kwargs.get('timeout', 30) + self.web_test_kind = kwargs.get('web_test_kind', "ping") + self.retry_enabled = kwargs.get('retry_enabled', None) + self.locations = kwargs.get('locations', None) + self.configuration = kwargs.get('configuration', None) + self.provisioning_state = None + + +class WebTestGeolocation(Model): + """Geo-physical location to run a web test from. You must specify one or more + locations for the test to run from. + + :param location: Location ID for the webtest to run from. + :type location: str + """ + + _attribute_map = { + 'location': {'key': 'Id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WebTestGeolocation, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + + +class WebTestPropertiesConfiguration(Model): + """An XML configuration specification for a WebTest. + + :param web_test: The XML specification of a WebTest to run against an + application. + :type web_test: str + """ + + _attribute_map = { + 'web_test': {'key': 'WebTest', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WebTestPropertiesConfiguration, self).__init__(**kwargs) + self.web_test = kwargs.get('web_test', None) + + +class WorkbookResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _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}'}, + } + + def __init__(self, **kwargs): + super(WorkbookResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class Workbook(WorkbookResource): + """An Application Insights workbook definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: The kind of workbook. Choices are user and shared. Possible + values include: 'user', 'shared' + :type kind: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.SharedTypeKind + :param workbook_name: Required. The user-defined name of the workbook. + :type workbook_name: str + :param serialized_data: Required. Configuration of this particular + workbook. Configuration data is a string containing valid JSON + :type serialized_data: str + :param version: This instance's version of the data model. This can change + as new features are added that can be marked workbook. + :type version: str + :param workbook_id: Required. Internally assigned unique id of the + workbook definition. + :type workbook_id: str + :param shared_type_kind: Required. Enum indicating if this workbook + definition is owned by a specific user or is shared between all users with + access to the Application Insights component. Possible values include: + 'user', 'shared'. Default value: "shared" . + :type shared_type_kind: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.SharedTypeKind + :ivar time_modified: Date and time in UTC of the last modification that + was made to this workbook definition. + :vartype time_modified: str + :param category: Required. Workbook category, as defined by the user at + creation time. + :type category: str + :param workbook_tags: A list of 0 or more tags that are associated with + this workbook definition + :type workbook_tags: list[str] + :param user_id: Required. Unique user id of the specific user that owns + this workbook. + :type user_id: str + :param source_resource_id: Optional resourceId for a source resource. + :type source_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'workbook_name': {'required': True}, + 'serialized_data': {'required': True}, + 'workbook_id': {'required': True}, + 'shared_type_kind': {'required': True}, + 'time_modified': {'readonly': True}, + 'category': {'required': True}, + 'user_id': {'required': 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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'workbook_name': {'key': 'properties.name', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'workbook_id': {'key': 'properties.workbookId', 'type': 'str'}, + 'shared_type_kind': {'key': 'properties.kind', 'type': 'str'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'workbook_tags': {'key': 'properties.tags', 'type': '[str]'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'source_resource_id': {'key': 'properties.sourceResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Workbook, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.workbook_name = kwargs.get('workbook_name', None) + self.serialized_data = kwargs.get('serialized_data', None) + self.version = kwargs.get('version', None) + self.workbook_id = kwargs.get('workbook_id', None) + self.shared_type_kind = kwargs.get('shared_type_kind', "shared") + self.time_modified = None + self.category = kwargs.get('category', None) + self.workbook_tags = kwargs.get('workbook_tags', None) + self.user_id = kwargs.get('user_id', None) + self.source_resource_id = kwargs.get('source_resource_id', None) + + +class WorkbookError(Model): + """Error message body that will indicate why the operation failed. + + :param code: Service-defined error code. This code serves as a sub-status + for the HTTP error code specified in the response. + :type code: str + :param message: Human-readable representation of the error. + :type message: str + :param details: The list of invalid fields send in request, in case of + validation error. + :type details: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + } + + def __init__(self, **kwargs): + super(WorkbookError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class WorkbookErrorException(HttpOperationError): + """Server responsed with exception of type: 'WorkbookError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(WorkbookErrorException, self).__init__(deserialize, response, 'WorkbookError', *args) + + +class WorkItemConfiguration(Model): + """Work item configuration associated with an application insights resource. + + :param connector_id: Connector identifier where work item is created + :type connector_id: str + :param config_display_name: Configuration friendly name + :type config_display_name: str + :param is_default: Boolean value indicating whether configuration is + default + :type is_default: bool + :param id: Unique Id for work item + :type id: str + :param config_properties: Serialized JSON object for detailed properties + :type config_properties: str + """ + + _attribute_map = { + 'connector_id': {'key': 'ConnectorId', 'type': 'str'}, + 'config_display_name': {'key': 'ConfigDisplayName', 'type': 'str'}, + 'is_default': {'key': 'IsDefault', 'type': 'bool'}, + 'id': {'key': 'Id', 'type': 'str'}, + 'config_properties': {'key': 'ConfigProperties', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkItemConfiguration, self).__init__(**kwargs) + self.connector_id = kwargs.get('connector_id', None) + self.config_display_name = kwargs.get('config_display_name', None) + self.is_default = kwargs.get('is_default', None) + self.id = kwargs.get('id', None) + self.config_properties = kwargs.get('config_properties', None) + + +class WorkItemConfigurationError(Model): + """Error associated with trying to get work item configuration or + configurations. + + :param code: Error detail code and explanation + :type code: str + :param message: Error message + :type message: str + :param innererror: + :type innererror: + ~azure.mgmt.applicationinsights.v2015_05_01.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + } + + def __init__(self, **kwargs): + super(WorkItemConfigurationError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.innererror = kwargs.get('innererror', None) + + +class WorkItemConfigurationErrorException(HttpOperationError): + """Server responsed with exception of type: 'WorkItemConfigurationError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(WorkItemConfigurationErrorException, self).__init__(deserialize, response, 'WorkItemConfigurationError', *args) + + +class WorkItemCreateConfiguration(Model): + """Work item configuration creation payload. + + :param connector_id: Unique connector id + :type connector_id: str + :param connector_data_configuration: Serialized JSON object for detailed + properties + :type connector_data_configuration: str + :param validate_only: Boolean indicating validate only + :type validate_only: bool + :param work_item_properties: Custom work item properties + :type work_item_properties: dict[str, str] + """ + + _attribute_map = { + 'connector_id': {'key': 'ConnectorId', 'type': 'str'}, + 'connector_data_configuration': {'key': 'ConnectorDataConfiguration', 'type': 'str'}, + 'validate_only': {'key': 'ValidateOnly', 'type': 'bool'}, + 'work_item_properties': {'key': 'WorkItemProperties', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(WorkItemCreateConfiguration, self).__init__(**kwargs) + self.connector_id = kwargs.get('connector_id', None) + self.connector_data_configuration = kwargs.get('connector_data_configuration', None) + self.validate_only = kwargs.get('validate_only', None) + self.work_item_properties = kwargs.get('work_item_properties', None) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_models_py3.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_models_py3.py new file mode 100644 index 00000000000..9d4210e5ffd --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_models_py3.py @@ -0,0 +1,1933 @@ +# 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 Annotation(Model): + """Annotation associated with an application insights resource. + + :param annotation_name: Name of annotation + :type annotation_name: str + :param category: Category of annotation, free form + :type category: str + :param event_time: Time when event occurred + :type event_time: datetime + :param id: Unique Id for annotation + :type id: str + :param properties: Serialized JSON object for detailed properties + :type properties: str + :param related_annotation: Related parent annotation if any. Default + value: "null" . + :type related_annotation: str + """ + + _attribute_map = { + 'annotation_name': {'key': 'AnnotationName', 'type': 'str'}, + 'category': {'key': 'Category', 'type': 'str'}, + 'event_time': {'key': 'EventTime', 'type': 'iso-8601'}, + 'id': {'key': 'Id', 'type': 'str'}, + 'properties': {'key': 'Properties', 'type': 'str'}, + 'related_annotation': {'key': 'RelatedAnnotation', 'type': 'str'}, + } + + def __init__(self, *, annotation_name: str=None, category: str=None, event_time=None, id: str=None, properties: str=None, related_annotation: str="null", **kwargs) -> None: + super(Annotation, self).__init__(**kwargs) + self.annotation_name = annotation_name + self.category = category + self.event_time = event_time + self.id = id + self.properties = properties + self.related_annotation = related_annotation + + +class AnnotationError(Model): + """Error associated with trying to create annotation with Id that already + exist. + + :param code: Error detail code and explanation + :type code: str + :param message: Error message + :type message: str + :param innererror: + :type innererror: + ~azure.mgmt.applicationinsights.v2015_05_01.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + } + + def __init__(self, *, code: str=None, message: str=None, innererror=None, **kwargs) -> None: + super(AnnotationError, self).__init__(**kwargs) + self.code = code + self.message = message + self.innererror = innererror + + +class AnnotationErrorException(HttpOperationError): + """Server responsed with exception of type: 'AnnotationError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(AnnotationErrorException, self).__init__(deserialize, response, 'AnnotationError', *args) + + +class APIKeyRequest(Model): + """An Application Insights component API Key creation request definition. + + :param name: The name of the API Key. + :type name: str + :param linked_read_properties: The read access rights of this API Key. + :type linked_read_properties: list[str] + :param linked_write_properties: The write access rights of this API Key. + :type linked_write_properties: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'linked_read_properties': {'key': 'linkedReadProperties', 'type': '[str]'}, + 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, linked_read_properties=None, linked_write_properties=None, **kwargs) -> None: + super(APIKeyRequest, self).__init__(**kwargs) + self.name = name + self.linked_read_properties = linked_read_properties + self.linked_write_properties = linked_write_properties + + +class ComponentsResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(ComponentsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class ApplicationInsightsComponent(ComponentsResource): + """An Application Insights component definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. The kind of application that this component refers + to, used to customize UI. This value is a freeform string, values should + typically be one of the following: web, ios, other, store, java, phone. + :type kind: str + :ivar application_id: The unique ID of your application. This field + mirrors the 'Name' field and cannot be changed. + :vartype application_id: str + :ivar app_id: Application Insights Unique ID for your Application. + :vartype app_id: str + :param application_type: Required. Type of application being monitored. + Possible values include: 'web', 'other'. Default value: "web" . + :type application_type: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationType + :param flow_type: Used by the Application Insights system to determine + what kind of flow this component was created by. This is to be set to + 'Bluefield' when creating/updating a component via the REST API. Possible + values include: 'Bluefield'. Default value: "Bluefield" . + :type flow_type: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.FlowType + :param request_source: Describes what tool created this Application + Insights component. Customers using this API should set this to the + default 'rest'. Possible values include: 'rest'. Default value: "rest" . + :type request_source: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.RequestSource + :ivar instrumentation_key: Application Insights Instrumentation key. A + read-only value that applications can use to identify the destination for + all telemetry sent to Azure Application Insights. This value will be + supplied upon construction of each new Application Insights component. + :vartype instrumentation_key: str + :ivar creation_date: Creation Date for the Application Insights component, + in ISO 8601 format. + :vartype creation_date: datetime + :ivar tenant_id: Azure Tenant Id. + :vartype tenant_id: str + :param hockey_app_id: The unique application ID created when a new + application is added to HockeyApp, used for communications with HockeyApp. + :type hockey_app_id: str + :ivar hockey_app_token: Token used to authenticate communications with + between Application Insights and HockeyApp. + :vartype hockey_app_token: str + :ivar provisioning_state: Current state of this component: whether or not + is has been provisioned within the resource group it is defined. Users + cannot change this value but are able to read from it. Values will include + Succeeded, Deploying, Canceled, and Failed. + :vartype provisioning_state: str + :param sampling_percentage: Percentage of the data produced by the + application being monitored that is being sampled for Application Insights + telemetry. + :type sampling_percentage: float + :ivar connection_string: Application Insights component connection string. + :vartype connection_string: str + :param retention_in_days: Retention period in days. Default value: 90 . + :type retention_in_days: int + :param disable_ip_masking: Disable IP masking. + :type disable_ip_masking: bool + :param immediate_purge_data_on30_days: Purge data immediately after 30 + days. + :type immediate_purge_data_on30_days: bool + :ivar private_link_scoped_resources: List of linked private link scope + resources. + :vartype private_link_scoped_resources: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.PrivateLinkScopedResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'application_id': {'readonly': True}, + 'app_id': {'readonly': True}, + 'application_type': {'required': True}, + 'instrumentation_key': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'hockey_app_token': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'connection_string': {'readonly': True}, + 'private_link_scoped_resources': {'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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'application_id': {'key': 'properties.ApplicationId', 'type': 'str'}, + 'app_id': {'key': 'properties.AppId', 'type': 'str'}, + 'application_type': {'key': 'properties.Application_Type', 'type': 'str'}, + 'flow_type': {'key': 'properties.Flow_Type', 'type': 'str'}, + 'request_source': {'key': 'properties.Request_Source', 'type': 'str'}, + 'instrumentation_key': {'key': 'properties.InstrumentationKey', 'type': 'str'}, + 'creation_date': {'key': 'properties.CreationDate', 'type': 'iso-8601'}, + 'tenant_id': {'key': 'properties.TenantId', 'type': 'str'}, + 'hockey_app_id': {'key': 'properties.HockeyAppId', 'type': 'str'}, + 'hockey_app_token': {'key': 'properties.HockeyAppToken', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sampling_percentage': {'key': 'properties.SamplingPercentage', 'type': 'float'}, + 'connection_string': {'key': 'properties.ConnectionString', 'type': 'str'}, + 'retention_in_days': {'key': 'properties.RetentionInDays', 'type': 'int'}, + 'disable_ip_masking': {'key': 'properties.DisableIpMasking', 'type': 'bool'}, + 'immediate_purge_data_on30_days': {'key': 'properties.ImmediatePurgeDataOn30Days', 'type': 'bool'}, + 'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'}, + } + + def __init__(self, *, location: str, kind: str, tags=None, application_type="web", flow_type="Bluefield", request_source="rest", hockey_app_id: str=None, sampling_percentage: float=None, retention_in_days: int=90, disable_ip_masking: bool=None, immediate_purge_data_on30_days: bool=None, **kwargs) -> None: + super(ApplicationInsightsComponent, self).__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.application_id = None + self.app_id = None + self.application_type = application_type + self.flow_type = flow_type + self.request_source = request_source + self.instrumentation_key = None + self.creation_date = None + self.tenant_id = None + self.hockey_app_id = hockey_app_id + self.hockey_app_token = None + self.provisioning_state = None + self.sampling_percentage = sampling_percentage + self.connection_string = None + self.retention_in_days = retention_in_days + self.disable_ip_masking = disable_ip_masking + self.immediate_purge_data_on30_days = immediate_purge_data_on30_days + self.private_link_scoped_resources = None + + +class ApplicationInsightsComponentAnalyticsItem(Model): + """Properties that define an Analytics item that is associated to an + Application Insights component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Internally assigned unique id of the item definition. + :type id: str + :param name: The user-defined name of the item. + :type name: str + :param content: The content of this item + :type content: str + :ivar version: This instance's version of the data model. This can change + as new features are added. + :vartype version: str + :param scope: Enum indicating if this item definition is owned by a + specific user or is shared between all users with access to the + Application Insights component. Possible values include: 'shared', 'user' + :type scope: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemScope + :param type: Enum indicating the type of the Analytics item. Possible + values include: 'query', 'function', 'folder', 'recent' + :type type: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemType + :ivar time_created: Date and time in UTC when this item was created. + :vartype time_created: str + :ivar time_modified: Date and time in UTC of the last modification that + was made to this item. + :vartype time_modified: str + :param properties: + :type properties: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAnalyticsItemProperties + """ + + _validation = { + 'version': {'readonly': True}, + 'time_created': {'readonly': True}, + 'time_modified': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'Id', 'type': 'str'}, + 'name': {'key': 'Name', 'type': 'str'}, + 'content': {'key': 'Content', 'type': 'str'}, + 'version': {'key': 'Version', 'type': 'str'}, + 'scope': {'key': 'Scope', 'type': 'str'}, + 'type': {'key': 'Type', 'type': 'str'}, + 'time_created': {'key': 'TimeCreated', 'type': 'str'}, + 'time_modified': {'key': 'TimeModified', 'type': 'str'}, + 'properties': {'key': 'Properties', 'type': 'ApplicationInsightsComponentAnalyticsItemProperties'}, + } + + def __init__(self, *, id: str=None, name: str=None, content: str=None, scope=None, type=None, properties=None, **kwargs) -> None: + super(ApplicationInsightsComponentAnalyticsItem, self).__init__(**kwargs) + self.id = id + self.name = name + self.content = content + self.version = None + self.scope = scope + self.type = type + self.time_created = None + self.time_modified = None + self.properties = properties + + +class ApplicationInsightsComponentAnalyticsItemProperties(Model): + """A set of properties that can be defined in the context of a specific item + type. Each type may have its own properties. + + :param function_alias: A function alias, used when the type of the item is + Function + :type function_alias: str + """ + + _attribute_map = { + 'function_alias': {'key': 'functionAlias', 'type': 'str'}, + } + + def __init__(self, *, function_alias: str=None, **kwargs) -> None: + super(ApplicationInsightsComponentAnalyticsItemProperties, self).__init__(**kwargs) + self.function_alias = function_alias + + +class ApplicationInsightsComponentAPIKey(Model): + """Properties that define an API key of an Application Insights Component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The unique ID of the API key inside an Application Insights + component. It is auto generated when the API key is created. + :vartype id: str + :ivar api_key: The API key value. It will be only return once when the API + Key was created. + :vartype api_key: str + :param created_date: The create date of this API key. + :type created_date: str + :param name: The name of the API key. + :type name: str + :param linked_read_properties: The read access rights of this API Key. + :type linked_read_properties: list[str] + :param linked_write_properties: The write access rights of this API Key. + :type linked_write_properties: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'api_key': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'api_key': {'key': 'apiKey', 'type': 'str'}, + 'created_date': {'key': 'createdDate', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'linked_read_properties': {'key': 'linkedReadProperties', 'type': '[str]'}, + 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, + } + + def __init__(self, *, created_date: str=None, name: str=None, linked_read_properties=None, linked_write_properties=None, **kwargs) -> None: + super(ApplicationInsightsComponentAPIKey, self).__init__(**kwargs) + self.id = None + self.api_key = None + self.created_date = created_date + self.name = name + self.linked_read_properties = linked_read_properties + self.linked_write_properties = linked_write_properties + + +class ApplicationInsightsComponentAvailableFeatures(Model): + """An Application Insights component available features. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar result: A list of Application Insights component feature. + :vartype result: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFeature] + """ + + _validation = { + 'result': {'readonly': True}, + } + + _attribute_map = { + 'result': {'key': 'Result', 'type': '[ApplicationInsightsComponentFeature]'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentAvailableFeatures, self).__init__(**kwargs) + self.result = None + + +class ApplicationInsightsComponentBillingFeatures(Model): + """An Application Insights component billing features. + + :param data_volume_cap: An Application Insights component daily data + volume cap + :type data_volume_cap: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentDataVolumeCap + :param current_billing_features: Current enabled pricing plan. When the + component is in the Enterprise plan, this will list both 'Basic' and + 'Application Insights Enterprise'. + :type current_billing_features: list[str] + """ + + _attribute_map = { + 'data_volume_cap': {'key': 'DataVolumeCap', 'type': 'ApplicationInsightsComponentDataVolumeCap'}, + 'current_billing_features': {'key': 'CurrentBillingFeatures', 'type': '[str]'}, + } + + def __init__(self, *, data_volume_cap=None, current_billing_features=None, **kwargs) -> None: + super(ApplicationInsightsComponentBillingFeatures, self).__init__(**kwargs) + self.data_volume_cap = data_volume_cap + self.current_billing_features = current_billing_features + + +class ApplicationInsightsComponentDataVolumeCap(Model): + """An Application Insights component daily data volume cap. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param cap: Daily data volume cap in GB. + :type cap: float + :ivar reset_time: Daily data volume cap UTC reset hour. + :vartype reset_time: int + :param warning_threshold: Reserved, not used for now. + :type warning_threshold: int + :param stop_send_notification_when_hit_threshold: Reserved, not used for + now. + :type stop_send_notification_when_hit_threshold: bool + :param stop_send_notification_when_hit_cap: Do not send a notification + email when the daily data volume cap is met. + :type stop_send_notification_when_hit_cap: bool + :ivar max_history_cap: Maximum daily data volume cap that the user can set + for this component. + :vartype max_history_cap: float + """ + + _validation = { + 'reset_time': {'readonly': True}, + 'max_history_cap': {'readonly': True}, + } + + _attribute_map = { + 'cap': {'key': 'Cap', 'type': 'float'}, + 'reset_time': {'key': 'ResetTime', 'type': 'int'}, + 'warning_threshold': {'key': 'WarningThreshold', 'type': 'int'}, + 'stop_send_notification_when_hit_threshold': {'key': 'StopSendNotificationWhenHitThreshold', 'type': 'bool'}, + 'stop_send_notification_when_hit_cap': {'key': 'StopSendNotificationWhenHitCap', 'type': 'bool'}, + 'max_history_cap': {'key': 'MaxHistoryCap', 'type': 'float'}, + } + + def __init__(self, *, cap: float=None, warning_threshold: int=None, stop_send_notification_when_hit_threshold: bool=None, stop_send_notification_when_hit_cap: bool=None, **kwargs) -> None: + super(ApplicationInsightsComponentDataVolumeCap, self).__init__(**kwargs) + self.cap = cap + self.reset_time = None + self.warning_threshold = warning_threshold + self.stop_send_notification_when_hit_threshold = stop_send_notification_when_hit_threshold + self.stop_send_notification_when_hit_cap = stop_send_notification_when_hit_cap + self.max_history_cap = None + + +class ApplicationInsightsComponentExportConfiguration(Model): + """Properties that define a Continuous Export configuration. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar export_id: The unique ID of the export configuration inside an + Application Insights component. It is auto generated when the Continuous + Export configuration is created. + :vartype export_id: str + :ivar instrumentation_key: The instrumentation key of the Application + Insights component. + :vartype instrumentation_key: str + :param record_types: This comma separated list of document types that will + be exported. The possible values include 'Requests', 'Event', + 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', + 'PerformanceCounters', 'Availability', 'Messages'. + :type record_types: str + :ivar application_name: The name of the Application Insights component. + :vartype application_name: str + :ivar subscription_id: The subscription of the Application Insights + component. + :vartype subscription_id: str + :ivar resource_group: The resource group of the Application Insights + component. + :vartype resource_group: str + :ivar destination_storage_subscription_id: The destination storage account + subscription ID. + :vartype destination_storage_subscription_id: str + :ivar destination_storage_location_id: The destination account location + ID. + :vartype destination_storage_location_id: str + :ivar destination_account_id: The name of destination account. + :vartype destination_account_id: str + :ivar destination_type: The destination type. + :vartype destination_type: str + :ivar is_user_enabled: This will be 'true' if the Continuous Export + configuration is enabled, otherwise it will be 'false'. + :vartype is_user_enabled: str + :ivar last_user_update: Last time the Continuous Export configuration was + updated. + :vartype last_user_update: str + :param notification_queue_enabled: Deprecated + :type notification_queue_enabled: str + :ivar export_status: This indicates current Continuous Export + configuration status. The possible values are 'Preparing', 'Success', + 'Failure'. + :vartype export_status: str + :ivar last_success_time: The last time data was successfully delivered to + the destination storage container for this Continuous Export + configuration. + :vartype last_success_time: str + :ivar last_gap_time: The last time the Continuous Export configuration + started failing. + :vartype last_gap_time: str + :ivar permanent_error_reason: This is the reason the Continuous Export + configuration started failing. It can be 'AzureStorageNotFound' or + 'AzureStorageAccessDenied'. + :vartype permanent_error_reason: str + :ivar storage_name: The name of the destination storage account. + :vartype storage_name: str + :ivar container_name: The name of the destination storage container. + :vartype container_name: str + """ + + _validation = { + 'export_id': {'readonly': True}, + 'instrumentation_key': {'readonly': True}, + 'application_name': {'readonly': True}, + 'subscription_id': {'readonly': True}, + 'resource_group': {'readonly': True}, + 'destination_storage_subscription_id': {'readonly': True}, + 'destination_storage_location_id': {'readonly': True}, + 'destination_account_id': {'readonly': True}, + 'destination_type': {'readonly': True}, + 'is_user_enabled': {'readonly': True}, + 'last_user_update': {'readonly': True}, + 'export_status': {'readonly': True}, + 'last_success_time': {'readonly': True}, + 'last_gap_time': {'readonly': True}, + 'permanent_error_reason': {'readonly': True}, + 'storage_name': {'readonly': True}, + 'container_name': {'readonly': True}, + } + + _attribute_map = { + 'export_id': {'key': 'ExportId', 'type': 'str'}, + 'instrumentation_key': {'key': 'InstrumentationKey', 'type': 'str'}, + 'record_types': {'key': 'RecordTypes', 'type': 'str'}, + 'application_name': {'key': 'ApplicationName', 'type': 'str'}, + 'subscription_id': {'key': 'SubscriptionId', 'type': 'str'}, + 'resource_group': {'key': 'ResourceGroup', 'type': 'str'}, + 'destination_storage_subscription_id': {'key': 'DestinationStorageSubscriptionId', 'type': 'str'}, + 'destination_storage_location_id': {'key': 'DestinationStorageLocationId', 'type': 'str'}, + 'destination_account_id': {'key': 'DestinationAccountId', 'type': 'str'}, + 'destination_type': {'key': 'DestinationType', 'type': 'str'}, + 'is_user_enabled': {'key': 'IsUserEnabled', 'type': 'str'}, + 'last_user_update': {'key': 'LastUserUpdate', 'type': 'str'}, + 'notification_queue_enabled': {'key': 'NotificationQueueEnabled', 'type': 'str'}, + 'export_status': {'key': 'ExportStatus', 'type': 'str'}, + 'last_success_time': {'key': 'LastSuccessTime', 'type': 'str'}, + 'last_gap_time': {'key': 'LastGapTime', 'type': 'str'}, + 'permanent_error_reason': {'key': 'PermanentErrorReason', 'type': 'str'}, + 'storage_name': {'key': 'StorageName', 'type': 'str'}, + 'container_name': {'key': 'ContainerName', 'type': 'str'}, + } + + def __init__(self, *, record_types: str=None, notification_queue_enabled: str=None, **kwargs) -> None: + super(ApplicationInsightsComponentExportConfiguration, self).__init__(**kwargs) + self.export_id = None + self.instrumentation_key = None + self.record_types = record_types + self.application_name = None + self.subscription_id = None + self.resource_group = None + self.destination_storage_subscription_id = None + self.destination_storage_location_id = None + self.destination_account_id = None + self.destination_type = None + self.is_user_enabled = None + self.last_user_update = None + self.notification_queue_enabled = notification_queue_enabled + self.export_status = None + self.last_success_time = None + self.last_gap_time = None + self.permanent_error_reason = None + self.storage_name = None + self.container_name = None + + +class ApplicationInsightsComponentExportRequest(Model): + """An Application Insights component Continuous Export configuration request + definition. + + :param record_types: The document types to be exported, as comma separated + values. Allowed values include 'Requests', 'Event', 'Exceptions', + 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', + 'PerformanceCounters', 'Availability', 'Messages'. + :type record_types: str + :param destination_type: The Continuous Export destination type. This has + to be 'Blob'. + :type destination_type: str + :param destination_address: The SAS URL for the destination storage + container. It must grant write permission. + :type destination_address: str + :param is_enabled: Set to 'true' to create a Continuous Export + configuration as enabled, otherwise set it to 'false'. + :type is_enabled: str + :param notification_queue_enabled: Deprecated + :type notification_queue_enabled: str + :param notification_queue_uri: Deprecated + :type notification_queue_uri: str + :param destination_storage_subscription_id: The subscription ID of the + destination storage container. + :type destination_storage_subscription_id: str + :param destination_storage_location_id: The location ID of the destination + storage container. + :type destination_storage_location_id: str + :param destination_account_id: The name of destination storage account. + :type destination_account_id: str + """ + + _attribute_map = { + 'record_types': {'key': 'RecordTypes', 'type': 'str'}, + 'destination_type': {'key': 'DestinationType', 'type': 'str'}, + 'destination_address': {'key': 'DestinationAddress', 'type': 'str'}, + 'is_enabled': {'key': 'IsEnabled', 'type': 'str'}, + 'notification_queue_enabled': {'key': 'NotificationQueueEnabled', 'type': 'str'}, + 'notification_queue_uri': {'key': 'NotificationQueueUri', 'type': 'str'}, + 'destination_storage_subscription_id': {'key': 'DestinationStorageSubscriptionId', 'type': 'str'}, + 'destination_storage_location_id': {'key': 'DestinationStorageLocationId', 'type': 'str'}, + 'destination_account_id': {'key': 'DestinationAccountId', 'type': 'str'}, + } + + def __init__(self, *, record_types: str=None, destination_type: str=None, destination_address: str=None, is_enabled: str=None, notification_queue_enabled: str=None, notification_queue_uri: str=None, destination_storage_subscription_id: str=None, destination_storage_location_id: str=None, destination_account_id: str=None, **kwargs) -> None: + super(ApplicationInsightsComponentExportRequest, self).__init__(**kwargs) + self.record_types = record_types + self.destination_type = destination_type + self.destination_address = destination_address + self.is_enabled = is_enabled + self.notification_queue_enabled = notification_queue_enabled + self.notification_queue_uri = notification_queue_uri + self.destination_storage_subscription_id = destination_storage_subscription_id + self.destination_storage_location_id = destination_storage_location_id + self.destination_account_id = destination_account_id + + +class ApplicationInsightsComponentFavorite(Model): + """Properties that define a favorite that is associated to an Application + Insights component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name: The user-defined name of the favorite. + :type name: str + :param config: Configuration of this particular favorite, which are driven + by the Azure portal UX. Configuration data is a string containing valid + JSON + :type config: str + :param version: This instance's version of the data model. This can change + as new features are added that can be marked favorite. Current examples + include MetricsExplorer (ME) and Search. + :type version: str + :ivar favorite_id: Internally assigned unique id of the favorite + definition. + :vartype favorite_id: str + :param favorite_type: Enum indicating if this favorite definition is owned + by a specific user or is shared between all users with access to the + Application Insights component. Possible values include: 'shared', 'user' + :type favorite_type: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.FavoriteType + :param source_type: The source of the favorite definition. + :type source_type: str + :ivar time_modified: Date and time in UTC of the last modification that + was made to this favorite definition. + :vartype time_modified: str + :param tags: A list of 0 or more tags that are associated with this + favorite definition + :type tags: list[str] + :param category: Favorite category, as defined by the user at creation + time. + :type category: str + :param is_generated_from_template: Flag denoting wether or not this + favorite was generated from a template. + :type is_generated_from_template: bool + :ivar user_id: Unique user id of the specific user that owns this + favorite. + :vartype user_id: str + """ + + _validation = { + 'favorite_id': {'readonly': True}, + 'time_modified': {'readonly': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'config': {'key': 'Config', 'type': 'str'}, + 'version': {'key': 'Version', 'type': 'str'}, + 'favorite_id': {'key': 'FavoriteId', 'type': 'str'}, + 'favorite_type': {'key': 'FavoriteType', 'type': 'FavoriteType'}, + 'source_type': {'key': 'SourceType', 'type': 'str'}, + 'time_modified': {'key': 'TimeModified', 'type': 'str'}, + 'tags': {'key': 'Tags', 'type': '[str]'}, + 'category': {'key': 'Category', 'type': 'str'}, + 'is_generated_from_template': {'key': 'IsGeneratedFromTemplate', 'type': 'bool'}, + 'user_id': {'key': 'UserId', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, config: str=None, version: str=None, favorite_type=None, source_type: str=None, tags=None, category: str=None, is_generated_from_template: bool=None, **kwargs) -> None: + super(ApplicationInsightsComponentFavorite, self).__init__(**kwargs) + self.name = name + self.config = config + self.version = version + self.favorite_id = None + self.favorite_type = favorite_type + self.source_type = source_type + self.time_modified = None + self.tags = tags + self.category = category + self.is_generated_from_template = is_generated_from_template + self.user_id = None + + +class ApplicationInsightsComponentFeature(Model): + """An Application Insights component daily data volume cap status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar feature_name: The pricing feature name. + :vartype feature_name: str + :ivar meter_id: The meter id used for the feature. + :vartype meter_id: str + :ivar meter_rate_frequency: The meter rate for the feature's meter. + :vartype meter_rate_frequency: str + :ivar resouce_id: Reserved, not used now. + :vartype resouce_id: str + :ivar is_hidden: Reserved, not used now. + :vartype is_hidden: bool + :ivar capabilities: A list of Application Insights component feature + capability. + :vartype capabilities: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFeatureCapability] + :ivar title: Display name of the feature. + :vartype title: str + :ivar is_main_feature: Whether can apply addon feature on to it. + :vartype is_main_feature: bool + :ivar supported_addon_features: The add on features on main feature. + :vartype supported_addon_features: str + """ + + _validation = { + 'feature_name': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_rate_frequency': {'readonly': True}, + 'resouce_id': {'readonly': True}, + 'is_hidden': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'title': {'readonly': True}, + 'is_main_feature': {'readonly': True}, + 'supported_addon_features': {'readonly': True}, + } + + _attribute_map = { + 'feature_name': {'key': 'FeatureName', 'type': 'str'}, + 'meter_id': {'key': 'MeterId', 'type': 'str'}, + 'meter_rate_frequency': {'key': 'MeterRateFrequency', 'type': 'str'}, + 'resouce_id': {'key': 'ResouceId', 'type': 'str'}, + 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, + 'capabilities': {'key': 'Capabilities', 'type': '[ApplicationInsightsComponentFeatureCapability]'}, + 'title': {'key': 'Title', 'type': 'str'}, + 'is_main_feature': {'key': 'IsMainFeature', 'type': 'bool'}, + 'supported_addon_features': {'key': 'SupportedAddonFeatures', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentFeature, self).__init__(**kwargs) + self.feature_name = None + self.meter_id = None + self.meter_rate_frequency = None + self.resouce_id = None + self.is_hidden = None + self.capabilities = None + self.title = None + self.is_main_feature = None + self.supported_addon_features = None + + +class ApplicationInsightsComponentFeatureCapabilities(Model): + """An Application Insights component feature capabilities. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar support_export_data: Whether allow to use continuous export feature. + :vartype support_export_data: bool + :ivar burst_throttle_policy: Reserved, not used now. + :vartype burst_throttle_policy: str + :ivar metadata_class: Reserved, not used now. + :vartype metadata_class: str + :ivar live_stream_metrics: Reserved, not used now. + :vartype live_stream_metrics: bool + :ivar application_map: Reserved, not used now. + :vartype application_map: bool + :ivar work_item_integration: Whether allow to use work item integration + feature. + :vartype work_item_integration: bool + :ivar power_bi_integration: Reserved, not used now. + :vartype power_bi_integration: bool + :ivar open_schema: Reserved, not used now. + :vartype open_schema: bool + :ivar proactive_detection: Reserved, not used now. + :vartype proactive_detection: bool + :ivar analytics_integration: Reserved, not used now. + :vartype analytics_integration: bool + :ivar multiple_step_web_test: Whether allow to use multiple steps web test + feature. + :vartype multiple_step_web_test: bool + :ivar api_access_level: Reserved, not used now. + :vartype api_access_level: str + :ivar tracking_type: The application insights component used tracking + type. + :vartype tracking_type: str + :ivar daily_cap: Daily data volume cap in GB. + :vartype daily_cap: float + :ivar daily_cap_reset_time: Daily data volume cap UTC reset hour. + :vartype daily_cap_reset_time: float + :ivar throttle_rate: Reserved, not used now. + :vartype throttle_rate: float + """ + + _validation = { + 'support_export_data': {'readonly': True}, + 'burst_throttle_policy': {'readonly': True}, + 'metadata_class': {'readonly': True}, + 'live_stream_metrics': {'readonly': True}, + 'application_map': {'readonly': True}, + 'work_item_integration': {'readonly': True}, + 'power_bi_integration': {'readonly': True}, + 'open_schema': {'readonly': True}, + 'proactive_detection': {'readonly': True}, + 'analytics_integration': {'readonly': True}, + 'multiple_step_web_test': {'readonly': True}, + 'api_access_level': {'readonly': True}, + 'tracking_type': {'readonly': True}, + 'daily_cap': {'readonly': True}, + 'daily_cap_reset_time': {'readonly': True}, + 'throttle_rate': {'readonly': True}, + } + + _attribute_map = { + 'support_export_data': {'key': 'SupportExportData', 'type': 'bool'}, + 'burst_throttle_policy': {'key': 'BurstThrottlePolicy', 'type': 'str'}, + 'metadata_class': {'key': 'MetadataClass', 'type': 'str'}, + 'live_stream_metrics': {'key': 'LiveStreamMetrics', 'type': 'bool'}, + 'application_map': {'key': 'ApplicationMap', 'type': 'bool'}, + 'work_item_integration': {'key': 'WorkItemIntegration', 'type': 'bool'}, + 'power_bi_integration': {'key': 'PowerBIIntegration', 'type': 'bool'}, + 'open_schema': {'key': 'OpenSchema', 'type': 'bool'}, + 'proactive_detection': {'key': 'ProactiveDetection', 'type': 'bool'}, + 'analytics_integration': {'key': 'AnalyticsIntegration', 'type': 'bool'}, + 'multiple_step_web_test': {'key': 'MultipleStepWebTest', 'type': 'bool'}, + 'api_access_level': {'key': 'ApiAccessLevel', 'type': 'str'}, + 'tracking_type': {'key': 'TrackingType', 'type': 'str'}, + 'daily_cap': {'key': 'DailyCap', 'type': 'float'}, + 'daily_cap_reset_time': {'key': 'DailyCapResetTime', 'type': 'float'}, + 'throttle_rate': {'key': 'ThrottleRate', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentFeatureCapabilities, self).__init__(**kwargs) + self.support_export_data = None + self.burst_throttle_policy = None + self.metadata_class = None + self.live_stream_metrics = None + self.application_map = None + self.work_item_integration = None + self.power_bi_integration = None + self.open_schema = None + self.proactive_detection = None + self.analytics_integration = None + self.multiple_step_web_test = None + self.api_access_level = None + self.tracking_type = None + self.daily_cap = None + self.daily_cap_reset_time = None + self.throttle_rate = None + + +class ApplicationInsightsComponentFeatureCapability(Model): + """An Application Insights component feature capability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the capability. + :vartype name: str + :ivar description: The description of the capability. + :vartype description: str + :ivar value: The value of the capability. + :vartype value: str + :ivar unit: The unit of the capability. + :vartype unit: str + :ivar meter_id: The meter used for the capability. + :vartype meter_id: str + :ivar meter_rate_frequency: The meter rate of the meter. + :vartype meter_rate_frequency: str + """ + + _validation = { + 'name': {'readonly': True}, + 'description': {'readonly': True}, + 'value': {'readonly': True}, + 'unit': {'readonly': True}, + 'meter_id': {'readonly': True}, + 'meter_rate_frequency': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'description': {'key': 'Description', 'type': 'str'}, + 'value': {'key': 'Value', 'type': 'str'}, + 'unit': {'key': 'Unit', 'type': 'str'}, + 'meter_id': {'key': 'MeterId', 'type': 'str'}, + 'meter_rate_frequency': {'key': 'MeterRateFrequency', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentFeatureCapability, self).__init__(**kwargs) + self.name = None + self.description = None + self.value = None + self.unit = None + self.meter_id = None + self.meter_rate_frequency = None + + +class ApplicationInsightsComponentProactiveDetectionConfiguration(Model): + """Properties that define a ProactiveDetection configuration. + + :param name: The rule name + :type name: str + :param enabled: A flag that indicates whether this rule is enabled by the + user + :type enabled: bool + :param send_emails_to_subscription_owners: A flag that indicated whether + notifications on this rule should be sent to subscription owners + :type send_emails_to_subscription_owners: bool + :param custom_emails: Custom email addresses for this rule notifications + :type custom_emails: list[str] + :param last_updated_time: The last time this rule was updated + :type last_updated_time: str + :param rule_definitions: Static definitions of the ProactiveDetection + configuration rule (same values for all components). + :type rule_definitions: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'enabled': {'key': 'Enabled', 'type': 'bool'}, + 'send_emails_to_subscription_owners': {'key': 'SendEmailsToSubscriptionOwners', 'type': 'bool'}, + 'custom_emails': {'key': 'CustomEmails', 'type': '[str]'}, + 'last_updated_time': {'key': 'LastUpdatedTime', 'type': 'str'}, + 'rule_definitions': {'key': 'RuleDefinitions', 'type': 'ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions'}, + } + + def __init__(self, *, name: str=None, enabled: bool=None, send_emails_to_subscription_owners: bool=None, custom_emails=None, last_updated_time: str=None, rule_definitions=None, **kwargs) -> None: + super(ApplicationInsightsComponentProactiveDetectionConfiguration, self).__init__(**kwargs) + self.name = name + self.enabled = enabled + self.send_emails_to_subscription_owners = send_emails_to_subscription_owners + self.custom_emails = custom_emails + self.last_updated_time = last_updated_time + self.rule_definitions = rule_definitions + + +class ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions(Model): + """Static definitions of the ProactiveDetection configuration rule (same + values for all components). + + :param name: The rule name + :type name: str + :param display_name: The rule name as it is displayed in UI + :type display_name: str + :param description: The rule description + :type description: str + :param help_url: URL which displays additional info about the proactive + detection rule + :type help_url: str + :param is_hidden: A flag indicating whether the rule is hidden (from the + UI) + :type is_hidden: bool + :param is_enabled_by_default: A flag indicating whether the rule is + enabled by default + :type is_enabled_by_default: bool + :param is_in_preview: A flag indicating whether the rule is in preview + :type is_in_preview: bool + :param supports_email_notifications: A flag indicating whether email + notifications are supported for detections for this rule + :type supports_email_notifications: bool + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'display_name': {'key': 'DisplayName', 'type': 'str'}, + 'description': {'key': 'Description', 'type': 'str'}, + 'help_url': {'key': 'HelpUrl', 'type': 'str'}, + 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, + 'is_enabled_by_default': {'key': 'IsEnabledByDefault', 'type': 'bool'}, + 'is_in_preview': {'key': 'IsInPreview', 'type': 'bool'}, + 'supports_email_notifications': {'key': 'SupportsEmailNotifications', 'type': 'bool'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, description: str=None, help_url: str=None, is_hidden: bool=None, is_enabled_by_default: bool=None, is_in_preview: bool=None, supports_email_notifications: bool=None, **kwargs) -> None: + super(ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.description = description + self.help_url = help_url + self.is_hidden = is_hidden + self.is_enabled_by_default = is_enabled_by_default + self.is_in_preview = is_in_preview + self.supports_email_notifications = supports_email_notifications + + +class ApplicationInsightsComponentQuotaStatus(Model): + """An Application Insights component daily data volume cap status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar app_id: The Application ID for the Application Insights component. + :vartype app_id: str + :ivar should_be_throttled: The daily data volume cap is met, and data + ingestion will be stopped. + :vartype should_be_throttled: bool + :ivar expiration_time: Date and time when the daily data volume cap will + be reset, and data ingestion will resume. + :vartype expiration_time: str + """ + + _validation = { + 'app_id': {'readonly': True}, + 'should_be_throttled': {'readonly': True}, + 'expiration_time': {'readonly': True}, + } + + _attribute_map = { + 'app_id': {'key': 'AppId', 'type': 'str'}, + 'should_be_throttled': {'key': 'ShouldBeThrottled', 'type': 'bool'}, + 'expiration_time': {'key': 'ExpirationTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentQuotaStatus, self).__init__(**kwargs) + self.app_id = None + self.should_be_throttled = None + self.expiration_time = None + + +class ApplicationInsightsComponentWebTestLocation(Model): + """Properties that define a web test location available to an Application + Insights Component. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar display_name: The display name of the web test location. + :vartype display_name: str + :ivar tag: Internally defined geographic location tag. + :vartype tag: str + """ + + _validation = { + 'display_name': {'readonly': True}, + 'tag': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'DisplayName', 'type': 'str'}, + 'tag': {'key': 'Tag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsComponentWebTestLocation, self).__init__(**kwargs) + self.display_name = None + self.tag = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ComponentPurgeBody(Model): + """Describes the body of a purge request for an App Insights component. + + All required parameters must be populated in order to send to Azure. + + :param table: Required. Table from which to purge data. + :type table: str + :param filters: Required. The set of columns and filters (queries) to run + over them to purge the resulting data. + :type filters: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ComponentPurgeBodyFilters] + """ + + _validation = { + 'table': {'required': True}, + 'filters': {'required': True}, + } + + _attribute_map = { + 'table': {'key': 'table', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': '[ComponentPurgeBodyFilters]'}, + } + + def __init__(self, *, table: str, filters, **kwargs) -> None: + super(ComponentPurgeBody, self).__init__(**kwargs) + self.table = table + self.filters = filters + + +class ComponentPurgeBodyFilters(Model): + """User-defined filters to return data which will be purged from the table. + + :param column: The column of the table over which the given query should + run + :type column: str + :param operator: A query operator to evaluate over the provided column and + value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, + and have the same behavior as they would in a KQL query. + :type operator: str + :param value: the value for the operator to function over. This can be a + number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of + values. + :type value: object + :param key: When filtering over custom dimensions, this key will be used + as the name of the custom dimension. + :type key: str + """ + + _attribute_map = { + 'column': {'key': 'column', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__(self, *, column: str=None, operator: str=None, value=None, key: str=None, **kwargs) -> None: + super(ComponentPurgeBodyFilters, self).__init__(**kwargs) + self.column = column + self.operator = operator + self.value = value + self.key = key + + +class ComponentPurgeResponse(Model): + """Response containing operationId for a specific purge action. + + All required parameters must be populated in order to send to Azure. + + :param operation_id: Required. Id to use when querying for status for a + particular purge operation. + :type operation_id: str + """ + + _validation = { + 'operation_id': {'required': True}, + } + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + } + + def __init__(self, *, operation_id: str, **kwargs) -> None: + super(ComponentPurgeResponse, self).__init__(**kwargs) + self.operation_id = operation_id + + +class ComponentPurgeStatusResponse(Model): + """Response containing status for a specific purge operation. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Status of the operation represented by the + requested Id. Possible values include: 'pending', 'completed' + :type status: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.PurgeState + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, status, **kwargs) -> None: + super(ComponentPurgeStatusResponse, self).__init__(**kwargs) + self.status = status + + +class ErrorFieldContract(Model): + """Error Field contract. + + :param code: Property level error code. + :type code: str + :param message: Human-readable representation of property-level error. + :type message: str + :param target: Property name. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, **kwargs) -> None: + super(ErrorFieldContract, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + + +class ErrorResponse(Model): + """Error response indicates Insights service is not able to process the + incoming request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :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(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class InnerError(Model): + """Inner error. + + :param diagnosticcontext: Provides correlation for request + :type diagnosticcontext: str + :param time: Request time + :type time: datetime + """ + + _attribute_map = { + 'diagnosticcontext': {'key': 'diagnosticcontext', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + } + + def __init__(self, *, diagnosticcontext: str=None, time=None, **kwargs) -> None: + super(InnerError, self).__init__(**kwargs) + self.diagnosticcontext = diagnosticcontext + self.time = time + + +class LinkProperties(Model): + """Contains a sourceId and workbook resource id to link two resources. + + :param source_id: The source Azure resource id + :type source_id: str + :param target_id: The workbook Azure resource id + :type target_id: str + :param category: The category of workbook + :type category: str + """ + + _attribute_map = { + 'source_id': {'key': 'sourceId', 'type': 'str'}, + 'target_id': {'key': 'targetId', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + } + + def __init__(self, *, source_id: str=None, target_id: str=None, category: str=None, **kwargs) -> None: + super(LinkProperties, self).__init__(**kwargs) + self.source_id = source_id + self.target_id = target_id + self.category = category + + +class Operation(Model): + """CDN REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: + ~azure.mgmt.applicationinsights.v2015_05_01.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): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Cdn + :type provider: str + :param resource: Resource on which the operation is performed: Profile, + endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, 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 PrivateLinkScopedResource(Model): + """The private link scope resource reference. + + :param resource_id: The full resource Id of the private link scope + resource. + :type resource_id: str + :param scope_id: The private link scope unique Identifier. + :type scope_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'ResourceId', 'type': 'str'}, + 'scope_id': {'key': 'ScopeId', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str=None, scope_id: str=None, **kwargs) -> None: + super(PrivateLinkScopedResource, self).__init__(**kwargs) + self.resource_id = resource_id + self.scope_id = scope_id + + +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a WebTest instance. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsResource, self).__init__(**kwargs) + self.tags = tags + + +class WebtestsResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(WebtestsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class WebTest(WebtestsResource): + """An Application Insights web test definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: The kind of web test that this web test watches. Choices are + ping and multistep. Possible values include: 'ping', 'multistep'. Default + value: "ping" . + :type kind: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestKind + :param synthetic_monitor_id: Required. Unique ID of this WebTest. This is + typically the same value as the Name field. + :type synthetic_monitor_id: str + :param web_test_name: Required. User defined name if this WebTest. + :type web_test_name: str + :param description: Purpose/user defined descriptive test for this + WebTest. + :type description: str + :param enabled: Is the test actively being monitored. + :type enabled: bool + :param frequency: Interval in seconds between test runs for this WebTest. + Default value is 300. Default value: 300 . + :type frequency: int + :param timeout: Seconds until this WebTest will timeout and fail. Default + value is 30. Default value: 30 . + :type timeout: int + :param web_test_kind: Required. The kind of web test this is, valid + choices are ping and multistep. Possible values include: 'ping', + 'multistep'. Default value: "ping" . + :type web_test_kind: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestKind + :param retry_enabled: Allow for retries should this WebTest fail. + :type retry_enabled: bool + :param locations: Required. A list of where to physically run the tests + from to give global coverage for accessibility of your application. + :type locations: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestGeolocation] + :param configuration: An XML configuration specification for a WebTest. + :type configuration: + ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestPropertiesConfiguration + :ivar provisioning_state: Current state of this component, whether or not + is has been provisioned within the resource group it is defined. Users + cannot change this value but are able to read from it. Values will include + Succeeded, Deploying, Canceled, and Failed. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'synthetic_monitor_id': {'required': True}, + 'web_test_name': {'required': True}, + 'web_test_kind': {'required': True}, + 'locations': {'required': True}, + 'provisioning_state': {'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}'}, + 'kind': {'key': 'kind', 'type': 'WebTestKind'}, + 'synthetic_monitor_id': {'key': 'properties.SyntheticMonitorId', 'type': 'str'}, + 'web_test_name': {'key': 'properties.Name', 'type': 'str'}, + 'description': {'key': 'properties.Description', 'type': 'str'}, + 'enabled': {'key': 'properties.Enabled', 'type': 'bool'}, + 'frequency': {'key': 'properties.Frequency', 'type': 'int'}, + 'timeout': {'key': 'properties.Timeout', 'type': 'int'}, + 'web_test_kind': {'key': 'properties.Kind', 'type': 'WebTestKind'}, + 'retry_enabled': {'key': 'properties.RetryEnabled', 'type': 'bool'}, + 'locations': {'key': 'properties.Locations', 'type': '[WebTestGeolocation]'}, + 'configuration': {'key': 'properties.Configuration', 'type': 'WebTestPropertiesConfiguration'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, synthetic_monitor_id: str, web_test_name: str, locations, tags=None, kind="ping", description: str=None, enabled: bool=None, frequency: int=300, timeout: int=30, web_test_kind="ping", retry_enabled: bool=None, configuration=None, **kwargs) -> None: + super(WebTest, self).__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.synthetic_monitor_id = synthetic_monitor_id + self.web_test_name = web_test_name + self.description = description + self.enabled = enabled + self.frequency = frequency + self.timeout = timeout + self.web_test_kind = web_test_kind + self.retry_enabled = retry_enabled + self.locations = locations + self.configuration = configuration + self.provisioning_state = None + + +class WebTestGeolocation(Model): + """Geo-physical location to run a web test from. You must specify one or more + locations for the test to run from. + + :param location: Location ID for the webtest to run from. + :type location: str + """ + + _attribute_map = { + 'location': {'key': 'Id', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, **kwargs) -> None: + super(WebTestGeolocation, self).__init__(**kwargs) + self.location = location + + +class WebTestPropertiesConfiguration(Model): + """An XML configuration specification for a WebTest. + + :param web_test: The XML specification of a WebTest to run against an + application. + :type web_test: str + """ + + _attribute_map = { + 'web_test': {'key': 'WebTest', 'type': 'str'}, + } + + def __init__(self, *, web_test: str=None, **kwargs) -> None: + super(WebTestPropertiesConfiguration, self).__init__(**kwargs) + self.web_test = web_test + + +class WorkbookResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _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}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(WorkbookResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class Workbook(WorkbookResource): + """An Application Insights workbook definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: The kind of workbook. Choices are user and shared. Possible + values include: 'user', 'shared' + :type kind: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.SharedTypeKind + :param workbook_name: Required. The user-defined name of the workbook. + :type workbook_name: str + :param serialized_data: Required. Configuration of this particular + workbook. Configuration data is a string containing valid JSON + :type serialized_data: str + :param version: This instance's version of the data model. This can change + as new features are added that can be marked workbook. + :type version: str + :param workbook_id: Required. Internally assigned unique id of the + workbook definition. + :type workbook_id: str + :param shared_type_kind: Required. Enum indicating if this workbook + definition is owned by a specific user or is shared between all users with + access to the Application Insights component. Possible values include: + 'user', 'shared'. Default value: "shared" . + :type shared_type_kind: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.SharedTypeKind + :ivar time_modified: Date and time in UTC of the last modification that + was made to this workbook definition. + :vartype time_modified: str + :param category: Required. Workbook category, as defined by the user at + creation time. + :type category: str + :param workbook_tags: A list of 0 or more tags that are associated with + this workbook definition + :type workbook_tags: list[str] + :param user_id: Required. Unique user id of the specific user that owns + this workbook. + :type user_id: str + :param source_resource_id: Optional resourceId for a source resource. + :type source_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'workbook_name': {'required': True}, + 'serialized_data': {'required': True}, + 'workbook_id': {'required': True}, + 'shared_type_kind': {'required': True}, + 'time_modified': {'readonly': True}, + 'category': {'required': True}, + 'user_id': {'required': 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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'workbook_name': {'key': 'properties.name', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'workbook_id': {'key': 'properties.workbookId', 'type': 'str'}, + 'shared_type_kind': {'key': 'properties.kind', 'type': 'str'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'workbook_tags': {'key': 'properties.tags', 'type': '[str]'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'source_resource_id': {'key': 'properties.sourceResourceId', 'type': 'str'}, + } + + def __init__(self, *, workbook_name: str, serialized_data: str, workbook_id: str, category: str, user_id: str, location: str=None, tags=None, kind=None, version: str=None, shared_type_kind="shared", workbook_tags=None, source_resource_id: str=None, **kwargs) -> None: + super(Workbook, self).__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.workbook_name = workbook_name + self.serialized_data = serialized_data + self.version = version + self.workbook_id = workbook_id + self.shared_type_kind = shared_type_kind + self.time_modified = None + self.category = category + self.workbook_tags = workbook_tags + self.user_id = user_id + self.source_resource_id = source_resource_id + + +class WorkbookError(Model): + """Error message body that will indicate why the operation failed. + + :param code: Service-defined error code. This code serves as a sub-status + for the HTTP error code specified in the response. + :type code: str + :param message: Human-readable representation of the error. + :type message: str + :param details: The list of invalid fields send in request, in case of + validation error. + :type details: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + } + + def __init__(self, *, code: str=None, message: str=None, details=None, **kwargs) -> None: + super(WorkbookError, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class WorkbookErrorException(HttpOperationError): + """Server responsed with exception of type: 'WorkbookError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(WorkbookErrorException, self).__init__(deserialize, response, 'WorkbookError', *args) + + +class WorkItemConfiguration(Model): + """Work item configuration associated with an application insights resource. + + :param connector_id: Connector identifier where work item is created + :type connector_id: str + :param config_display_name: Configuration friendly name + :type config_display_name: str + :param is_default: Boolean value indicating whether configuration is + default + :type is_default: bool + :param id: Unique Id for work item + :type id: str + :param config_properties: Serialized JSON object for detailed properties + :type config_properties: str + """ + + _attribute_map = { + 'connector_id': {'key': 'ConnectorId', 'type': 'str'}, + 'config_display_name': {'key': 'ConfigDisplayName', 'type': 'str'}, + 'is_default': {'key': 'IsDefault', 'type': 'bool'}, + 'id': {'key': 'Id', 'type': 'str'}, + 'config_properties': {'key': 'ConfigProperties', 'type': 'str'}, + } + + def __init__(self, *, connector_id: str=None, config_display_name: str=None, is_default: bool=None, id: str=None, config_properties: str=None, **kwargs) -> None: + super(WorkItemConfiguration, self).__init__(**kwargs) + self.connector_id = connector_id + self.config_display_name = config_display_name + self.is_default = is_default + self.id = id + self.config_properties = config_properties + + +class WorkItemConfigurationError(Model): + """Error associated with trying to get work item configuration or + configurations. + + :param code: Error detail code and explanation + :type code: str + :param message: Error message + :type message: str + :param innererror: + :type innererror: + ~azure.mgmt.applicationinsights.v2015_05_01.models.InnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'InnerError'}, + } + + def __init__(self, *, code: str=None, message: str=None, innererror=None, **kwargs) -> None: + super(WorkItemConfigurationError, self).__init__(**kwargs) + self.code = code + self.message = message + self.innererror = innererror + + +class WorkItemConfigurationErrorException(HttpOperationError): + """Server responsed with exception of type: 'WorkItemConfigurationError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(WorkItemConfigurationErrorException, self).__init__(deserialize, response, 'WorkItemConfigurationError', *args) + + +class WorkItemCreateConfiguration(Model): + """Work item configuration creation payload. + + :param connector_id: Unique connector id + :type connector_id: str + :param connector_data_configuration: Serialized JSON object for detailed + properties + :type connector_data_configuration: str + :param validate_only: Boolean indicating validate only + :type validate_only: bool + :param work_item_properties: Custom work item properties + :type work_item_properties: dict[str, str] + """ + + _attribute_map = { + 'connector_id': {'key': 'ConnectorId', 'type': 'str'}, + 'connector_data_configuration': {'key': 'ConnectorDataConfiguration', 'type': 'str'}, + 'validate_only': {'key': 'ValidateOnly', 'type': 'bool'}, + 'work_item_properties': {'key': 'WorkItemProperties', 'type': '{str}'}, + } + + def __init__(self, *, connector_id: str=None, connector_data_configuration: str=None, validate_only: bool=None, work_item_properties=None, **kwargs) -> None: + super(WorkItemCreateConfiguration, self).__init__(**kwargs) + self.connector_id = connector_id + self.connector_data_configuration = connector_data_configuration + self.validate_only = validate_only + self.work_item_properties = work_item_properties diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_paged_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_paged_models.py new file mode 100644 index 00000000000..17a42d8050f --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_paged_models.py @@ -0,0 +1,118 @@ +# 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) +class AnnotationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Annotation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Annotation]'} + } + + def __init__(self, *args, **kwargs): + + super(AnnotationPaged, self).__init__(*args, **kwargs) +class ApplicationInsightsComponentAPIKeyPaged(Paged): + """ + A paging container for iterating over a list of :class:`ApplicationInsightsComponentAPIKey ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApplicationInsightsComponentAPIKey]'} + } + + def __init__(self, *args, **kwargs): + + super(ApplicationInsightsComponentAPIKeyPaged, self).__init__(*args, **kwargs) +class ApplicationInsightsComponentPaged(Paged): + """ + A paging container for iterating over a list of :class:`ApplicationInsightsComponent ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApplicationInsightsComponent]'} + } + + def __init__(self, *args, **kwargs): + + super(ApplicationInsightsComponentPaged, self).__init__(*args, **kwargs) +class WorkItemConfigurationPaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkItemConfiguration ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkItemConfiguration]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkItemConfigurationPaged, self).__init__(*args, **kwargs) +class ApplicationInsightsComponentWebTestLocationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ApplicationInsightsComponentWebTestLocation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApplicationInsightsComponentWebTestLocation]'} + } + + def __init__(self, *args, **kwargs): + + super(ApplicationInsightsComponentWebTestLocationPaged, self).__init__(*args, **kwargs) +class WebTestPaged(Paged): + """ + A paging container for iterating over a list of :class:`WebTest ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WebTest]'} + } + + def __init__(self, *args, **kwargs): + + super(WebTestPaged, self).__init__(*args, **kwargs) +class WorkbookPaged(Paged): + """ + A paging container for iterating over a list of :class:`Workbook ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Workbook]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkbookPaged, self).__init__(*args, **kwargs) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/__init__.py new file mode 100644 index 00000000000..3bd2ec335a0 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/__init__.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._annotations_operations import AnnotationsOperations +from ._api_keys_operations import APIKeysOperations +from ._export_configurations_operations import ExportConfigurationsOperations +from ._component_current_billing_features_operations import ComponentCurrentBillingFeaturesOperations +from ._component_quota_status_operations import ComponentQuotaStatusOperations +from ._component_feature_capabilities_operations import ComponentFeatureCapabilitiesOperations +from ._component_available_features_operations import ComponentAvailableFeaturesOperations +from ._proactive_detection_configurations_operations import ProactiveDetectionConfigurationsOperations +from ._components_operations import ComponentsOperations +from ._work_item_configurations_operations import WorkItemConfigurationsOperations +from ._favorites_operations import FavoritesOperations +from ._web_test_locations_operations import WebTestLocationsOperations +from ._web_tests_operations import WebTestsOperations +from ._analytics_items_operations import AnalyticsItemsOperations +from ._workbooks_operations import WorkbooksOperations + +__all__ = [ + 'Operations', + 'AnnotationsOperations', + 'APIKeysOperations', + 'ExportConfigurationsOperations', + 'ComponentCurrentBillingFeaturesOperations', + 'ComponentQuotaStatusOperations', + 'ComponentFeatureCapabilitiesOperations', + 'ComponentAvailableFeaturesOperations', + 'ProactiveDetectionConfigurationsOperations', + 'ComponentsOperations', + 'WorkItemConfigurationsOperations', + 'FavoritesOperations', + 'WebTestLocationsOperations', + 'WebTestsOperations', + 'AnalyticsItemsOperations', + 'WorkbooksOperations', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_analytics_items_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_analytics_items_operations.py new file mode 100644 index 00000000000..09a10624fd5 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_analytics_items_operations.py @@ -0,0 +1,374 @@ +# 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 AnalyticsItemsOperations(object): + """AnalyticsItemsOperations 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: The API version to use for this operation. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def list( + self, resource_group_name, resource_name, scope_path, scope="shared", type="none", include_content=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of Analytics Items defined within an Application Insights + component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param scope_path: Enum indicating if this item definition is owned by + a specific user or is shared between all users with access to the + Application Insights component. Possible values include: + 'analyticsItems', 'myanalyticsItems' + :type scope_path: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemScopePath + :param scope: Enum indicating if this item definition is owned by a + specific user or is shared between all users with access to the + Application Insights component. Possible values include: 'shared', + 'user' + :type scope: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemScope + :param type: Enum indicating the type of the Analytics item. Possible + values include: 'none', 'query', 'function', 'folder', 'recent' + :type type: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemTypeParameter + :param include_content: Flag indicating whether or not to return the + content of each applicable item. If false, only return the item + information. + :type include_content: bool + :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: list or ClientRawResponse if raw=true + :rtype: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAnalyticsItem] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scopePath': self._serialize.url("scope_path", scope_path, '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', min_length=1) + if scope is not None: + query_parameters['scope'] = self._serialize.query("scope", scope, 'str') + if type is not None: + query_parameters['type'] = self._serialize.query("type", type, 'str') + if include_content is not None: + query_parameters['includeContent'] = self._serialize.query("include_content", include_content, 'bool') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[ApplicationInsightsComponentAnalyticsItem]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}'} + + def get( + self, resource_group_name, resource_name, scope_path, id=None, name=None, custom_headers=None, raw=False, **operation_config): + """Gets a specific Analytics Items defined within an Application Insights + component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param scope_path: Enum indicating if this item definition is owned by + a specific user or is shared between all users with access to the + Application Insights component. Possible values include: + 'analyticsItems', 'myanalyticsItems' + :type scope_path: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemScopePath + :param id: The Id of a specific item defined in the Application + Insights component + :type id: str + :param name: The name of a specific item defined in the Application + Insights component + :type 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: ApplicationInsightsComponentAnalyticsItem or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAnalyticsItem + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scopePath': self._serialize.url("scope_path", scope_path, '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', min_length=1) + if id is not None: + query_parameters['id'] = self._serialize.query("id", id, 'str') + if name is not None: + query_parameters['name'] = self._serialize.query("name", name, '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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentAnalyticsItem', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item'} + + def put( + self, resource_group_name, resource_name, scope_path, item_properties, override_item=None, custom_headers=None, raw=False, **operation_config): + """Adds or Updates a specific Analytics Item within an Application + Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param scope_path: Enum indicating if this item definition is owned by + a specific user or is shared between all users with access to the + Application Insights component. Possible values include: + 'analyticsItems', 'myanalyticsItems' + :type scope_path: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemScopePath + :param item_properties: Properties that need to be specified to create + a new item and add it to an Application Insights component. + :type item_properties: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAnalyticsItem + :param override_item: Flag indicating whether or not to force save an + item. This allows overriding an item if it already exists. + :type override_item: bool + :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: ApplicationInsightsComponentAnalyticsItem or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAnalyticsItem + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.put.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scopePath': self._serialize.url("scope_path", scope_path, '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', min_length=1) + if override_item is not None: + query_parameters['overrideItem'] = self._serialize.query("override_item", override_item, 'bool') + + # 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(item_properties, 'ApplicationInsightsComponentAnalyticsItem') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentAnalyticsItem', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item'} + + def delete( + self, resource_group_name, resource_name, scope_path, id=None, name=None, custom_headers=None, raw=False, **operation_config): + """Deletes a specific Analytics Items defined within an Application + Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param scope_path: Enum indicating if this item definition is owned by + a specific user or is shared between all users with access to the + Application Insights component. Possible values include: + 'analyticsItems', 'myanalyticsItems' + :type scope_path: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemScopePath + :param id: The Id of a specific item defined in the Application + Insights component + :type id: str + :param name: The name of a specific item defined in the Application + Insights component + :type 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:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'scopePath': self._serialize.url("scope_path", scope_path, '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', min_length=1) + if id is not None: + query_parameters['id'] = self._serialize.query("id", id, 'str') + if name is not None: + query_parameters['name'] = self._serialize.query("name", name, '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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_annotations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_annotations_operations.py new file mode 100644 index 00000000000..ee2ab6c29dc --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_annotations_operations.py @@ -0,0 +1,317 @@ +# 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 AnnotationsOperations(object): + """AnnotationsOperations 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: The API version to use for this operation. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def list( + self, resource_group_name, resource_name, start, end, custom_headers=None, raw=False, **operation_config): + """Gets the list of annotations for a component for given time range. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param start: The start time to query from for annotations, cannot be + older than 90 days from current date. + :type start: str + :param end: The end time to query for annotations. + :type end: 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: An iterator like instance of Annotation + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.AnnotationPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.Annotation] + :raises: + :class:`AnnotationErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + query_parameters['start'] = self._serialize.query("start", start, 'str') + query_parameters['end'] = self._serialize.query("end", end, '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]: + raise models.AnnotationErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AnnotationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations'} + + def create( + self, resource_group_name, resource_name, annotation_properties, custom_headers=None, raw=False, **operation_config): + """Create an Annotation of an Application Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param annotation_properties: Properties that need to be specified to + create an annotation of a Application Insights component. + :type annotation_properties: + ~azure.mgmt.applicationinsights.v2015_05_01.models.Annotation + :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: list or ClientRawResponse if raw=true + :rtype: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.Annotation] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`AnnotationErrorException` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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(annotation_properties, 'Annotation') + + # 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.AnnotationErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[Annotation]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations'} + + def delete( + self, resource_group_name, resource_name, annotation_id, custom_headers=None, raw=False, **operation_config): + """Delete an Annotation of an Application Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param annotation_id: The unique annotation ID. This is unique within + a Application Insights component. + :type annotation_id: 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:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'annotationId': self._serialize.url("annotation_id", annotation_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}'} + + def get( + self, resource_group_name, resource_name, annotation_id, custom_headers=None, raw=False, **operation_config): + """Get the annotation for given id. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param annotation_id: The unique annotation ID. This is unique within + a Application Insights component. + :type annotation_id: 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: list or ClientRawResponse if raw=true + :rtype: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.Annotation] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`AnnotationErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'annotationId': self._serialize.url("annotation_id", annotation_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', min_length=1) + + # 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.AnnotationErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[Annotation]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/api_keys_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_api_keys_operations.py similarity index 74% rename from src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/api_keys_operations.py rename to src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_api_keys_operations.py index a80e2eddf56..1ba480c3cde 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/api_keys_operations.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_api_keys_operations.py @@ -19,11 +19,13 @@ class APIKeysOperations(object): """APIKeysOperations 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 objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -41,7 +43,8 @@ def list( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): """Gets a list of API keys of an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -54,24 +57,23 @@ def list( :return: An iterator like instance of ApplicationInsightsComponentAPIKey :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentAPIKeyPaged[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentAPIKey] + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAPIKeyPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAPIKey] :raises: :class:`CloudError` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys' + url = self.list.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -79,7 +81,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -88,9 +90,13 @@ def internal_paging(next_link=None, raw=False): 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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) @@ -100,20 +106,20 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.ApplicationInsightsComponentAPIKeyPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.ApplicationInsightsComponentAPIKeyPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.ApplicationInsightsComponentAPIKeyPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys'} def create( self, resource_group_name, resource_name, api_key_properties, custom_headers=None, raw=False, **operation_config): """Create an API Key of an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -121,7 +127,7 @@ def create( :param api_key_properties: Properties that need to be specified to create an API key of a Application Insights component. :type api_key_properties: - ~azure.mgmt.applicationinsights.models.APIKeyRequest + ~azure.mgmt.applicationinsights.v2015_05_01.models.APIKeyRequest :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -130,25 +136,26 @@ def create( :return: ApplicationInsightsComponentAPIKey or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentAPIKey + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAPIKey or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ApiKeys' + url = self.create.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # 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()) @@ -161,9 +168,8 @@ def create( body_content = self._serialize.body(api_key_properties, 'APIKeyRequest') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -171,7 +177,6 @@ def create( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ApplicationInsightsComponentAPIKey', response) @@ -180,12 +185,14 @@ def create( return client_raw_response return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys'} def delete( self, resource_group_name, resource_name, key_id, custom_headers=None, raw=False, **operation_config): """Delete an API Key of an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -201,15 +208,15 @@ def delete( :return: ApplicationInsightsComponentAPIKey or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentAPIKey + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAPIKey or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}' + url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'keyId': self._serialize.url("key_id", key_id, 'str') } @@ -217,11 +224,11 @@ def delete( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -230,8 +237,8 @@ def delete( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -239,7 +246,6 @@ def delete( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ApplicationInsightsComponentAPIKey', response) @@ -248,12 +254,14 @@ def delete( return client_raw_response return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}'} def get( self, resource_group_name, resource_name, key_id, custom_headers=None, raw=False, **operation_config): """Get the API Key for this key id. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -269,15 +277,15 @@ def get( :return: ApplicationInsightsComponentAPIKey or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentAPIKey + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAPIKey or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/APIKeys/{keyId}' + url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'keyId': self._serialize.url("key_id", key_id, 'str') } @@ -285,11 +293,11 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -298,8 +306,8 @@ def get( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -307,7 +315,6 @@ def get( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ApplicationInsightsComponentAPIKey', response) @@ -316,3 +323,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_component_available_features_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_component_available_features_operations.py new file mode 100644 index 00000000000..6dcc4364e87 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_component_available_features_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ComponentAvailableFeaturesOperations(object): + """ComponentAvailableFeaturesOperations 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: The API version to use for this operation. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Returns all available features of the application insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: ApplicationInsightsComponentAvailableFeatures or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAvailableFeatures + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentAvailableFeatures', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/getavailablebillingfeatures'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/component_current_billing_features_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_component_current_billing_features_operations.py similarity index 77% rename from src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/component_current_billing_features_operations.py rename to src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_component_current_billing_features_operations.py index 16cade55aa9..e01909b7ac0 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/component_current_billing_features_operations.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_component_current_billing_features_operations.py @@ -19,11 +19,13 @@ class ComponentCurrentBillingFeaturesOperations(object): """ComponentCurrentBillingFeaturesOperations 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 objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -41,7 +43,8 @@ def get( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): """Returns current billing features for an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -54,26 +57,26 @@ def get( :return: ApplicationInsightsComponentBillingFeatures or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentBillingFeatures + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentBillingFeatures or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures' + url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -82,8 +85,8 @@ def get( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -91,7 +94,6 @@ def get( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ApplicationInsightsComponentBillingFeatures', response) @@ -100,20 +102,22 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures'} def update( self, resource_group_name, resource_name, data_volume_cap=None, current_billing_features=None, custom_headers=None, raw=False, **operation_config): """Update current billing features for an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. :type resource_name: str :param data_volume_cap: An Application Insights component daily data - volumne cap + volume cap :type data_volume_cap: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentDataVolumeCap + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentDataVolumeCap :param current_billing_features: Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. @@ -126,27 +130,28 @@ def update( :return: ApplicationInsightsComponentBillingFeatures or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentBillingFeatures + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentBillingFeatures or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ billing_features_properties = models.ApplicationInsightsComponentBillingFeatures(data_volume_cap=data_volume_cap, current_billing_features=current_billing_features) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/currentbillingfeatures' + url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # 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()) @@ -159,9 +164,8 @@ def update( body_content = self._serialize.body(billing_features_properties, 'ApplicationInsightsComponentBillingFeatures') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -169,7 +173,6 @@ def update( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ApplicationInsightsComponentBillingFeatures', response) @@ -178,3 +181,4 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_component_feature_capabilities_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_component_feature_capabilities_operations.py new file mode 100644 index 00000000000..51515c2c123 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_component_feature_capabilities_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ComponentFeatureCapabilitiesOperations(object): + """ComponentFeatureCapabilitiesOperations 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: The API version to use for this operation. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Returns feature capabilities of the application insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: ApplicationInsightsComponentFeatureCapabilities or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFeatureCapabilities + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentFeatureCapabilities', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/featurecapabilities'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/component_quota_status_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_component_quota_status_operations.py similarity index 77% rename from src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/component_quota_status_operations.py rename to src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_component_quota_status_operations.py index 13771c68a22..7c25baf1f00 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/component_quota_status_operations.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_component_quota_status_operations.py @@ -19,11 +19,13 @@ class ComponentQuotaStatusOperations(object): """ComponentQuotaStatusOperations 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 objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -42,7 +44,8 @@ def get( """Returns daily data volume cap (quota) status for an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -55,26 +58,26 @@ def get( :return: ApplicationInsightsComponentQuotaStatus or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentQuotaStatus + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentQuotaStatus or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/quotastatus' + url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -83,8 +86,8 @@ def get( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -92,7 +95,6 @@ def get( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ApplicationInsightsComponentQuotaStatus', response) @@ -101,3 +103,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/quotastatus'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/components_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_components_operations.py similarity index 54% rename from src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/components_operations.py rename to src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_components_operations.py index a8ed3b02337..4bdd9a8b3b2 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/components_operations.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_components_operations.py @@ -19,11 +19,13 @@ class ComponentsOperations(object): """ComponentsOperations 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 objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -49,22 +51,21 @@ def list( overrides`. :return: An iterator like instance of ApplicationInsightsComponent :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentPaged[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponent] + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponent] :raises: :class:`CloudError` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/microsoft.insights/components' + url = self.list.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -72,7 +73,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -81,9 +82,13 @@ def internal_paging(next_link=None, raw=False): 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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) @@ -93,20 +98,20 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.ApplicationInsightsComponentPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.ApplicationInsightsComponentPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.ApplicationInsightsComponentPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/components'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Gets a list of Application Insights components within a resource group. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. 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 @@ -115,23 +120,22 @@ def list_by_resource_group( overrides`. :return: An iterator like instance of ApplicationInsightsComponent :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentPaged[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponent] + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponent] :raises: :class:`CloudError` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -139,7 +143,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -148,9 +152,13 @@ def internal_paging(next_link=None, raw=False): 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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) @@ -160,20 +168,20 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.ApplicationInsightsComponentPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.ApplicationInsightsComponentPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.ApplicationInsightsComponentPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components'} def delete( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): """Deletes an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -188,21 +196,20 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}' + url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - 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: @@ -211,8 +218,8 @@ def delete( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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, 204]: exp = CloudError(response) @@ -222,12 +229,14 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} def get( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): """Returns an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -239,26 +248,26 @@ def get( overrides`. :return: ApplicationInsightsComponent or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponent or - ~msrest.pipeline.ClientRawResponse + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponent + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}' + url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -267,8 +276,8 @@ def get( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -276,7 +285,6 @@ def get( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ApplicationInsightsComponent', response) @@ -285,6 +293,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} def create_or_update( self, resource_group_name, resource_name, insight_properties, custom_headers=None, raw=False, **operation_config): @@ -292,7 +301,8 @@ def create_or_update( cannot specify a different value for InstrumentationKey nor AppId in the Put operation. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -300,7 +310,7 @@ def create_or_update( :param insight_properties: Properties that need to be specified to create an Application Insights component. :type insight_properties: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponent + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponent :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -308,25 +318,26 @@ def create_or_update( overrides`. :return: ApplicationInsightsComponent or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponent or - ~msrest.pipeline.ClientRawResponse + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponent + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # 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()) @@ -339,9 +350,8 @@ def create_or_update( body_content = self._serialize.body(insight_properties, 'ApplicationInsightsComponent') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -349,7 +359,6 @@ def create_or_update( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ApplicationInsightsComponent', response) @@ -358,13 +367,15 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} def update_tags( self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): """Updates an existing component's tags. To update other fields use the CreateOrUpdate method. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -378,27 +389,28 @@ def update_tags( overrides`. :return: ApplicationInsightsComponent or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponent or - ~msrest.pipeline.ClientRawResponse + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponent + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ component_tags = models.TagsResource(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}' + url = self.update_tags.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # 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()) @@ -411,9 +423,8 @@ def update_tags( body_content = self._serialize.body(component_tags, 'TagsResource') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -421,7 +432,6 @@ def update_tags( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ApplicationInsightsComponent', response) @@ -430,3 +440,155 @@ def update_tags( return client_raw_response return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} + + def purge( + self, resource_group_name, resource_name, table, filters, custom_headers=None, raw=False, **operation_config): + """Purges data in an Application Insights component by a set of + user-defined filters. + In order to manage system resources, purge requests are throttled at 50 + requests per hour. You should batch the execution of purge requests by + sending a single command whose predicate includes all user identities + that require purging. Use the in operator to specify multiple + identities. You should run the query prior to using for a purge request + to verify that the results are expected. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param table: Table from which to purge data. + :type table: str + :param filters: The set of columns and filters (queries) to run over + them to purge the resulting data. + :type filters: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ComponentPurgeBodyFilters] + :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: ComponentPurgeResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ComponentPurgeResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = models.ComponentPurgeBody(table=table, filters=filters) + + # Construct URL + url = self.purge.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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(body, 'ComponentPurgeBody') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 202: + deserialized = self._deserialize('ComponentPurgeResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge'} + + def get_purge_status( + self, resource_group_name, resource_name, purge_id, custom_headers=None, raw=False, **operation_config): + """Get status for an ongoing purge operation. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param purge_id: In a purge status request, this is the Id of the + operation the status of which is returned. + :type purge_id: 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: ComponentPurgeStatusResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ComponentPurgeStatusResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_purge_status.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'purgeId': self._serialize.url("purge_id", purge_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ComponentPurgeStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_purge_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/export_configurations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_export_configurations_operations.py similarity index 76% rename from src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/export_configurations_operations.py rename to src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_export_configurations_operations.py index 8f5cd9f601e..aaf8b6f8709 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/export_configurations_operations.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_export_configurations_operations.py @@ -19,11 +19,13 @@ class ExportConfigurationsOperations(object): """ExportConfigurationsOperations 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 objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -42,7 +44,8 @@ def list( """Gets a list of Continuous Export configuration of an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -54,26 +57,26 @@ def list( overrides`. :return: list or ClientRawResponse if raw=true :rtype: - list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentExportConfiguration] + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportConfiguration] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration' + url = self.list.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -82,8 +85,8 @@ def list( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -91,7 +94,6 @@ def list( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('[ApplicationInsightsComponentExportConfiguration]', response) @@ -100,13 +102,15 @@ def list( return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration'} def create( self, resource_group_name, resource_name, export_properties, custom_headers=None, raw=False, **operation_config): """Create a Continuous Export configuration of an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -115,7 +119,7 @@ def create( create a Continuous Export configuration of a Application Insights component. :type export_properties: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentExportRequest + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportRequest :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -123,25 +127,26 @@ def create( overrides`. :return: list or ClientRawResponse if raw=true :rtype: - list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentExportConfiguration] + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportConfiguration] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration' + url = self.create.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # 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()) @@ -154,9 +159,8 @@ def create( body_content = self._serialize.body(export_properties, 'ApplicationInsightsComponentExportRequest') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -164,7 +168,6 @@ def create( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('[ApplicationInsightsComponentExportConfiguration]', response) @@ -173,13 +176,15 @@ def create( return client_raw_response return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration'} def delete( self, resource_group_name, resource_name, export_id, custom_headers=None, raw=False, **operation_config): """Delete a Continuous Export configuration of an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -195,15 +200,15 @@ def delete( :return: ApplicationInsightsComponentExportConfiguration or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentExportConfiguration + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportConfiguration or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}' + url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'exportId': self._serialize.url("export_id", export_id, 'str') } @@ -211,11 +216,11 @@ def delete( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -224,8 +229,8 @@ def delete( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -233,7 +238,6 @@ def delete( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ApplicationInsightsComponentExportConfiguration', response) @@ -242,12 +246,14 @@ def delete( return client_raw_response return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}'} def get( self, resource_group_name, resource_name, export_id, custom_headers=None, raw=False, **operation_config): """Get the Continuous Export configuration for this export id. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -263,15 +269,15 @@ def get( :return: ApplicationInsightsComponentExportConfiguration or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentExportConfiguration + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportConfiguration or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}' + url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'exportId': self._serialize.url("export_id", export_id, 'str') } @@ -279,11 +285,11 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -292,8 +298,8 @@ def get( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -301,7 +307,6 @@ def get( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ApplicationInsightsComponentExportConfiguration', response) @@ -310,12 +315,14 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}'} def update( self, resource_group_name, resource_name, export_id, export_properties, custom_headers=None, raw=False, **operation_config): """Update the Continuous Export configuration for this export id. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -326,7 +333,7 @@ def update( :param export_properties: Properties that need to be specified to update the Continuous Export configuration. :type export_properties: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentExportRequest + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportRequest :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -335,15 +342,15 @@ def update( :return: ApplicationInsightsComponentExportConfiguration or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentExportConfiguration + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportConfiguration or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/exportconfiguration/{exportId}' + url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'exportId': self._serialize.url("export_id", export_id, 'str') } @@ -351,10 +358,11 @@ def update( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # 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()) @@ -367,9 +375,8 @@ def update( body_content = self._serialize.body(export_properties, 'ApplicationInsightsComponentExportRequest') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -377,7 +384,6 @@ def update( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ApplicationInsightsComponentExportConfiguration', response) @@ -386,3 +392,4 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_favorites_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_favorites_operations.py new file mode 100644 index 00000000000..bf0a809265e --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_favorites_operations.py @@ -0,0 +1,414 @@ +# 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 FavoritesOperations(object): + """FavoritesOperations 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: The API version to use for this operation. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def list( + self, resource_group_name, resource_name, favorite_type="shared", source_type=None, can_fetch_content=None, tags=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of favorites defined within an Application Insights + component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param favorite_type: The type of favorite. Value can be either shared + or user. Possible values include: 'shared', 'user' + :type favorite_type: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.FavoriteType + :param source_type: Source type of favorite to return. When left out, + the source type defaults to 'other' (not present in this enum). + Possible values include: 'retention', 'notebook', 'sessions', + 'events', 'userflows', 'funnel', 'impact', 'segmentation' + :type source_type: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.FavoriteSourceType + :param can_fetch_content: Flag indicating whether or not to return the + full content for each applicable favorite. If false, only return + summary content for favorites. + :type can_fetch_content: bool + :param tags: Tags that must be present on each favorite returned. + :type tags: list[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: list or ClientRawResponse if raw=true + :rtype: + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + if favorite_type is not None: + query_parameters['favoriteType'] = self._serialize.query("favorite_type", favorite_type, 'FavoriteType') + if source_type is not None: + query_parameters['sourceType'] = self._serialize.query("source_type", source_type, 'str') + if can_fetch_content is not None: + query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') + if tags is not None: + query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[ApplicationInsightsComponentFavorite]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites'} + + def get( + self, resource_group_name, resource_name, favorite_id, custom_headers=None, raw=False, **operation_config): + """Get a single favorite by its FavoriteId, defined within an Application + Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param favorite_id: The Id of a specific favorite defined in the + Application Insights component + :type favorite_id: 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: ApplicationInsightsComponentFavorite or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'favoriteId': self._serialize.url("favorite_id", favorite_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentFavorite', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} + + def add( + self, resource_group_name, resource_name, favorite_id, favorite_properties, custom_headers=None, raw=False, **operation_config): + """Adds a new favorites to an Application Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param favorite_id: The Id of a specific favorite defined in the + Application Insights component + :type favorite_id: str + :param favorite_properties: Properties that need to be specified to + create a new favorite and add it to an Application Insights component. + :type favorite_properties: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite + :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: ApplicationInsightsComponentFavorite or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.add.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'favoriteId': self._serialize.url("favorite_id", favorite_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', min_length=1) + + # 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(favorite_properties, 'ApplicationInsightsComponentFavorite') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentFavorite', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + add.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} + + def update( + self, resource_group_name, resource_name, favorite_id, favorite_properties, custom_headers=None, raw=False, **operation_config): + """Updates a favorite that has already been added to an Application + Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param favorite_id: The Id of a specific favorite defined in the + Application Insights component + :type favorite_id: str + :param favorite_properties: Properties that need to be specified to + update the existing favorite. + :type favorite_properties: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite + :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: ApplicationInsightsComponentFavorite or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'favoriteId': self._serialize.url("favorite_id", favorite_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', min_length=1) + + # 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(favorite_properties, 'ApplicationInsightsComponentFavorite') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentFavorite', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} + + def delete( + self, resource_group_name, resource_name, favorite_id, custom_headers=None, raw=False, **operation_config): + """Remove a favorite that is associated to an Application Insights + component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param favorite_id: The Id of a specific favorite defined in the + Application Insights component + :type favorite_id: 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:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'favoriteId': self._serialize.url("favorite_id", favorite_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_operations.py similarity index 71% rename from src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/operations.py rename to src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_operations.py index 8c6c4ab58de..b83ba6c5bb6 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/operations.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_operations.py @@ -18,11 +18,13 @@ 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 objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -47,19 +49,18 @@ def list( overrides`. :return: An iterator like instance of Operation :rtype: - ~azure.mgmt.applicationinsights.models.OperationPaged[~azure.mgmt.applicationinsights.models.Operation] + ~azure.mgmt.applicationinsights.v2015_05_01.models.OperationPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.Operation] :raises: - :class:`ErrorResponseException` + :class:`ErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL - url = '/providers/microsoft.insights/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -67,7 +68,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -76,9 +77,13 @@ def internal_paging(next_link=None, raw=False): 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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]: raise models.ErrorResponseException(self._deserialize, response) @@ -86,11 +91,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized + list.metadata = {'url': '/providers/Microsoft.Insights/operations'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/proactive_detection_configurations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_proactive_detection_configurations_operations.py similarity index 76% rename from src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/proactive_detection_configurations_operations.py rename to src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_proactive_detection_configurations_operations.py index 3a5f0b76366..809cac1cd38 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/proactive_detection_configurations_operations.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_proactive_detection_configurations_operations.py @@ -19,11 +19,13 @@ class ProactiveDetectionConfigurationsOperations(object): """ProactiveDetectionConfigurationsOperations 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 objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -42,7 +44,8 @@ def list( """Gets a list of ProactiveDetection configurations of an Application Insights component. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -54,26 +57,26 @@ def list( overrides`. :return: list or ClientRawResponse if raw=true :rtype: - list[~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfiguration] + list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentProactiveDetectionConfiguration] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ProactiveDetectionConfigs' + url = self.list.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -82,8 +85,8 @@ def list( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -91,7 +94,6 @@ def list( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('[ApplicationInsightsComponentProactiveDetectionConfiguration]', response) @@ -100,12 +102,14 @@ def list( return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs'} def get( self, resource_group_name, resource_name, configuration_id, custom_headers=None, raw=False, **operation_config): """Get the ProactiveDetection configuration for this configuration id. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -121,15 +125,15 @@ def get( :return: ApplicationInsightsComponentProactiveDetectionConfiguration or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfiguration + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentProactiveDetectionConfiguration or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}' + url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'ConfigurationId': self._serialize.url("configuration_id", configuration_id, 'str') } @@ -137,11 +141,11 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -150,8 +154,8 @@ def get( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -159,7 +163,6 @@ def get( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ApplicationInsightsComponentProactiveDetectionConfiguration', response) @@ -168,12 +171,14 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} def update( self, resource_group_name, resource_name, configuration_id, proactive_detection_properties, custom_headers=None, raw=False, **operation_config): """Update the ProactiveDetection configuration for this configuration id. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param resource_name: The name of the Application Insights component resource. @@ -184,7 +189,7 @@ def update( :param proactive_detection_properties: Properties that need to be specified to update the ProactiveDetection configuration. :type proactive_detection_properties: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfiguration + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentProactiveDetectionConfiguration :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -193,15 +198,15 @@ def update( :return: ApplicationInsightsComponentProactiveDetectionConfiguration or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.applicationinsights.models.ApplicationInsightsComponentProactiveDetectionConfiguration + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentProactiveDetectionConfiguration or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}' + url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'ConfigurationId': self._serialize.url("configuration_id", configuration_id, 'str') } @@ -209,10 +214,11 @@ def update( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # 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()) @@ -225,9 +231,8 @@ def update( body_content = self._serialize.body(proactive_detection_properties, 'ApplicationInsightsComponentProactiveDetectionConfiguration') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -235,7 +240,6 @@ def update( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('ApplicationInsightsComponentProactiveDetectionConfiguration', response) @@ -244,3 +248,4 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_web_test_locations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_web_test_locations_operations.py new file mode 100644 index 00000000000..f20750520e7 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_web_test_locations_operations.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class WebTestLocationsOperations(object): + """WebTestLocationsOperations 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: The API version to use for this operation. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def list( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of web test locations available to this Application + Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: An iterator like instance of + ApplicationInsightsComponentWebTestLocation + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentWebTestLocationPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentWebTestLocation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + 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.ApplicationInsightsComponentWebTestLocationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/syntheticmonitorlocations'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/web_tests_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_web_tests_operations.py similarity index 63% rename from src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/web_tests_operations.py rename to src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_web_tests_operations.py index 44a6e74d6e2..c3bf172e11c 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/operations/web_tests_operations.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_web_tests_operations.py @@ -19,11 +19,13 @@ class WebTestsOperations(object): """WebTestsOperations 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 objec model deserializer. - :ivar api_version: Client Api Version. Constant value: "2015-05-01". + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2015-05-01". """ models = models @@ -42,7 +44,8 @@ def list_by_resource_group( """Get all Application Insights web tests defined within a specified resource group. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. 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 @@ -51,23 +54,22 @@ def list_by_resource_group( overrides`. :return: An iterator like instance of WebTest :rtype: - ~azure.mgmt.applicationinsights.models.WebTestPaged[~azure.mgmt.applicationinsights.models.WebTest] + ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest] :raises: :class:`CloudError` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -75,7 +77,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -84,9 +86,13 @@ def internal_paging(next_link=None, raw=False): 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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) @@ -96,20 +102,20 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.WebTestPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.WebTestPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.WebTestPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests'} def get( self, resource_group_name, web_test_name, custom_headers=None, raw=False, **operation_config): """Get a specific Application Insights web test definition. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param web_test_name: The name of the Application Insights webtest resource. @@ -120,26 +126,26 @@ def get( :param operation_config: :ref:`Operation configuration overrides`. :return: WebTest or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.applicationinsights.models.WebTest or + :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}' + url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'webTestName': self._serialize.url("web_test_name", web_test_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -148,8 +154,8 @@ def get( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -157,7 +163,6 @@ def get( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('WebTest', response) @@ -166,12 +171,14 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} def create_or_update( self, resource_group_name, web_test_name, web_test_definition, custom_headers=None, raw=False, **operation_config): """Creates or updates an Application Insights web test definition. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param web_test_name: The name of the Application Insights webtest resource. @@ -179,32 +186,33 @@ def create_or_update( :param web_test_definition: Properties that need to be specified to create or update an Application Insights web test definition. :type web_test_definition: - ~azure.mgmt.applicationinsights.models.WebTest + ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest :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: WebTest or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.applicationinsights.models.WebTest or + :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}' + url = self.create_or_update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'webTestName': self._serialize.url("web_test_name", web_test_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # 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()) @@ -217,9 +225,8 @@ def create_or_update( body_content = self._serialize.body(web_test_definition, 'WebTest') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -227,7 +234,6 @@ def create_or_update( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('WebTest', response) @@ -236,12 +242,14 @@ def create_or_update( return client_raw_response return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} def update_tags( self, resource_group_name, web_test_name, tags=None, custom_headers=None, raw=False, **operation_config): """Creates or updates an Application Insights web test definition. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param web_test_name: The name of the Application Insights webtest resource. @@ -254,27 +262,28 @@ def update_tags( :param operation_config: :ref:`Operation configuration overrides`. :return: WebTest or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.applicationinsights.models.WebTest or + :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ web_test_tags = models.TagsResource(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}' + url = self.update_tags.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'webTestName': self._serialize.url("web_test_name", web_test_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # 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()) @@ -287,9 +296,8 @@ def update_tags( body_content = self._serialize.body(web_test_tags, 'TagsResource') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + 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]: exp = CloudError(response) @@ -297,7 +305,6 @@ def update_tags( raise exp deserialized = None - if response.status_code == 200: deserialized = self._deserialize('WebTest', response) @@ -306,12 +313,14 @@ def update_tags( return client_raw_response return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} def delete( self, resource_group_name, web_test_name, custom_headers=None, raw=False, **operation_config): """Deletes an Application Insights web test. - :param resource_group_name: The name of the resource group. + :param resource_group_name: The name of the resource group. The name + is case insensitive. :type resource_group_name: str :param web_test_name: The name of the Application Insights webtest resource. @@ -326,21 +335,20 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/webtests/{webTestName}' + 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'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'webTestName': self._serialize.url("web_test_name", web_test_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') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) # Construct headers header_parameters = {} - 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: @@ -349,8 +357,8 @@ def delete( 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) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + 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, 204]: exp = CloudError(response) @@ -360,10 +368,11 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} def list( self, custom_headers=None, raw=False, **operation_config): - """Get all Application Insights web test alerts definitioned within a + """Get all Application Insights web test alerts definitions within a subscription. :param dict custom_headers: headers that will be added to the request @@ -373,22 +382,21 @@ def list( overrides`. :return: An iterator like instance of WebTest :rtype: - ~azure.mgmt.applicationinsights.models.WebTestPaged[~azure.mgmt.applicationinsights.models.WebTest] + ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest] :raises: :class:`CloudError` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/microsoft.insights/webtests' + url = self.list.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) else: url = next_link @@ -396,7 +404,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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: @@ -405,9 +413,13 @@ def internal_paging(next_link=None, raw=False): 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) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) + 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) @@ -417,11 +429,85 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.WebTestPaged(internal_paging, self._deserialize.dependencies) + header_dict = None + if raw: + header_dict = {} + deserialized = models.WebTestPaged(internal_paging, self._deserialize.dependencies, header_dict) + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/webtests'} + + def list_by_component( + self, component_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get all Application Insights web tests defined for the specified + component. + + :param component_name: The name of the Application Insights component + resource. + :type component_name: str + :param resource_group_name: The name of the resource group. 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: An iterator like instance of WebTest + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_component.metadata['url'] + path_format_arguments = { + 'componentName': self._serialize.url("component_name", component_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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 = {} - client_raw_response = models.WebTestPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.WebTestPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized + list_by_component.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{componentName}/webtests'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_work_item_configurations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_work_item_configurations_operations.py new file mode 100644 index 00000000000..c8dd5d0fc59 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_work_item_configurations_operations.py @@ -0,0 +1,458 @@ +# 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 WorkItemConfigurationsOperations(object): + """WorkItemConfigurationsOperations 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: The API version to use for this operation. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def list( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets the list work item configurations that exist for the application. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: An iterator like instance of WorkItemConfiguration + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfigurationPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfiguration] + :raises: + :class:`WorkItemConfigurationErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + 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]: + raise models.WorkItemConfigurationErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WorkItemConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs'} + + def create( + self, resource_group_name, resource_name, work_item_configuration_properties, custom_headers=None, raw=False, **operation_config): + """Create a work item configuration for an Application Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param work_item_configuration_properties: Properties that need to be + specified to create a work item configuration of a Application + Insights component. + :type work_item_configuration_properties: + ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemCreateConfiguration + :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: WorkItemConfiguration or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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(work_item_configuration_properties, 'WorkItemCreateConfiguration') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkItemConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs'} + + def get_default( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets default work item configurations that exist for the application. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: WorkItemConfiguration or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_default.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkItemConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_default.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/DefaultWorkItemConfig'} + + def delete( + self, resource_group_name, resource_name, work_item_config_id, custom_headers=None, raw=False, **operation_config): + """Delete a work item configuration of an Application Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param work_item_config_id: The unique work item configuration Id. + This can be either friendly name of connector as defined in connector + configuration + :type work_item_config_id: 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:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'workItemConfigId': self._serialize.url("work_item_config_id", work_item_config_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}'} + + def get_item( + self, resource_group_name, resource_name, work_item_config_id, custom_headers=None, raw=False, **operation_config): + """Gets specified work item configuration for an Application Insights + component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param work_item_config_id: The unique work item configuration Id. + This can be either friendly name of connector as defined in connector + configuration + :type work_item_config_id: 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: WorkItemConfiguration or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_item.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'workItemConfigId': self._serialize.url("work_item_config_id", work_item_config_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkItemConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}'} + + def update_item( + self, resource_group_name, resource_name, work_item_config_id, work_item_configuration_properties, custom_headers=None, raw=False, **operation_config): + """Update a work item configuration for an Application Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param work_item_config_id: The unique work item configuration Id. + This can be either friendly name of connector as defined in connector + configuration + :type work_item_config_id: str + :param work_item_configuration_properties: Properties that need to be + specified to update a work item configuration for this Application + Insights component. + :type work_item_configuration_properties: + ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemCreateConfiguration + :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: WorkItemConfiguration or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update_item.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'workItemConfigId': self._serialize.url("work_item_config_id", work_item_config_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', min_length=1) + + # 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(work_item_configuration_properties, 'WorkItemCreateConfiguration') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkItemConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_workbooks_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_workbooks_operations.py new file mode 100644 index 00000000000..48aee77b9de --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/operations/_workbooks_operations.py @@ -0,0 +1,382 @@ +# 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 WorkbooksOperations(object): + """WorkbooksOperations 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: The API version to use for this operation. Constant value: "2015-05-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01" + + self.config = config + + def list_by_resource_group( + self, resource_group_name, category, tags=None, can_fetch_content=None, custom_headers=None, raw=False, **operation_config): + """Get all Workbooks defined within a specified resource group and + category. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param category: Category of workbook to return. Possible values + include: 'workbook', 'TSG', 'performance', 'retention' + :type category: str or + ~azure.mgmt.applicationinsights.v2015_05_01.models.CategoryType + :param tags: Tags presents on each workbook returned. + :type tags: list[str] + :param can_fetch_content: Flag indicating whether or not to return the + full content for each applicable workbook. If false, only return + summary content for workbooks. + :type can_fetch_content: bool + :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 Workbook + :rtype: + ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkbookPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.Workbook] + :raises: + :class:`WorkbookErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['category'] = self._serialize.query("category", category, 'str') + if tags is not None: + query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') + if can_fetch_content is not None: + query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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]: + raise models.WorkbookErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WorkbookPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks'} + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get a single workbook by its resourceName. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: Workbook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.Workbook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`WorkbookErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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.WorkbookErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Workbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Delete a workbook. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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:`WorkbookErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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 [201, 204]: + raise models.WorkbookErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + + def create_or_update( + self, resource_group_name, resource_name, workbook_properties, custom_headers=None, raw=False, **operation_config): + """Create a new workbook. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param workbook_properties: Properties that need to be specified to + create a new workbook. + :type workbook_properties: + ~azure.mgmt.applicationinsights.v2015_05_01.models.Workbook + :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: Workbook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.Workbook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`WorkbookErrorException` + """ + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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(workbook_properties, 'Workbook') + + # 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, 201]: + raise models.WorkbookErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Workbook', response) + if response.status_code == 201: + deserialized = self._deserialize('Workbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + + def update( + self, resource_group_name, resource_name, workbook_properties, custom_headers=None, raw=False, **operation_config): + """Updates a workbook that has already been added. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param workbook_properties: Properties that need to be specified to + create a new workbook. + :type workbook_properties: + ~azure.mgmt.applicationinsights.v2015_05_01.models.Workbook + :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: Workbook or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.Workbook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`WorkbookErrorException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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(workbook_properties, 'Workbook') + + # 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.WorkbookErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Workbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/version.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/version.py new file mode 100644 index 00000000000..10f4c707bc5 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/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 = "2015-05-01" + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/__init__.py new file mode 100644 index 00000000000..298512941d9 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/__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 ApplicationInsightsManagementClientConfiguration +from ._application_insights_management_client import ApplicationInsightsManagementClient +__all__ = ['ApplicationInsightsManagementClient', 'ApplicationInsightsManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/_application_insights_management_client.py new file mode 100644 index 00000000000..46cf6e1043c --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/_application_insights_management_client.py @@ -0,0 +1,64 @@ +# 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 ApplicationInsightsManagementClientConfiguration +from .operations import EASubscriptionMigrateToNewPricingModelOperations +from .operations import EASubscriptionRollbackToLegacyPricingModelOperations +from .operations import EASubscriptionListMigrationDateOperations +from .operations import ComponentCurrentPricingPlanOperations +from . import models + + +class ApplicationInsightsManagementClient(SDKClient): + """Composite Swagger for Application Insights Management Client + + :ivar config: Configuration for client. + :vartype config: ApplicationInsightsManagementClientConfiguration + + :ivar ea_subscription_migrate_to_new_pricing_model: EASubscriptionMigrateToNewPricingModel operations + :vartype ea_subscription_migrate_to_new_pricing_model: azure.mgmt.applicationinsights.v2017_10_01.operations.EASubscriptionMigrateToNewPricingModelOperations + :ivar ea_subscription_rollback_to_legacy_pricing_model: EASubscriptionRollbackToLegacyPricingModel operations + :vartype ea_subscription_rollback_to_legacy_pricing_model: azure.mgmt.applicationinsights.v2017_10_01.operations.EASubscriptionRollbackToLegacyPricingModelOperations + :ivar ea_subscription_list_migration_date: EASubscriptionListMigrationDate operations + :vartype ea_subscription_list_migration_date: azure.mgmt.applicationinsights.v2017_10_01.operations.EASubscriptionListMigrationDateOperations + :ivar component_current_pricing_plan: ComponentCurrentPricingPlan operations + :vartype component_current_pricing_plan: azure.mgmt.applicationinsights.v2017_10_01.operations.ComponentCurrentPricingPlanOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ApplicationInsightsManagementClientConfiguration(credentials, subscription_id, base_url) + super(ApplicationInsightsManagementClient, 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 = '2017-10-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.ea_subscription_migrate_to_new_pricing_model = EASubscriptionMigrateToNewPricingModelOperations( + self._client, self.config, self._serialize, self._deserialize) + self.ea_subscription_rollback_to_legacy_pricing_model = EASubscriptionRollbackToLegacyPricingModelOperations( + self._client, self.config, self._serialize, self._deserialize) + self.ea_subscription_list_migration_date = EASubscriptionListMigrationDateOperations( + self._client, self.config, self._serialize, self._deserialize) + self.component_current_pricing_plan = ComponentCurrentPricingPlanOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/_configuration.py new file mode 100644 index 00000000000..6c855295a4b --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/_configuration.py @@ -0,0 +1,48 @@ +# 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 ApplicationInsightsManagementClientConfiguration(AzureConfiguration): + """Configuration for ApplicationInsightsManagementClient + 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: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(ApplicationInsightsManagementClientConfiguration, 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-applicationinsights/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/__init__.py new file mode 100644 index 00000000000..1a0bb9c4519 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/__init__.py @@ -0,0 +1,25 @@ +# 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 ApplicationInsightsComponentPricingPlan + from ._models_py3 import EASubscriptionMigrationDate + from ._models_py3 import Resource +except (SyntaxError, ImportError): + from ._models import ApplicationInsightsComponentPricingPlan + from ._models import EASubscriptionMigrationDate + from ._models import Resource + +__all__ = [ + 'ApplicationInsightsComponentPricingPlan', + 'EASubscriptionMigrationDate', + 'Resource', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/_models.py new file mode 100644 index 00000000000..49bdf7ba204 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/_models.py @@ -0,0 +1,191 @@ +# 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 Resource(Model): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ApplicationInsightsComponentPricingPlan(Resource): + """An Application Insights component pricing plan. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param plan_type: Pricing Plan Type Name. + :type plan_type: str + :param cap: Daily data volume cap in GB. + :type cap: float + :ivar reset_hour: Daily data volume cap UTC reset hour. + :vartype reset_hour: int + :param warning_threshold: Reserved, not used for now. + :type warning_threshold: int + :param stop_send_notification_when_hit_threshold: Reserved, not used for + now. + :type stop_send_notification_when_hit_threshold: bool + :param stop_send_notification_when_hit_cap: Do not send a notification + email when the daily data volume cap is met. + :type stop_send_notification_when_hit_cap: bool + :ivar max_history_cap: Maximum daily data volume cap that the user can set + for this component. + :vartype max_history_cap: float + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'reset_hour': {'readonly': True}, + 'max_history_cap': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'plan_type': {'key': 'properties.planType', 'type': 'str'}, + 'cap': {'key': 'properties.cap', 'type': 'float'}, + 'reset_hour': {'key': 'properties.resetHour', 'type': 'int'}, + 'warning_threshold': {'key': 'properties.warningThreshold', 'type': 'int'}, + 'stop_send_notification_when_hit_threshold': {'key': 'properties.stopSendNotificationWhenHitThreshold', 'type': 'bool'}, + 'stop_send_notification_when_hit_cap': {'key': 'properties.stopSendNotificationWhenHitCap', 'type': 'bool'}, + 'max_history_cap': {'key': 'properties.maxHistoryCap', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentPricingPlan, self).__init__(**kwargs) + self.plan_type = kwargs.get('plan_type', None) + self.cap = kwargs.get('cap', None) + self.reset_hour = None + self.warning_threshold = kwargs.get('warning_threshold', None) + self.stop_send_notification_when_hit_threshold = kwargs.get('stop_send_notification_when_hit_threshold', None) + self.stop_send_notification_when_hit_cap = kwargs.get('stop_send_notification_when_hit_cap', None) + self.max_history_cap = None + + +class CloudError(Model): + """An error response from the Batch service. + + :param error: Cloud error body. + :type error: + ~azure.mgmt.applicationinsights.v2017_10_01.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the Batch service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: + list[~azure.mgmt.applicationinsights.v2017_10_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, **kwargs): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class EASubscriptionMigrationDate(Model): + """Subscription migrate date information properties. + + :param is_grand_fatherable_subscription: Is subscription in the grand + fatherable subscription list. + :type is_grand_fatherable_subscription: bool + :param opted_in_date: Time to start using new pricing model. + :type opted_in_date: datetime + """ + + _attribute_map = { + 'is_grand_fatherable_subscription': {'key': 'isGrandFatherableSubscription', 'type': 'bool'}, + 'opted_in_date': {'key': 'optedInDate', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(EASubscriptionMigrationDate, self).__init__(**kwargs) + self.is_grand_fatherable_subscription = kwargs.get('is_grand_fatherable_subscription', None) + self.opted_in_date = kwargs.get('opted_in_date', None) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/_models_py3.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/_models_py3.py new file mode 100644 index 00000000000..74b7642069d --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/_models_py3.py @@ -0,0 +1,191 @@ +# 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 Resource(Model): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ApplicationInsightsComponentPricingPlan(Resource): + """An Application Insights component pricing plan. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param plan_type: Pricing Plan Type Name. + :type plan_type: str + :param cap: Daily data volume cap in GB. + :type cap: float + :ivar reset_hour: Daily data volume cap UTC reset hour. + :vartype reset_hour: int + :param warning_threshold: Reserved, not used for now. + :type warning_threshold: int + :param stop_send_notification_when_hit_threshold: Reserved, not used for + now. + :type stop_send_notification_when_hit_threshold: bool + :param stop_send_notification_when_hit_cap: Do not send a notification + email when the daily data volume cap is met. + :type stop_send_notification_when_hit_cap: bool + :ivar max_history_cap: Maximum daily data volume cap that the user can set + for this component. + :vartype max_history_cap: float + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'reset_hour': {'readonly': True}, + 'max_history_cap': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'plan_type': {'key': 'properties.planType', 'type': 'str'}, + 'cap': {'key': 'properties.cap', 'type': 'float'}, + 'reset_hour': {'key': 'properties.resetHour', 'type': 'int'}, + 'warning_threshold': {'key': 'properties.warningThreshold', 'type': 'int'}, + 'stop_send_notification_when_hit_threshold': {'key': 'properties.stopSendNotificationWhenHitThreshold', 'type': 'bool'}, + 'stop_send_notification_when_hit_cap': {'key': 'properties.stopSendNotificationWhenHitCap', 'type': 'bool'}, + 'max_history_cap': {'key': 'properties.maxHistoryCap', 'type': 'float'}, + } + + def __init__(self, *, plan_type: str=None, cap: float=None, warning_threshold: int=None, stop_send_notification_when_hit_threshold: bool=None, stop_send_notification_when_hit_cap: bool=None, **kwargs) -> None: + super(ApplicationInsightsComponentPricingPlan, self).__init__(**kwargs) + self.plan_type = plan_type + self.cap = cap + self.reset_hour = None + self.warning_threshold = warning_threshold + self.stop_send_notification_when_hit_threshold = stop_send_notification_when_hit_threshold + self.stop_send_notification_when_hit_cap = stop_send_notification_when_hit_cap + self.max_history_cap = None + + +class CloudError(Model): + """An error response from the Batch service. + + :param error: Cloud error body. + :type error: + ~azure.mgmt.applicationinsights.v2017_10_01.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the Batch service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: + list[~azure.mgmt.applicationinsights.v2017_10_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class EASubscriptionMigrationDate(Model): + """Subscription migrate date information properties. + + :param is_grand_fatherable_subscription: Is subscription in the grand + fatherable subscription list. + :type is_grand_fatherable_subscription: bool + :param opted_in_date: Time to start using new pricing model. + :type opted_in_date: datetime + """ + + _attribute_map = { + 'is_grand_fatherable_subscription': {'key': 'isGrandFatherableSubscription', 'type': 'bool'}, + 'opted_in_date': {'key': 'optedInDate', 'type': 'iso-8601'}, + } + + def __init__(self, *, is_grand_fatherable_subscription: bool=None, opted_in_date=None, **kwargs) -> None: + super(EASubscriptionMigrationDate, self).__init__(**kwargs) + self.is_grand_fatherable_subscription = is_grand_fatherable_subscription + self.opted_in_date = opted_in_date diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/operations/__init__.py new file mode 100644 index 00000000000..c4fd7484266 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/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 ._ea_subscription_migrate_to_new_pricing_model_operations import EASubscriptionMigrateToNewPricingModelOperations +from ._ea_subscription_rollback_to_legacy_pricing_model_operations import EASubscriptionRollbackToLegacyPricingModelOperations +from ._ea_subscription_list_migration_date_operations import EASubscriptionListMigrationDateOperations +from ._component_current_pricing_plan_operations import ComponentCurrentPricingPlanOperations + +__all__ = [ + 'EASubscriptionMigrateToNewPricingModelOperations', + 'EASubscriptionRollbackToLegacyPricingModelOperations', + 'EASubscriptionListMigrationDateOperations', + 'ComponentCurrentPricingPlanOperations', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/operations/_component_current_pricing_plan_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/operations/_component_current_pricing_plan_operations.py new file mode 100644 index 00000000000..0ad252ac270 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/operations/_component_current_pricing_plan_operations.py @@ -0,0 +1,252 @@ +# 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 ComponentCurrentPricingPlanOperations(object): + """ComponentCurrentPricingPlanOperations 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: The API version to use for this operation. Constant value: "2017-10-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-10-01" + + self.config = config + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Returns the current pricing plan setting for an Application Insights + component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: ApplicationInsightsComponentPricingPlan or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2017_10_01.models.ApplicationInsightsComponentPricingPlan + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentPricingPlan', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/pricingPlans/current'} + + def create_and_update( + self, resource_group_name, resource_name, pricing_plan_properties, custom_headers=None, raw=False, **operation_config): + """Replace current pricing plan for an Application Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param pricing_plan_properties: Properties that need to be specified + to update current pricing plan for an Application Insights component. + :type pricing_plan_properties: + ~azure.mgmt.applicationinsights.v2017_10_01.models.ApplicationInsightsComponentPricingPlan + :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: ApplicationInsightsComponentPricingPlan or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2017_10_01.models.ApplicationInsightsComponentPricingPlan + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_and_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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(pricing_plan_properties, 'ApplicationInsightsComponentPricingPlan') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentPricingPlan', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_and_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/pricingPlans/current'} + + def update( + self, resource_group_name, resource_name, pricing_plan_properties, custom_headers=None, raw=False, **operation_config): + """Update current pricing plan for an Application Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param pricing_plan_properties: Properties that need to be specified + to update current pricing plan for an Application Insights component. + :type pricing_plan_properties: + ~azure.mgmt.applicationinsights.v2017_10_01.models.ApplicationInsightsComponentPricingPlan + :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: ApplicationInsightsComponentPricingPlan or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2017_10_01.models.ApplicationInsightsComponentPricingPlan + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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(pricing_plan_properties, 'ApplicationInsightsComponentPricingPlan') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentPricingPlan', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/pricingPlans/current'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/operations/_ea_subscription_list_migration_date_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/operations/_ea_subscription_list_migration_date_operations.py new file mode 100644 index 00000000000..c67b3c20655 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/operations/_ea_subscription_list_migration_date_operations.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class EASubscriptionListMigrationDateOperations(object): + """EASubscriptionListMigrationDateOperations 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: The API version to use for this operation. Constant value: "2017-10-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-10-01" + + self.config = config + + def post( + self, custom_headers=None, raw=False, **operation_config): + """list date to migrate to new pricing model. + + :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: EASubscriptionMigrationDate or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2017_10_01.models.EASubscriptionMigrationDate + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.post.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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.post(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EASubscriptionMigrationDate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + post.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/listMigrationdate'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/operations/_ea_subscription_migrate_to_new_pricing_model_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/operations/_ea_subscription_migrate_to_new_pricing_model_operations.py new file mode 100644 index 00000000000..47dd725572d --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/operations/_ea_subscription_migrate_to_new_pricing_model_operations.py @@ -0,0 +1,87 @@ +# 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 EASubscriptionMigrateToNewPricingModelOperations(object): + """EASubscriptionMigrateToNewPricingModelOperations 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: The API version to use for this operation. Constant value: "2017-10-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-10-01" + + self.config = config + + def post( + self, custom_headers=None, raw=False, **operation_config): + """Enterprise Agreement Customer opted to use new pricing model. + + :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:`CloudError` + """ + # Construct URL + url = self.post.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + post.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/migrateToNewPricingModel'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/operations/_ea_subscription_rollback_to_legacy_pricing_model_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/operations/_ea_subscription_rollback_to_legacy_pricing_model_operations.py new file mode 100644 index 00000000000..e4c7118bedd --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/operations/_ea_subscription_rollback_to_legacy_pricing_model_operations.py @@ -0,0 +1,87 @@ +# 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 EASubscriptionRollbackToLegacyPricingModelOperations(object): + """EASubscriptionRollbackToLegacyPricingModelOperations 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: The API version to use for this operation. Constant value: "2017-10-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-10-01" + + self.config = config + + def post( + self, custom_headers=None, raw=False, **operation_config): + """Enterprise Agreement Customer roll back to use legacy pricing model. + + :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:`CloudError` + """ + # Construct URL + url = self.post.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + post.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/rollbackToLegacyPricingModel'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/version.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/version.py new file mode 100644 index 00000000000..6fd4531cf9a --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/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 = "2017-10-01" + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/__init__.py new file mode 100644 index 00000000000..298512941d9 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/__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 ApplicationInsightsManagementClientConfiguration +from ._application_insights_management_client import ApplicationInsightsManagementClient +__all__ = ['ApplicationInsightsManagementClient', 'ApplicationInsightsManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/_application_insights_management_client.py new file mode 100644 index 00000000000..d98837e38c0 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/_application_insights_management_client.py @@ -0,0 +1,54 @@ +# 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 ApplicationInsightsManagementClientConfiguration +from .operations import ProactiveDetectionConfigurationsOperations +from .operations import ComponentsOperations +from . import models + + +class ApplicationInsightsManagementClient(SDKClient): + """Composite Swagger for Application Insights Management Client + + :ivar config: Configuration for client. + :vartype config: ApplicationInsightsManagementClientConfiguration + + :ivar proactive_detection_configurations: ProactiveDetectionConfigurations operations + :vartype proactive_detection_configurations: azure.mgmt.applicationinsights.v2018_05_01_preview.operations.ProactiveDetectionConfigurationsOperations + :ivar components: Components operations + :vartype components: azure.mgmt.applicationinsights.v2018_05_01_preview.operations.ComponentsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ApplicationInsightsManagementClientConfiguration(credentials, subscription_id, base_url) + super(ApplicationInsightsManagementClient, 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 = '2018-05-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.proactive_detection_configurations = ProactiveDetectionConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.components = ComponentsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/_configuration.py new file mode 100644 index 00000000000..6c855295a4b --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/_configuration.py @@ -0,0 +1,48 @@ +# 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 ApplicationInsightsManagementClientConfiguration(AzureConfiguration): + """Configuration for ApplicationInsightsManagementClient + 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: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(ApplicationInsightsManagementClientConfiguration, 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-applicationinsights/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/__init__.py new file mode 100644 index 00000000000..ba5030f7471 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/__init__.py @@ -0,0 +1,60 @@ +# 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 ApplicationInsightsComponent + from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfiguration + from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions + from ._models_py3 import ComponentPurgeBody + from ._models_py3 import ComponentPurgeBodyFilters + from ._models_py3 import ComponentPurgeResponse + from ._models_py3 import ComponentPurgeStatusResponse + from ._models_py3 import ComponentsResource + from ._models_py3 import PrivateLinkScopedResource + from ._models_py3 import TagsResource +except (SyntaxError, ImportError): + from ._models import ApplicationInsightsComponent + from ._models import ApplicationInsightsComponentProactiveDetectionConfiguration + from ._models import ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions + from ._models import ComponentPurgeBody + from ._models import ComponentPurgeBodyFilters + from ._models import ComponentPurgeResponse + from ._models import ComponentPurgeStatusResponse + from ._models import ComponentsResource + from ._models import PrivateLinkScopedResource + from ._models import TagsResource +from ._paged_models import ApplicationInsightsComponentPaged +from ._application_insights_management_client_enums import ( + ApplicationType, + FlowType, + RequestSource, + PublicNetworkAccessType, + PurgeState, +) + +__all__ = [ + 'ApplicationInsightsComponent', + 'ApplicationInsightsComponentProactiveDetectionConfiguration', + 'ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions', + 'ComponentPurgeBody', + 'ComponentPurgeBodyFilters', + 'ComponentPurgeResponse', + 'ComponentPurgeStatusResponse', + 'ComponentsResource', + 'PrivateLinkScopedResource', + 'TagsResource', + 'ApplicationInsightsComponentPaged', + 'ApplicationType', + 'FlowType', + 'RequestSource', + 'PublicNetworkAccessType', + 'PurgeState', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_application_insights_management_client_enums.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_application_insights_management_client_enums.py new file mode 100644 index 00000000000..cab8df5318d --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_application_insights_management_client_enums.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ApplicationType(str, Enum): + + web = "web" + other = "other" + + +class FlowType(str, Enum): + + bluefield = "Bluefield" + + +class RequestSource(str, Enum): + + rest = "rest" + + +class PublicNetworkAccessType(str, Enum): + + enabled = "Enabled" #: Enables connectivity to Application Insights through public DNS. + disabled = "Disabled" #: Disables public connectivity to Application Insights through public DNS. + + +class PurgeState(str, Enum): + + pending = "pending" + completed = "completed" diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_models.py new file mode 100644 index 00000000000..7d95273618e --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_models.py @@ -0,0 +1,489 @@ +# 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 + + +class ComponentsResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, **kwargs): + super(ComponentsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class ApplicationInsightsComponent(ComponentsResource): + """An Application Insights component definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. The kind of application that this component refers + to, used to customize UI. This value is a freeform string, values should + typically be one of the following: web, ios, other, store, java, phone. + :type kind: str + :ivar application_id: The unique ID of your application. This field + mirrors the 'Name' field and cannot be changed. + :vartype application_id: str + :ivar app_id: Application Insights Unique ID for your Application. + :vartype app_id: str + :param application_type: Required. Type of application being monitored. + Possible values include: 'web', 'other'. Default value: "web" . + :type application_type: str or + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationType + :param flow_type: Used by the Application Insights system to determine + what kind of flow this component was created by. This is to be set to + 'Bluefield' when creating/updating a component via the REST API. Possible + values include: 'Bluefield'. Default value: "Bluefield" . + :type flow_type: str or + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.FlowType + :param request_source: Describes what tool created this Application + Insights component. Customers using this API should set this to the + default 'rest'. Possible values include: 'rest'. Default value: "rest" . + :type request_source: str or + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.RequestSource + :ivar instrumentation_key: Application Insights Instrumentation key. A + read-only value that applications can use to identify the destination for + all telemetry sent to Azure Application Insights. This value will be + supplied upon construction of each new Application Insights component. + :vartype instrumentation_key: str + :ivar creation_date: Creation Date for the Application Insights component, + in ISO 8601 format. + :vartype creation_date: datetime + :ivar tenant_id: Azure Tenant Id. + :vartype tenant_id: str + :param hockey_app_id: The unique application ID created when a new + application is added to HockeyApp, used for communications with HockeyApp. + :type hockey_app_id: str + :ivar hockey_app_token: Token used to authenticate communications with + between Application Insights and HockeyApp. + :vartype hockey_app_token: str + :ivar provisioning_state: Current state of this component: whether or not + is has been provisioned within the resource group it is defined. Users + cannot change this value but are able to read from it. Values will include + Succeeded, Deploying, Canceled, and Failed. + :vartype provisioning_state: str + :param sampling_percentage: Percentage of the data produced by the + application being monitored that is being sampled for Application Insights + telemetry. + :type sampling_percentage: float + :ivar connection_string: Application Insights component connection string. + :vartype connection_string: str + :param retention_in_days: Retention period in days. Default value: 90 . + :type retention_in_days: int + :param disable_ip_masking: Disable IP masking. + :type disable_ip_masking: bool + :param immediate_purge_data_on30_days: Purge data immediately after 30 + days. + :type immediate_purge_data_on30_days: bool + :ivar private_link_scoped_resources: List of linked private link scope + resources. + :vartype private_link_scoped_resources: + list[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.PrivateLinkScopedResource] + :param public_network_access_for_ingestion: The network access type for + accessing Application Insights ingestion. Possible values include: + 'Enabled', 'Disabled'. Default value: "Enabled" . + :type public_network_access_for_ingestion: str or + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.PublicNetworkAccessType + :param public_network_access_for_query: The network access type for + accessing Application Insights query. Possible values include: 'Enabled', + 'Disabled'. Default value: "Enabled" . + :type public_network_access_for_query: str or + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.PublicNetworkAccessType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'application_id': {'readonly': True}, + 'app_id': {'readonly': True}, + 'application_type': {'required': True}, + 'instrumentation_key': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'hockey_app_token': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'connection_string': {'readonly': True}, + 'private_link_scoped_resources': {'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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'application_id': {'key': 'properties.ApplicationId', 'type': 'str'}, + 'app_id': {'key': 'properties.AppId', 'type': 'str'}, + 'application_type': {'key': 'properties.Application_Type', 'type': 'str'}, + 'flow_type': {'key': 'properties.Flow_Type', 'type': 'str'}, + 'request_source': {'key': 'properties.Request_Source', 'type': 'str'}, + 'instrumentation_key': {'key': 'properties.InstrumentationKey', 'type': 'str'}, + 'creation_date': {'key': 'properties.CreationDate', 'type': 'iso-8601'}, + 'tenant_id': {'key': 'properties.TenantId', 'type': 'str'}, + 'hockey_app_id': {'key': 'properties.HockeyAppId', 'type': 'str'}, + 'hockey_app_token': {'key': 'properties.HockeyAppToken', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sampling_percentage': {'key': 'properties.SamplingPercentage', 'type': 'float'}, + 'connection_string': {'key': 'properties.ConnectionString', 'type': 'str'}, + 'retention_in_days': {'key': 'properties.RetentionInDays', 'type': 'int'}, + 'disable_ip_masking': {'key': 'properties.DisableIpMasking', 'type': 'bool'}, + 'immediate_purge_data_on30_days': {'key': 'properties.ImmediatePurgeDataOn30Days', 'type': 'bool'}, + 'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'}, + 'public_network_access_for_ingestion': {'key': 'properties.publicNetworkAccessForIngestion', 'type': 'str'}, + 'public_network_access_for_query': {'key': 'properties.publicNetworkAccessForQuery', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponent, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.application_id = None + self.app_id = None + self.application_type = kwargs.get('application_type', "web") + self.flow_type = kwargs.get('flow_type', "Bluefield") + self.request_source = kwargs.get('request_source', "rest") + self.instrumentation_key = None + self.creation_date = None + self.tenant_id = None + self.hockey_app_id = kwargs.get('hockey_app_id', None) + self.hockey_app_token = None + self.provisioning_state = None + self.sampling_percentage = kwargs.get('sampling_percentage', None) + self.connection_string = None + self.retention_in_days = kwargs.get('retention_in_days', 90) + self.disable_ip_masking = kwargs.get('disable_ip_masking', None) + self.immediate_purge_data_on30_days = kwargs.get('immediate_purge_data_on30_days', None) + self.private_link_scoped_resources = None + self.public_network_access_for_ingestion = kwargs.get('public_network_access_for_ingestion', "Enabled") + self.public_network_access_for_query = kwargs.get('public_network_access_for_query', "Enabled") + + +class ApplicationInsightsComponentProactiveDetectionConfiguration(Model): + """A ProactiveDetection configuration definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :param name: Azure resource name + :type name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Resource location + :type location: str + :ivar name1: The rule name + :vartype name1: str + :param enabled: A flag that indicates whether this rule is enabled by the + user + :type enabled: bool + :param send_emails_to_subscription_owners: A flag that indicated whether + notifications on this rule should be sent to subscription owners + :type send_emails_to_subscription_owners: bool + :param custom_emails: Custom email addresses for this rule notifications + :type custom_emails: list[str] + :ivar last_updated_time: The last time this rule was updated + :vartype last_updated_time: str + :param rule_definitions: Static definitions of the ProactiveDetection + configuration rule (same values for all components). + :type rule_definitions: + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name1': {'readonly': True}, + 'last_updated_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name1': {'key': 'properties.Name', 'type': 'str'}, + 'enabled': {'key': 'properties.Enabled', 'type': 'bool'}, + 'send_emails_to_subscription_owners': {'key': 'properties.SendEmailsToSubscriptionOwners', 'type': 'bool'}, + 'custom_emails': {'key': 'properties.CustomEmails', 'type': '[str]'}, + 'last_updated_time': {'key': 'properties.LastUpdatedTime', 'type': 'str'}, + 'rule_definitions': {'key': 'properties.RuleDefinitions', 'type': 'ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentProactiveDetectionConfiguration, self).__init__(**kwargs) + self.id = None + self.name = kwargs.get('name', None) + self.type = None + self.location = kwargs.get('location', None) + self.name1 = None + self.enabled = kwargs.get('enabled', None) + self.send_emails_to_subscription_owners = kwargs.get('send_emails_to_subscription_owners', None) + self.custom_emails = kwargs.get('custom_emails', None) + self.last_updated_time = None + self.rule_definitions = kwargs.get('rule_definitions', None) + + +class ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions(Model): + """Static definitions of the ProactiveDetection configuration rule (same + values for all components). + + :param name: The rule name + :type name: str + :param display_name: The rule name as it is displayed in UI + :type display_name: str + :param description: The rule description + :type description: str + :param help_url: URL which displays additional info about the proactive + detection rule + :type help_url: str + :param is_hidden: A flag indicating whether the rule is hidden (from the + UI) + :type is_hidden: bool + :param is_enabled_by_default: A flag indicating whether the rule is + enabled by default + :type is_enabled_by_default: bool + :param is_in_preview: A flag indicating whether the rule is in preview + :type is_in_preview: bool + :param supports_email_notifications: A flag indicating whether email + notifications are supported for detections for this rule + :type supports_email_notifications: bool + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'display_name': {'key': 'DisplayName', 'type': 'str'}, + 'description': {'key': 'Description', 'type': 'str'}, + 'help_url': {'key': 'HelpUrl', 'type': 'str'}, + 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, + 'is_enabled_by_default': {'key': 'IsEnabledByDefault', 'type': 'bool'}, + 'is_in_preview': {'key': 'IsInPreview', 'type': 'bool'}, + 'supports_email_notifications': {'key': 'SupportsEmailNotifications', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.help_url = kwargs.get('help_url', None) + self.is_hidden = kwargs.get('is_hidden', None) + self.is_enabled_by_default = kwargs.get('is_enabled_by_default', None) + self.is_in_preview = kwargs.get('is_in_preview', None) + self.supports_email_notifications = kwargs.get('supports_email_notifications', None) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ComponentPurgeBody(Model): + """Describes the body of a purge request for an App Insights component. + + All required parameters must be populated in order to send to Azure. + + :param table: Required. Table from which to purge data. + :type table: str + :param filters: Required. The set of columns and filters (queries) to run + over them to purge the resulting data. + :type filters: + list[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ComponentPurgeBodyFilters] + """ + + _validation = { + 'table': {'required': True}, + 'filters': {'required': True}, + } + + _attribute_map = { + 'table': {'key': 'table', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': '[ComponentPurgeBodyFilters]'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeBody, self).__init__(**kwargs) + self.table = kwargs.get('table', None) + self.filters = kwargs.get('filters', None) + + +class ComponentPurgeBodyFilters(Model): + """User-defined filters to return data which will be purged from the table. + + :param column: The column of the table over which the given query should + run + :type column: str + :param operator: A query operator to evaluate over the provided column and + value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, + and have the same behavior as they would in a KQL query. + :type operator: str + :param value: the value for the operator to function over. This can be a + number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of + values. + :type value: object + :param key: When filtering over custom dimensions, this key will be used + as the name of the custom dimension. + :type key: str + """ + + _attribute_map = { + 'column': {'key': 'column', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeBodyFilters, self).__init__(**kwargs) + self.column = kwargs.get('column', None) + self.operator = kwargs.get('operator', None) + self.value = kwargs.get('value', None) + self.key = kwargs.get('key', None) + + +class ComponentPurgeResponse(Model): + """Response containing operationId for a specific purge action. + + All required parameters must be populated in order to send to Azure. + + :param operation_id: Required. Id to use when querying for status for a + particular purge operation. + :type operation_id: str + """ + + _validation = { + 'operation_id': {'required': True}, + } + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeResponse, self).__init__(**kwargs) + self.operation_id = kwargs.get('operation_id', None) + + +class ComponentPurgeStatusResponse(Model): + """Response containing status for a specific purge operation. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Status of the operation represented by the + requested Id. Possible values include: 'pending', 'completed' + :type status: str or + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.PurgeState + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeStatusResponse, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + + +class PrivateLinkScopedResource(Model): + """The private link scope resource reference. + + :param resource_id: The full resource Id of the private link scope + resource. + :type resource_id: str + :param scope_id: The private link scope unique Identifier. + :type scope_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'ResourceId', 'type': 'str'}, + 'scope_id': {'key': 'ScopeId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkScopedResource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.scope_id = kwargs.get('scope_id', None) + + +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a WebTest instance. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TagsResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_models_py3.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_models_py3.py new file mode 100644 index 00000000000..ce015182f99 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_models_py3.py @@ -0,0 +1,489 @@ +# 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 + + +class ComponentsResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(ComponentsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class ApplicationInsightsComponent(ComponentsResource): + """An Application Insights component definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. The kind of application that this component refers + to, used to customize UI. This value is a freeform string, values should + typically be one of the following: web, ios, other, store, java, phone. + :type kind: str + :ivar application_id: The unique ID of your application. This field + mirrors the 'Name' field and cannot be changed. + :vartype application_id: str + :ivar app_id: Application Insights Unique ID for your Application. + :vartype app_id: str + :param application_type: Required. Type of application being monitored. + Possible values include: 'web', 'other'. Default value: "web" . + :type application_type: str or + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationType + :param flow_type: Used by the Application Insights system to determine + what kind of flow this component was created by. This is to be set to + 'Bluefield' when creating/updating a component via the REST API. Possible + values include: 'Bluefield'. Default value: "Bluefield" . + :type flow_type: str or + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.FlowType + :param request_source: Describes what tool created this Application + Insights component. Customers using this API should set this to the + default 'rest'. Possible values include: 'rest'. Default value: "rest" . + :type request_source: str or + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.RequestSource + :ivar instrumentation_key: Application Insights Instrumentation key. A + read-only value that applications can use to identify the destination for + all telemetry sent to Azure Application Insights. This value will be + supplied upon construction of each new Application Insights component. + :vartype instrumentation_key: str + :ivar creation_date: Creation Date for the Application Insights component, + in ISO 8601 format. + :vartype creation_date: datetime + :ivar tenant_id: Azure Tenant Id. + :vartype tenant_id: str + :param hockey_app_id: The unique application ID created when a new + application is added to HockeyApp, used for communications with HockeyApp. + :type hockey_app_id: str + :ivar hockey_app_token: Token used to authenticate communications with + between Application Insights and HockeyApp. + :vartype hockey_app_token: str + :ivar provisioning_state: Current state of this component: whether or not + is has been provisioned within the resource group it is defined. Users + cannot change this value but are able to read from it. Values will include + Succeeded, Deploying, Canceled, and Failed. + :vartype provisioning_state: str + :param sampling_percentage: Percentage of the data produced by the + application being monitored that is being sampled for Application Insights + telemetry. + :type sampling_percentage: float + :ivar connection_string: Application Insights component connection string. + :vartype connection_string: str + :param retention_in_days: Retention period in days. Default value: 90 . + :type retention_in_days: int + :param disable_ip_masking: Disable IP masking. + :type disable_ip_masking: bool + :param immediate_purge_data_on30_days: Purge data immediately after 30 + days. + :type immediate_purge_data_on30_days: bool + :ivar private_link_scoped_resources: List of linked private link scope + resources. + :vartype private_link_scoped_resources: + list[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.PrivateLinkScopedResource] + :param public_network_access_for_ingestion: The network access type for + accessing Application Insights ingestion. Possible values include: + 'Enabled', 'Disabled'. Default value: "Enabled" . + :type public_network_access_for_ingestion: str or + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.PublicNetworkAccessType + :param public_network_access_for_query: The network access type for + accessing Application Insights query. Possible values include: 'Enabled', + 'Disabled'. Default value: "Enabled" . + :type public_network_access_for_query: str or + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.PublicNetworkAccessType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'application_id': {'readonly': True}, + 'app_id': {'readonly': True}, + 'application_type': {'required': True}, + 'instrumentation_key': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'hockey_app_token': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'connection_string': {'readonly': True}, + 'private_link_scoped_resources': {'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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'application_id': {'key': 'properties.ApplicationId', 'type': 'str'}, + 'app_id': {'key': 'properties.AppId', 'type': 'str'}, + 'application_type': {'key': 'properties.Application_Type', 'type': 'str'}, + 'flow_type': {'key': 'properties.Flow_Type', 'type': 'str'}, + 'request_source': {'key': 'properties.Request_Source', 'type': 'str'}, + 'instrumentation_key': {'key': 'properties.InstrumentationKey', 'type': 'str'}, + 'creation_date': {'key': 'properties.CreationDate', 'type': 'iso-8601'}, + 'tenant_id': {'key': 'properties.TenantId', 'type': 'str'}, + 'hockey_app_id': {'key': 'properties.HockeyAppId', 'type': 'str'}, + 'hockey_app_token': {'key': 'properties.HockeyAppToken', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sampling_percentage': {'key': 'properties.SamplingPercentage', 'type': 'float'}, + 'connection_string': {'key': 'properties.ConnectionString', 'type': 'str'}, + 'retention_in_days': {'key': 'properties.RetentionInDays', 'type': 'int'}, + 'disable_ip_masking': {'key': 'properties.DisableIpMasking', 'type': 'bool'}, + 'immediate_purge_data_on30_days': {'key': 'properties.ImmediatePurgeDataOn30Days', 'type': 'bool'}, + 'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'}, + 'public_network_access_for_ingestion': {'key': 'properties.publicNetworkAccessForIngestion', 'type': 'str'}, + 'public_network_access_for_query': {'key': 'properties.publicNetworkAccessForQuery', 'type': 'str'}, + } + + def __init__(self, *, location: str, kind: str, tags=None, application_type="web", flow_type="Bluefield", request_source="rest", hockey_app_id: str=None, sampling_percentage: float=None, retention_in_days: int=90, disable_ip_masking: bool=None, immediate_purge_data_on30_days: bool=None, public_network_access_for_ingestion="Enabled", public_network_access_for_query="Enabled", **kwargs) -> None: + super(ApplicationInsightsComponent, self).__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.application_id = None + self.app_id = None + self.application_type = application_type + self.flow_type = flow_type + self.request_source = request_source + self.instrumentation_key = None + self.creation_date = None + self.tenant_id = None + self.hockey_app_id = hockey_app_id + self.hockey_app_token = None + self.provisioning_state = None + self.sampling_percentage = sampling_percentage + self.connection_string = None + self.retention_in_days = retention_in_days + self.disable_ip_masking = disable_ip_masking + self.immediate_purge_data_on30_days = immediate_purge_data_on30_days + self.private_link_scoped_resources = None + self.public_network_access_for_ingestion = public_network_access_for_ingestion + self.public_network_access_for_query = public_network_access_for_query + + +class ApplicationInsightsComponentProactiveDetectionConfiguration(Model): + """A ProactiveDetection configuration definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :param name: Azure resource name + :type name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Resource location + :type location: str + :ivar name1: The rule name + :vartype name1: str + :param enabled: A flag that indicates whether this rule is enabled by the + user + :type enabled: bool + :param send_emails_to_subscription_owners: A flag that indicated whether + notifications on this rule should be sent to subscription owners + :type send_emails_to_subscription_owners: bool + :param custom_emails: Custom email addresses for this rule notifications + :type custom_emails: list[str] + :ivar last_updated_time: The last time this rule was updated + :vartype last_updated_time: str + :param rule_definitions: Static definitions of the ProactiveDetection + configuration rule (same values for all components). + :type rule_definitions: + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name1': {'readonly': True}, + 'last_updated_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name1': {'key': 'properties.Name', 'type': 'str'}, + 'enabled': {'key': 'properties.Enabled', 'type': 'bool'}, + 'send_emails_to_subscription_owners': {'key': 'properties.SendEmailsToSubscriptionOwners', 'type': 'bool'}, + 'custom_emails': {'key': 'properties.CustomEmails', 'type': '[str]'}, + 'last_updated_time': {'key': 'properties.LastUpdatedTime', 'type': 'str'}, + 'rule_definitions': {'key': 'properties.RuleDefinitions', 'type': 'ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions'}, + } + + def __init__(self, *, name: str=None, location: str=None, enabled: bool=None, send_emails_to_subscription_owners: bool=None, custom_emails=None, rule_definitions=None, **kwargs) -> None: + super(ApplicationInsightsComponentProactiveDetectionConfiguration, self).__init__(**kwargs) + self.id = None + self.name = name + self.type = None + self.location = location + self.name1 = None + self.enabled = enabled + self.send_emails_to_subscription_owners = send_emails_to_subscription_owners + self.custom_emails = custom_emails + self.last_updated_time = None + self.rule_definitions = rule_definitions + + +class ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions(Model): + """Static definitions of the ProactiveDetection configuration rule (same + values for all components). + + :param name: The rule name + :type name: str + :param display_name: The rule name as it is displayed in UI + :type display_name: str + :param description: The rule description + :type description: str + :param help_url: URL which displays additional info about the proactive + detection rule + :type help_url: str + :param is_hidden: A flag indicating whether the rule is hidden (from the + UI) + :type is_hidden: bool + :param is_enabled_by_default: A flag indicating whether the rule is + enabled by default + :type is_enabled_by_default: bool + :param is_in_preview: A flag indicating whether the rule is in preview + :type is_in_preview: bool + :param supports_email_notifications: A flag indicating whether email + notifications are supported for detections for this rule + :type supports_email_notifications: bool + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str'}, + 'display_name': {'key': 'DisplayName', 'type': 'str'}, + 'description': {'key': 'Description', 'type': 'str'}, + 'help_url': {'key': 'HelpUrl', 'type': 'str'}, + 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, + 'is_enabled_by_default': {'key': 'IsEnabledByDefault', 'type': 'bool'}, + 'is_in_preview': {'key': 'IsInPreview', 'type': 'bool'}, + 'supports_email_notifications': {'key': 'SupportsEmailNotifications', 'type': 'bool'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, description: str=None, help_url: str=None, is_hidden: bool=None, is_enabled_by_default: bool=None, is_in_preview: bool=None, supports_email_notifications: bool=None, **kwargs) -> None: + super(ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.description = description + self.help_url = help_url + self.is_hidden = is_hidden + self.is_enabled_by_default = is_enabled_by_default + self.is_in_preview = is_in_preview + self.supports_email_notifications = supports_email_notifications + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ComponentPurgeBody(Model): + """Describes the body of a purge request for an App Insights component. + + All required parameters must be populated in order to send to Azure. + + :param table: Required. Table from which to purge data. + :type table: str + :param filters: Required. The set of columns and filters (queries) to run + over them to purge the resulting data. + :type filters: + list[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ComponentPurgeBodyFilters] + """ + + _validation = { + 'table': {'required': True}, + 'filters': {'required': True}, + } + + _attribute_map = { + 'table': {'key': 'table', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': '[ComponentPurgeBodyFilters]'}, + } + + def __init__(self, *, table: str, filters, **kwargs) -> None: + super(ComponentPurgeBody, self).__init__(**kwargs) + self.table = table + self.filters = filters + + +class ComponentPurgeBodyFilters(Model): + """User-defined filters to return data which will be purged from the table. + + :param column: The column of the table over which the given query should + run + :type column: str + :param operator: A query operator to evaluate over the provided column and + value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, + and have the same behavior as they would in a KQL query. + :type operator: str + :param value: the value for the operator to function over. This can be a + number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of + values. + :type value: object + :param key: When filtering over custom dimensions, this key will be used + as the name of the custom dimension. + :type key: str + """ + + _attribute_map = { + 'column': {'key': 'column', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__(self, *, column: str=None, operator: str=None, value=None, key: str=None, **kwargs) -> None: + super(ComponentPurgeBodyFilters, self).__init__(**kwargs) + self.column = column + self.operator = operator + self.value = value + self.key = key + + +class ComponentPurgeResponse(Model): + """Response containing operationId for a specific purge action. + + All required parameters must be populated in order to send to Azure. + + :param operation_id: Required. Id to use when querying for status for a + particular purge operation. + :type operation_id: str + """ + + _validation = { + 'operation_id': {'required': True}, + } + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + } + + def __init__(self, *, operation_id: str, **kwargs) -> None: + super(ComponentPurgeResponse, self).__init__(**kwargs) + self.operation_id = operation_id + + +class ComponentPurgeStatusResponse(Model): + """Response containing status for a specific purge operation. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Status of the operation represented by the + requested Id. Possible values include: 'pending', 'completed' + :type status: str or + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.PurgeState + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, status, **kwargs) -> None: + super(ComponentPurgeStatusResponse, self).__init__(**kwargs) + self.status = status + + +class PrivateLinkScopedResource(Model): + """The private link scope resource reference. + + :param resource_id: The full resource Id of the private link scope + resource. + :type resource_id: str + :param scope_id: The private link scope unique Identifier. + :type scope_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'ResourceId', 'type': 'str'}, + 'scope_id': {'key': 'ScopeId', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str=None, scope_id: str=None, **kwargs) -> None: + super(PrivateLinkScopedResource, self).__init__(**kwargs) + self.resource_id = resource_id + self.scope_id = scope_id + + +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a WebTest instance. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsResource, self).__init__(**kwargs) + self.tags = tags diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_paged.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_paged_models.py similarity index 88% rename from src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_paged.py rename to src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_paged_models.py index 7283609bd08..5f0557dea71 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_paged.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_paged_models.py @@ -14,7 +14,7 @@ class ApplicationInsightsComponentPaged(Paged): """ - A paging container for iterating over a list of :class:`ApplicationInsightsComponent ` object + A paging container for iterating over a list of :class:`ApplicationInsightsComponent ` object """ _attribute_map = { diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/operations/__init__.py new file mode 100644 index 00000000000..6ed05ddaf00 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/operations/__init__.py @@ -0,0 +1,18 @@ +# 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 ._proactive_detection_configurations_operations import ProactiveDetectionConfigurationsOperations +from ._components_operations import ComponentsOperations + +__all__ = [ + 'ProactiveDetectionConfigurationsOperations', + 'ComponentsOperations', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/operations/_components_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/operations/_components_operations.py new file mode 100644 index 00000000000..1b13e0be0ab --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/operations/_components_operations.py @@ -0,0 +1,598 @@ +# 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 ComponentsOperations(object): + """ComponentsOperations 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: The API version to use for this operation. Constant value: "2018-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of all Application Insights components within a + subscription. + + :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 ApplicationInsightsComponent + :rtype: + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentPaged[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponent] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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.ApplicationInsightsComponentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/components'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of Application Insights components within a resource group. + + :param resource_group_name: The name of the resource group. 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: An iterator like instance of ApplicationInsightsComponent + :rtype: + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentPaged[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponent] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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.ApplicationInsightsComponentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components'} + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Deletes an Application Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Returns an Application Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: ApplicationInsightsComponent or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponent + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponent', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} + + def create_or_update( + self, resource_group_name, resource_name, insight_properties, custom_headers=None, raw=False, **operation_config): + """Creates (or updates) an Application Insights component. Note: You + cannot specify a different value for InstrumentationKey nor AppId in + the Put operation. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param insight_properties: Properties that need to be specified to + create an Application Insights component. + :type insight_properties: + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponent + :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: ApplicationInsightsComponent or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponent + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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(insight_properties, 'ApplicationInsightsComponent') + + # 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, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponent', response) + if response.status_code == 201: + deserialized = self._deserialize('ApplicationInsightsComponent', 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.Insights/components/{resourceName}'} + + def update_tags( + self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates an existing component's tags. To update other fields use the + CreateOrUpdate method. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationInsightsComponent or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponent + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + component_tags = models.TagsResource(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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(component_tags, 'TagsResource') + + # 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, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponent', response) + if response.status_code == 201: + deserialized = self._deserialize('ApplicationInsightsComponent', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} + + def purge( + self, resource_group_name, resource_name, table, filters, custom_headers=None, raw=False, **operation_config): + """Purges data in an Application Insights component by a set of + user-defined filters. + In order to manage system resources, purge requests are throttled at 50 + requests per hour. You should batch the execution of purge requests by + sending a single command whose predicate includes all user identities + that require purging. Use the in operator to specify multiple + identities. You should run the query prior to using for a purge request + to verify that the results are expected. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param table: Table from which to purge data. + :type table: str + :param filters: The set of columns and filters (queries) to run over + them to purge the resulting data. + :type filters: + list[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ComponentPurgeBodyFilters] + :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: ComponentPurgeResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ComponentPurgeResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = models.ComponentPurgeBody(table=table, filters=filters) + + # Construct URL + url = self.purge.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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(body, 'ComponentPurgeBody') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 202: + deserialized = self._deserialize('ComponentPurgeResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge'} + + def get_purge_status( + self, resource_group_name, resource_name, purge_id, custom_headers=None, raw=False, **operation_config): + """Get status for an ongoing purge operation. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param purge_id: In a purge status request, this is the Id of the + operation the status of which is returned. + :type purge_id: 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: ComponentPurgeStatusResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ComponentPurgeStatusResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_purge_status.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'purgeId': self._serialize.url("purge_id", purge_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ComponentPurgeStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_purge_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/operations/_proactive_detection_configurations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/operations/_proactive_detection_configurations_operations.py new file mode 100644 index 00000000000..1c55d15e5dc --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/operations/_proactive_detection_configurations_operations.py @@ -0,0 +1,251 @@ +# 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 ProactiveDetectionConfigurationsOperations(object): + """ProactiveDetectionConfigurationsOperations 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: The API version to use for this operation. Constant value: "2018-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-05-01-preview" + + self.config = config + + def list( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of ProactiveDetection configurations of an Application + Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: list or ClientRawResponse if raw=true + :rtype: + list[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentProactiveDetectionConfiguration] + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[ApplicationInsightsComponentProactiveDetectionConfiguration]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs'} + + def get( + self, resource_group_name, resource_name, configuration_id, custom_headers=None, raw=False, **operation_config): + """Get the ProactiveDetection configuration for this configuration id. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param configuration_id: The ProactiveDetection configuration ID. This + is unique within a Application Insights component. + :type configuration_id: 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: ApplicationInsightsComponentProactiveDetectionConfiguration + or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentProactiveDetectionConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'ConfigurationId': self._serialize.url("configuration_id", configuration_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentProactiveDetectionConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} + + def update( + self, resource_group_name, resource_name, configuration_id, proactive_detection_properties, custom_headers=None, raw=False, **operation_config): + """Update the ProactiveDetection configuration for this configuration id. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param configuration_id: The ProactiveDetection configuration ID. This + is unique within a Application Insights component. + :type configuration_id: str + :param proactive_detection_properties: Properties that need to be + specified to update the ProactiveDetection configuration. + :type proactive_detection_properties: + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentProactiveDetectionConfiguration + :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: ApplicationInsightsComponentProactiveDetectionConfiguration + or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentProactiveDetectionConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'ConfigurationId': self._serialize.url("configuration_id", configuration_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', min_length=1) + + # 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(proactive_detection_properties, 'ApplicationInsightsComponentProactiveDetectionConfiguration') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponentProactiveDetectionConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/version.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/version.py new file mode 100644 index 00000000000..7921c843fb5 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/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 = "2018-05-01-preview" + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/__init__.py new file mode 100644 index 00000000000..298512941d9 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/__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 ApplicationInsightsManagementClientConfiguration +from ._application_insights_management_client import ApplicationInsightsManagementClient +__all__ = ['ApplicationInsightsManagementClient', 'ApplicationInsightsManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/_application_insights_management_client.py new file mode 100644 index 00000000000..8cb035be52a --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/_application_insights_management_client.py @@ -0,0 +1,49 @@ +# 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 ApplicationInsightsManagementClientConfiguration +from .operations import WorkbooksOperations +from . import models + + +class ApplicationInsightsManagementClient(SDKClient): + """Composite Swagger for Application Insights Management Client + + :ivar config: Configuration for client. + :vartype config: ApplicationInsightsManagementClientConfiguration + + :ivar workbooks: Workbooks operations + :vartype workbooks: azure.mgmt.applicationinsights.v2018_06_17_preview.operations.WorkbooksOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ApplicationInsightsManagementClientConfiguration(credentials, subscription_id, base_url) + super(ApplicationInsightsManagementClient, 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 = '2018-06-17-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.workbooks = WorkbooksOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/_configuration.py new file mode 100644 index 00000000000..6c855295a4b --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/_configuration.py @@ -0,0 +1,48 @@ +# 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 ApplicationInsightsManagementClientConfiguration(AzureConfiguration): + """Configuration for ApplicationInsightsManagementClient + 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: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(ApplicationInsightsManagementClientConfiguration, 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-applicationinsights/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/__init__.py new file mode 100644 index 00000000000..90b398780bc --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/__init__.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import ErrorFieldContract + from ._models_py3 import Resource + from ._models_py3 import Workbook + from ._models_py3 import WorkbookError, WorkbookErrorException + from ._models_py3 import WorkbookUpdateParameters +except (SyntaxError, ImportError): + from ._models import ErrorFieldContract + from ._models import Resource + from ._models import Workbook + from ._models import WorkbookError, WorkbookErrorException + from ._models import WorkbookUpdateParameters +from ._paged_models import WorkbookPaged +from ._application_insights_management_client_enums import ( + SharedTypeKind, + CategoryType, +) + +__all__ = [ + 'ErrorFieldContract', + 'Resource', + 'Workbook', + 'WorkbookError', 'WorkbookErrorException', + 'WorkbookUpdateParameters', + 'WorkbookPaged', + 'SharedTypeKind', + 'CategoryType', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_management_client_enums.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_application_insights_management_client_enums.py similarity index 67% rename from src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_management_client_enums.py rename to src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_application_insights_management_client_enums.py index fdb344ca6bf..9543a1c3d43 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_management_client_enums.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_application_insights_management_client_enums.py @@ -12,23 +12,15 @@ from enum import Enum -class ApplicationType(Enum): +class SharedTypeKind(str, Enum): - web = "web" - other = "other" + user = "user" + shared = "shared" -class FlowType(Enum): +class CategoryType(str, Enum): - bluefield = "Bluefield" - - -class RequestSource(Enum): - - rest = "rest" - - -class WebTestKind(Enum): - - ping = "ping" - multistep = "multistep" + workbook = "workbook" + tsg = "TSG" + performance = "performance" + retention = "retention" diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_models.py new file mode 100644 index 00000000000..a1c45697859 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_models.py @@ -0,0 +1,261 @@ +# 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 CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorFieldContract(Model): + """Error Field contract. + + :param code: Property level error code. + :type code: str + :param message: Human-readable representation of property-level error. + :type message: str + :param target: Property name. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorFieldContract, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + + +class Resource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name. This is GUID value. The display name + should be assigned within properties field. + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param kind: The kind of workbook. Choices are user and shared. Possible + values include: 'user', 'shared' + :type kind: str or + ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.SharedTypeKind + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class Workbook(Resource): + """An Application Insights workbook definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name. This is GUID value. The display name + should be assigned within properties field. + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param kind: The kind of workbook. Choices are user and shared. Possible + values include: 'user', 'shared' + :type kind: str or + ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.SharedTypeKind + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param display_name: Required. The user-defined name (display name) of the + workbook. + :type display_name: str + :param serialized_data: Required. Configuration of this particular + workbook. Configuration data is a string containing valid JSON + :type serialized_data: str + :ivar time_modified: Date and time in UTC of the last modification that + was made to this workbook definition. + :vartype time_modified: str + :param category: Required. Workbook category, as defined by the user at + creation time. + :type category: str + :param version: Workbook version + :type version: str + :param workbook_tags: A list of 0 or more tags that are associated with + this workbook definition + :type workbook_tags: list[str] + :param user_id: Required. Unique user id of the specific user that owns + this workbook. + :type user_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'display_name': {'required': True}, + 'serialized_data': {'required': True}, + 'time_modified': {'readonly': True}, + 'category': {'required': True}, + 'user_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'workbook_tags': {'key': 'properties.tags', 'type': '[str]'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Workbook, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.serialized_data = kwargs.get('serialized_data', None) + self.time_modified = None + self.category = kwargs.get('category', None) + self.version = kwargs.get('version', None) + self.workbook_tags = kwargs.get('workbook_tags', None) + self.user_id = kwargs.get('user_id', None) + + +class WorkbookError(Model): + """Error message body that will indicate why the operation failed. + + :param code: Service-defined error code. This code serves as a sub-status + for the HTTP error code specified in the response. + :type code: str + :param message: Human-readable representation of the error. + :type message: str + :param details: The list of invalid fields send in request, in case of + validation error. + :type details: + list[~azure.mgmt.applicationinsights.v2018_06_17_preview.models.ErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + } + + def __init__(self, **kwargs): + super(WorkbookError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class WorkbookErrorException(HttpOperationError): + """Server responsed with exception of type: 'WorkbookError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(WorkbookErrorException, self).__init__(deserialize, response, 'WorkbookError', *args) + + +class WorkbookUpdateParameters(Model): + """The parameters that can be provided when updating workbook properties + properties. + + :param kind: The kind of workbook. Choices are user and shared. Possible + values include: 'user', 'shared' + :type kind: str or + ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.SharedTypeKind + :param tags: Resource tags + :type tags: dict[str, str] + :param display_name: The user-defined name (display name) of the workbook. + :type display_name: str + :param serialized_data: Configuration of this particular workbook. + Configuration data is a string containing valid JSON + :type serialized_data: str + :param category: Workbook category, as defined by the user at creation + time. + :type category: str + :param tags1: A list of 0 or more tags that are associated with this + workbook definition + :type tags1: list[str] + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'tags1': {'key': 'properties.tags', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(WorkbookUpdateParameters, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.tags = kwargs.get('tags', None) + self.display_name = kwargs.get('display_name', None) + self.serialized_data = kwargs.get('serialized_data', None) + self.category = kwargs.get('category', None) + self.tags1 = kwargs.get('tags1', None) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_models_py3.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_models_py3.py new file mode 100644 index 00000000000..59055e5e800 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_models_py3.py @@ -0,0 +1,261 @@ +# 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 CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorFieldContract(Model): + """Error Field contract. + + :param code: Property level error code. + :type code: str + :param message: Human-readable representation of property-level error. + :type message: str + :param target: Property name. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, **kwargs) -> None: + super(ErrorFieldContract, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + + +class Resource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name. This is GUID value. The display name + should be assigned within properties field. + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param kind: The kind of workbook. Choices are user and shared. Possible + values include: 'user', 'shared' + :type kind: str or + ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.SharedTypeKind + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, kind=None, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.kind = kind + self.location = location + self.tags = tags + + +class Workbook(Resource): + """An Application Insights workbook definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name. This is GUID value. The display name + should be assigned within properties field. + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param kind: The kind of workbook. Choices are user and shared. Possible + values include: 'user', 'shared' + :type kind: str or + ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.SharedTypeKind + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param display_name: Required. The user-defined name (display name) of the + workbook. + :type display_name: str + :param serialized_data: Required. Configuration of this particular + workbook. Configuration data is a string containing valid JSON + :type serialized_data: str + :ivar time_modified: Date and time in UTC of the last modification that + was made to this workbook definition. + :vartype time_modified: str + :param category: Required. Workbook category, as defined by the user at + creation time. + :type category: str + :param version: Workbook version + :type version: str + :param workbook_tags: A list of 0 or more tags that are associated with + this workbook definition + :type workbook_tags: list[str] + :param user_id: Required. Unique user id of the specific user that owns + this workbook. + :type user_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'display_name': {'required': True}, + 'serialized_data': {'required': True}, + 'time_modified': {'readonly': True}, + 'category': {'required': True}, + 'user_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'workbook_tags': {'key': 'properties.tags', 'type': '[str]'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + } + + def __init__(self, *, location: str, display_name: str, serialized_data: str, category: str, user_id: str, kind=None, tags=None, version: str=None, workbook_tags=None, **kwargs) -> None: + super(Workbook, self).__init__(kind=kind, location=location, tags=tags, **kwargs) + self.display_name = display_name + self.serialized_data = serialized_data + self.time_modified = None + self.category = category + self.version = version + self.workbook_tags = workbook_tags + self.user_id = user_id + + +class WorkbookError(Model): + """Error message body that will indicate why the operation failed. + + :param code: Service-defined error code. This code serves as a sub-status + for the HTTP error code specified in the response. + :type code: str + :param message: Human-readable representation of the error. + :type message: str + :param details: The list of invalid fields send in request, in case of + validation error. + :type details: + list[~azure.mgmt.applicationinsights.v2018_06_17_preview.models.ErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + } + + def __init__(self, *, code: str=None, message: str=None, details=None, **kwargs) -> None: + super(WorkbookError, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class WorkbookErrorException(HttpOperationError): + """Server responsed with exception of type: 'WorkbookError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(WorkbookErrorException, self).__init__(deserialize, response, 'WorkbookError', *args) + + +class WorkbookUpdateParameters(Model): + """The parameters that can be provided when updating workbook properties + properties. + + :param kind: The kind of workbook. Choices are user and shared. Possible + values include: 'user', 'shared' + :type kind: str or + ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.SharedTypeKind + :param tags: Resource tags + :type tags: dict[str, str] + :param display_name: The user-defined name (display name) of the workbook. + :type display_name: str + :param serialized_data: Configuration of this particular workbook. + Configuration data is a string containing valid JSON + :type serialized_data: str + :param category: Workbook category, as defined by the user at creation + time. + :type category: str + :param tags1: A list of 0 or more tags that are associated with this + workbook definition + :type tags1: list[str] + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'tags1': {'key': 'properties.tags', 'type': '[str]'}, + } + + def __init__(self, *, kind=None, tags=None, display_name: str=None, serialized_data: str=None, category: str=None, tags1=None, **kwargs) -> None: + super(WorkbookUpdateParameters, self).__init__(**kwargs) + self.kind = kind + self.tags = tags + self.display_name = display_name + self.serialized_data = serialized_data + self.category = category + self.tags1 = tags1 diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_paged_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_paged_models.py new file mode 100644 index 00000000000..e09ec5de4fb --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/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 WorkbookPaged(Paged): + """ + A paging container for iterating over a list of :class:`Workbook ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Workbook]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkbookPaged, self).__init__(*args, **kwargs) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/operations/__init__.py new file mode 100644 index 00000000000..fde86e919a6 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/operations/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._workbooks_operations import WorkbooksOperations + +__all__ = [ + 'WorkbooksOperations', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/operations/_workbooks_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/operations/_workbooks_operations.py new file mode 100644 index 00000000000..18e678e0603 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/operations/_workbooks_operations.py @@ -0,0 +1,400 @@ +# 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 WorkbooksOperations(object): + """WorkbooksOperations 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: The API version to use for this operation. Constant value: "2018-06-17-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-17-preview" + + self.config = config + + def list_by_resource_group( + self, resource_group_name, category, source_id, tags=None, can_fetch_content=None, custom_headers=None, raw=False, **operation_config): + """Get all Workbooks defined within a specified resource group and + category. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param category: Category of workbook to return. Possible values + include: 'workbook', 'TSG', 'performance', 'retention' + :type category: str or + ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.CategoryType + :param source_id: Azure Resource Id that will fetch all related + workbooks. + :type source_id: str + :param tags: Tags presents on each workbook returned. + :type tags: list[str] + :param can_fetch_content: Flag indicating whether or not to return the + full content for each applicable workbook. If false, only return + summary content for workbooks. + :type can_fetch_content: bool + :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 Workbook + :rtype: + ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.WorkbookPaged[~azure.mgmt.applicationinsights.v2018_06_17_preview.models.Workbook] + :raises: + :class:`WorkbookErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['category'] = self._serialize.query("category", category, 'str') + if tags is not None: + query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') + query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') + if can_fetch_content is not None: + query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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]: + raise models.WorkbookErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WorkbookPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks'} + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get a single workbook by its resourceName. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: Workbook or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.Workbook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`WorkbookErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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.WorkbookErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Workbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Delete a workbook. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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:`WorkbookErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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 [201, 204]: + raise models.WorkbookErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + + def create_or_update( + self, resource_group_name, resource_name, source_id, workbook_properties, custom_headers=None, raw=False, **operation_config): + """Create a new workbook. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param source_id: Azure Resource Id that will fetch all related + workbooks. + :type source_id: str + :param workbook_properties: Properties that need to be specified to + create a new workbook. + :type workbook_properties: + ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.Workbook + :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: Workbook or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.Workbook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`WorkbookErrorException` + """ + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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(workbook_properties, 'Workbook') + + # 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, 201]: + raise models.WorkbookErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Workbook', response) + if response.status_code == 201: + deserialized = self._deserialize('Workbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} + + def update( + self, resource_group_name, resource_name, source_id, workbook_update_parameters=None, custom_headers=None, raw=False, **operation_config): + """Updates a workbook that has already been added. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param source_id: Azure Resource Id that will fetch all related + workbooks. + :type source_id: str + :param workbook_update_parameters: Properties that need to be + specified to create a new workbook. + :type workbook_update_parameters: + ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.WorkbookUpdateParameters + :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: Workbook or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.Workbook or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`WorkbookErrorException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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 + if workbook_update_parameters is not None: + body_content = self._serialize.body(workbook_update_parameters, 'WorkbookUpdateParameters') + else: + body_content = None + + # 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.WorkbookErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Workbook', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/version.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/version.py new file mode 100644 index 00000000000..a3fe5c0e22e --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/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 = "2018-06-17-preview" + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/__init__.py new file mode 100644 index 00000000000..298512941d9 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/__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 ApplicationInsightsManagementClientConfiguration +from ._application_insights_management_client import ApplicationInsightsManagementClient +__all__ = ['ApplicationInsightsManagementClient', 'ApplicationInsightsManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/_application_insights_management_client.py new file mode 100644 index 00000000000..97b6838e03d --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/_application_insights_management_client.py @@ -0,0 +1,54 @@ +# 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 ApplicationInsightsManagementClientConfiguration +from .operations import QueriesOperations +from .operations import QueryPacksOperations +from . import models + + +class ApplicationInsightsManagementClient(SDKClient): + """Composite Swagger for Application Insights Management Client + + :ivar config: Configuration for client. + :vartype config: ApplicationInsightsManagementClientConfiguration + + :ivar queries: Queries operations + :vartype queries: azure.mgmt.applicationinsights.v2019_09_01_preview.operations.QueriesOperations + :ivar query_packs: QueryPacks operations + :vartype query_packs: azure.mgmt.applicationinsights.v2019_09_01_preview.operations.QueryPacksOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ApplicationInsightsManagementClientConfiguration(credentials, subscription_id, base_url) + super(ApplicationInsightsManagementClient, 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 = '2019-09-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.queries = QueriesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.query_packs = QueryPacksOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/_configuration.py new file mode 100644 index 00000000000..6c855295a4b --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/_configuration.py @@ -0,0 +1,48 @@ +# 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 ApplicationInsightsManagementClientConfiguration(AzureConfiguration): + """Configuration for ApplicationInsightsManagementClient + 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: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(ApplicationInsightsManagementClientConfiguration, 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-applicationinsights/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/models/__init__.py new file mode 100644 index 00000000000..1295c33096a --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/models/__init__.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AzureResourceProperties + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import LogAnalyticsQueryPack + from ._models_py3 import LogAnalyticsQueryPackQuery + from ._models_py3 import LogAnalyticsQueryPackQuerySearchProperties + from ._models_py3 import QueryPacksResource + from ._models_py3 import TagsResource +except (SyntaxError, ImportError): + from ._models import AzureResourceProperties + from ._models import ErrorResponse, ErrorResponseException + from ._models import LogAnalyticsQueryPack + from ._models import LogAnalyticsQueryPackQuery + from ._models import LogAnalyticsQueryPackQuerySearchProperties + from ._models import QueryPacksResource + from ._models import TagsResource +from ._paged_models import LogAnalyticsQueryPackPaged +from ._paged_models import LogAnalyticsQueryPackQueryPaged + +__all__ = [ + 'AzureResourceProperties', + 'ErrorResponse', 'ErrorResponseException', + 'LogAnalyticsQueryPack', + 'LogAnalyticsQueryPackQuery', + 'LogAnalyticsQueryPackQuerySearchProperties', + 'QueryPacksResource', + 'TagsResource', + 'LogAnalyticsQueryPackQueryPaged', + 'LogAnalyticsQueryPackPaged', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/models/_models.py new file mode 100644 index 00000000000..411eceadf4d --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/models/_models.py @@ -0,0 +1,322 @@ +# 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 AzureResourceProperties(Model): + """An Azure resource QueryPack-Query object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(AzureResourceProperties, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorResponse(Model): + """Describe the format of an Error response. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class QueryPacksResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, **kwargs): + super(QueryPacksResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class LogAnalyticsQueryPack(QueryPacksResource): + """An Log Analytics QueryPack definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar query_pack_id: The unique ID of your application. This field cannot + be changed. + :vartype query_pack_id: str + :ivar time_created: Creation Date for the Log Analytics QueryPack, in ISO + 8601 format. + :vartype time_created: datetime + :ivar time_modified: Last modified date of the Log Analytics QueryPack, in + ISO 8601 format. + :vartype time_modified: datetime + :ivar provisioning_state: Current state of this QueryPack: whether or not + is has been provisioned within the resource group it is defined. Users + cannot change this value but are able to read from it. Values will include + Succeeded, Deploying, Canceled, and Failed. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'query_pack_id': {'readonly': True}, + 'time_created': {'readonly': True}, + 'time_modified': {'readonly': True}, + 'provisioning_state': {'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}'}, + 'query_pack_id': {'key': 'properties.queryPackId', 'type': 'str'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LogAnalyticsQueryPack, self).__init__(**kwargs) + self.query_pack_id = None + self.time_created = None + self.time_modified = None + self.provisioning_state = None + + +class LogAnalyticsQueryPackQuery(AzureResourceProperties): + """A Log Analytics QueryPack-Query definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :ivar query_id: The unique ID of your application. This field cannot be + changed. + :vartype query_id: str + :param display_name: Required. Unique display name for your query within + the Query Pack. + :type display_name: str + :ivar time_created: Creation Date for the Log Analytics Query, in ISO 8601 + format. + :vartype time_created: datetime + :ivar time_modified: Last modified date of the Log Analytics Query, in ISO + 8601 format. + :vartype time_modified: datetime + :ivar author: Object Id of user creating the query. + :vartype author: str + :param description: Description of the query. + :type description: str + :param body: Required. Body of the query. + :type body: str + :param linked_resource_id: Resource id associated with the query. + :type linked_resource_id: str + :param categories: Categories associated with the query. + :type categories: list[str] + :param resource_types: Resource Types associated with the query. + :type resource_types: list[str] + :param labels: Labels associated with the query. + :type labels: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'query_id': {'readonly': True}, + 'display_name': {'required': True}, + 'time_created': {'readonly': True}, + 'time_modified': {'readonly': True}, + 'author': {'readonly': True}, + 'body': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'query_id': {'key': 'properties.queryId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'iso-8601'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'body': {'key': 'properties.body', 'type': 'str'}, + 'linked_resource_id': {'key': 'properties.linkedResourceId', 'type': 'str'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, + 'resource_types': {'key': 'properties.resourceTypes', 'type': '[str]'}, + 'labels': {'key': 'properties.labels', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(LogAnalyticsQueryPackQuery, self).__init__(**kwargs) + self.query_id = None + self.display_name = kwargs.get('display_name', None) + self.time_created = None + self.time_modified = None + self.author = None + self.description = kwargs.get('description', None) + self.body = kwargs.get('body', None) + self.linked_resource_id = kwargs.get('linked_resource_id', None) + self.categories = kwargs.get('categories', None) + self.resource_types = kwargs.get('resource_types', None) + self.labels = kwargs.get('labels', None) + + +class LogAnalyticsQueryPackQuerySearchProperties(Model): + """Properties that define an Log Analytics QueryPack-Query search properties. + + :param categories: Categories associated with the query. + :type categories: list[str] + :param resource_types: Resource Types associated with the query. + :type resource_types: list[str] + :param labels: Labels associated with the query. + :type labels: list[str] + """ + + _attribute_map = { + 'categories': {'key': 'categories', 'type': '[str]'}, + 'resource_types': {'key': 'resourceTypes', 'type': '[str]'}, + 'labels': {'key': 'labels', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(LogAnalyticsQueryPackQuerySearchProperties, self).__init__(**kwargs) + self.categories = kwargs.get('categories', None) + self.resource_types = kwargs.get('resource_types', None) + self.labels = kwargs.get('labels', None) + + +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a QueryPack instance. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TagsResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/models/_models_py3.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/models/_models_py3.py new file mode 100644 index 00000000000..53951bc79d1 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/models/_models_py3.py @@ -0,0 +1,322 @@ +# 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 AzureResourceProperties(Model): + """An Azure resource QueryPack-Query object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureResourceProperties, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorResponse(Model): + """Describe the format of an Error response. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :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(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class QueryPacksResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(QueryPacksResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class LogAnalyticsQueryPack(QueryPacksResource): + """An Log Analytics QueryPack definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :ivar query_pack_id: The unique ID of your application. This field cannot + be changed. + :vartype query_pack_id: str + :ivar time_created: Creation Date for the Log Analytics QueryPack, in ISO + 8601 format. + :vartype time_created: datetime + :ivar time_modified: Last modified date of the Log Analytics QueryPack, in + ISO 8601 format. + :vartype time_modified: datetime + :ivar provisioning_state: Current state of this QueryPack: whether or not + is has been provisioned within the resource group it is defined. Users + cannot change this value but are able to read from it. Values will include + Succeeded, Deploying, Canceled, and Failed. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'query_pack_id': {'readonly': True}, + 'time_created': {'readonly': True}, + 'time_modified': {'readonly': True}, + 'provisioning_state': {'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}'}, + 'query_pack_id': {'key': 'properties.queryPackId', 'type': 'str'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(LogAnalyticsQueryPack, self).__init__(location=location, tags=tags, **kwargs) + self.query_pack_id = None + self.time_created = None + self.time_modified = None + self.provisioning_state = None + + +class LogAnalyticsQueryPackQuery(AzureResourceProperties): + """A Log Analytics QueryPack-Query definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :ivar query_id: The unique ID of your application. This field cannot be + changed. + :vartype query_id: str + :param display_name: Required. Unique display name for your query within + the Query Pack. + :type display_name: str + :ivar time_created: Creation Date for the Log Analytics Query, in ISO 8601 + format. + :vartype time_created: datetime + :ivar time_modified: Last modified date of the Log Analytics Query, in ISO + 8601 format. + :vartype time_modified: datetime + :ivar author: Object Id of user creating the query. + :vartype author: str + :param description: Description of the query. + :type description: str + :param body: Required. Body of the query. + :type body: str + :param linked_resource_id: Resource id associated with the query. + :type linked_resource_id: str + :param categories: Categories associated with the query. + :type categories: list[str] + :param resource_types: Resource Types associated with the query. + :type resource_types: list[str] + :param labels: Labels associated with the query. + :type labels: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'query_id': {'readonly': True}, + 'display_name': {'required': True}, + 'time_created': {'readonly': True}, + 'time_modified': {'readonly': True}, + 'author': {'readonly': True}, + 'body': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'query_id': {'key': 'properties.queryId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'iso-8601'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'body': {'key': 'properties.body', 'type': 'str'}, + 'linked_resource_id': {'key': 'properties.linkedResourceId', 'type': 'str'}, + 'categories': {'key': 'properties.categories', 'type': '[str]'}, + 'resource_types': {'key': 'properties.resourceTypes', 'type': '[str]'}, + 'labels': {'key': 'properties.labels', 'type': '[str]'}, + } + + def __init__(self, *, display_name: str, body: str, description: str=None, linked_resource_id: str=None, categories=None, resource_types=None, labels=None, **kwargs) -> None: + super(LogAnalyticsQueryPackQuery, self).__init__(**kwargs) + self.query_id = None + self.display_name = display_name + self.time_created = None + self.time_modified = None + self.author = None + self.description = description + self.body = body + self.linked_resource_id = linked_resource_id + self.categories = categories + self.resource_types = resource_types + self.labels = labels + + +class LogAnalyticsQueryPackQuerySearchProperties(Model): + """Properties that define an Log Analytics QueryPack-Query search properties. + + :param categories: Categories associated with the query. + :type categories: list[str] + :param resource_types: Resource Types associated with the query. + :type resource_types: list[str] + :param labels: Labels associated with the query. + :type labels: list[str] + """ + + _attribute_map = { + 'categories': {'key': 'categories', 'type': '[str]'}, + 'resource_types': {'key': 'resourceTypes', 'type': '[str]'}, + 'labels': {'key': 'labels', 'type': '[str]'}, + } + + def __init__(self, *, categories=None, resource_types=None, labels=None, **kwargs) -> None: + super(LogAnalyticsQueryPackQuerySearchProperties, self).__init__(**kwargs) + self.categories = categories + self.resource_types = resource_types + self.labels = labels + + +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a QueryPack instance. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsResource, self).__init__(**kwargs) + self.tags = tags diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/models/_paged_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/models/_paged_models.py new file mode 100644 index 00000000000..aa3deeaa633 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/models/_paged_models.py @@ -0,0 +1,40 @@ +# 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 LogAnalyticsQueryPackQueryPaged(Paged): + """ + A paging container for iterating over a list of :class:`LogAnalyticsQueryPackQuery ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[LogAnalyticsQueryPackQuery]'} + } + + def __init__(self, *args, **kwargs): + + super(LogAnalyticsQueryPackQueryPaged, self).__init__(*args, **kwargs) +class LogAnalyticsQueryPackPaged(Paged): + """ + A paging container for iterating over a list of :class:`LogAnalyticsQueryPack ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[LogAnalyticsQueryPack]'} + } + + def __init__(self, *args, **kwargs): + + super(LogAnalyticsQueryPackPaged, self).__init__(*args, **kwargs) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/operations/__init__.py new file mode 100644 index 00000000000..d7a4805c2c6 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/operations/__init__.py @@ -0,0 +1,18 @@ +# 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 ._queries_operations import QueriesOperations +from ._query_packs_operations import QueryPacksOperations + +__all__ = [ + 'QueriesOperations', + 'QueryPacksOperations', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/operations/_queries_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/operations/_queries_operations.py new file mode 100644 index 00000000000..cc037bf33ba --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/operations/_queries_operations.py @@ -0,0 +1,423 @@ +# 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 QueriesOperations(object): + """QueriesOperations 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: The API version to use for this operation. Constant value: "2019-09-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-09-01-preview" + + self.config = config + + def list( + self, resource_group_name, query_pack_name, top=None, include_body=None, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of Queries defined within a Log Analytics QueryPack. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param query_pack_name: The name of the Log Analytics QueryPack + resource. + :type query_pack_name: str + :param top: Maximum items returned in page. + :type top: int + :param include_body: Flag indicating whether or not to return the body + of each applicable query. If false, only return the query information. + :type include_body: bool + :param skip_token: Base64 encoded token used to fetch the next page of + items. Default is null. + :type skip_token: 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: An iterator like instance of LogAnalyticsQueryPackQuery + :rtype: + ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQueryPaged[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'queryPackName': self._serialize.url("query_pack_name", query_pack_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', min_length=1) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if include_body is not None: + query_parameters['includeBody'] = self._serialize.query("include_body", include_body, 'bool') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.LogAnalyticsQueryPackQueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/queryPacks/{queryPackName}/queries'} + + def search( + self, resource_group_name, query_pack_name, query_search_properties, top=None, include_body=None, skip_token=None, custom_headers=None, raw=False, **operation_config): + """Search a list of Queries defined within a Log Analytics QueryPack + according to given search properties. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param query_pack_name: The name of the Log Analytics QueryPack + resource. + :type query_pack_name: str + :param query_search_properties: Properties by which to search queries + in the given Log Analytics QueryPack. + :type query_search_properties: + ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuerySearchProperties + :param top: Maximum items returned in page. + :type top: int + :param include_body: Flag indicating whether or not to return the body + of each applicable query. If false, only return the query information. + :type include_body: bool + :param skip_token: Base64 encoded token used to fetch the next page of + items. Default is null. + :type skip_token: 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: An iterator like instance of LogAnalyticsQueryPackQuery + :rtype: + ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQueryPaged[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.search.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'queryPackName': self._serialize.url("query_pack_name", query_pack_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', min_length=1) + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if include_body is not None: + query_parameters['includeBody'] = self._serialize.query("include_body", include_body, 'bool') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + else: + url = next_link + query_parameters = {} + + # 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(query_search_properties, 'LogAnalyticsQueryPackQuerySearchProperties') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.LogAnalyticsQueryPackQueryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + search.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/queryPacks/{queryPackName}/queries/search'} + + def get( + self, resource_group_name, query_pack_name, query_id, custom_headers=None, raw=False, **operation_config): + """Gets a specific Log Analytics Query defined within a Log Analytics + QueryPack. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param query_pack_name: The name of the Log Analytics QueryPack + resource. + :type query_pack_name: str + :param query_id: The id of a specific query defined in the Log + Analytics QueryPack + :type query_id: 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: LogAnalyticsQueryPackQuery or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), + 'queryId': self._serialize.url("query_id", query_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', min_length=1) + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LogAnalyticsQueryPackQuery', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/queryPacks/{queryPackName}/queries/{queryId}'} + + def put( + self, resource_group_name, query_pack_name, query_id, query_payload, custom_headers=None, raw=False, **operation_config): + """Adds or Updates a specific Query within a Log Analytics QueryPack. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param query_pack_name: The name of the Log Analytics QueryPack + resource. + :type query_pack_name: str + :param query_id: The id of a specific query defined in the Log + Analytics QueryPack + :type query_id: str + :param query_payload: Properties that need to be specified to create a + new query and add it to a Log Analytics QueryPack. + :type query_payload: + ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery + :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: LogAnalyticsQueryPackQuery or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.put.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), + 'queryId': self._serialize.url("query_id", query_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', min_length=1) + + # 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(query_payload, 'LogAnalyticsQueryPackQuery') + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LogAnalyticsQueryPackQuery', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/queryPacks/{queryPackName}/queries/{queryId}'} + + def delete( + self, resource_group_name, query_pack_name, query_id, custom_headers=None, raw=False, **operation_config): + """Deletes a specific Query defined within an Log Analytics QueryPack. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param query_pack_name: The name of the Log Analytics QueryPack + resource. + :type query_pack_name: str + :param query_id: The id of a specific query defined in the Log + Analytics QueryPack + :type query_id: 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:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), + 'queryId': self._serialize.url("query_id", query_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', min_length=1) + + # 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, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/queryPacks/{queryPackName}/queries/{queryId}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/operations/_query_packs_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/operations/_query_packs_operations.py new file mode 100644 index 00000000000..3eaaddab0ae --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/operations/_query_packs_operations.py @@ -0,0 +1,437 @@ +# 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 QueryPacksOperations(object): + """QueryPacksOperations 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: The API version to use for this operation. Constant value: "2019-09-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-09-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of all Log Analytics QueryPacks within a subscription. + + :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 LogAnalyticsQueryPack + :rtype: + ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackPaged[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPack] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.LogAnalyticsQueryPackPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/queryPacks'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of Log Analytics QueryPacks within a resource group. + + :param resource_group_name: The name of the resource group. 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: An iterator like instance of LogAnalyticsQueryPack + :rtype: + ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackPaged[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPack] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.LogAnalyticsQueryPackPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/queryPacks'} + + def delete( + self, resource_group_name, query_pack_name, custom_headers=None, raw=False, **operation_config): + """Deletes a Log Analytics QueryPack. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param query_pack_name: The name of the Log Analytics QueryPack + resource. + :type query_pack_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:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'queryPackName': self._serialize.url("query_pack_name", query_pack_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', min_length=1) + + # 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, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/queryPacks/{queryPackName}'} + + def get( + self, resource_group_name, query_pack_name, custom_headers=None, raw=False, **operation_config): + """Returns a Log Analytics QueryPack. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param query_pack_name: The name of the Log Analytics QueryPack + resource. + :type query_pack_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: LogAnalyticsQueryPack or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPack + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'queryPackName': self._serialize.url("query_pack_name", query_pack_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', min_length=1) + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LogAnalyticsQueryPack', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/queryPacks/{queryPackName}'} + + def create_or_update( + self, resource_group_name, query_pack_name, location, tags=None, custom_headers=None, raw=False, **operation_config): + """Creates (or updates) a Log Analytics QueryPack. Note: You cannot + specify a different value for InstrumentationKey nor AppId in the Put + operation. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param query_pack_name: The name of the Log Analytics QueryPack + resource. + :type query_pack_name: str + :param location: Resource location + :type location: 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: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LogAnalyticsQueryPack or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPack + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + log_analytics_query_pack_payload = models.LogAnalyticsQueryPack(location=location, tags=tags) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'queryPackName': self._serialize.url("query_pack_name", query_pack_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', min_length=1) + + # 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(log_analytics_query_pack_payload, 'LogAnalyticsQueryPack') + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LogAnalyticsQueryPack', 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.insights/queryPacks/{queryPackName}'} + + def update_tags( + self, resource_group_name, query_pack_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates an existing QueryPack's tags. To update other fields use the + CreateOrUpdate method. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param query_pack_name: The name of the Log Analytics QueryPack + resource. + :type query_pack_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: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LogAnalyticsQueryPack or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPack + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + query_pack_tags = models.TagsResource(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'queryPackName': self._serialize.url("query_pack_name", query_pack_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', min_length=1) + + # 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(query_pack_tags, 'TagsResource') + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LogAnalyticsQueryPack', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/queryPacks/{queryPackName}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/version.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/version.py new file mode 100644 index 00000000000..e8485659e01 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_09_01_preview/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 = "2019-09-01-preview" + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/__init__.py new file mode 100644 index 00000000000..298512941d9 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/__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 ApplicationInsightsManagementClientConfiguration +from ._application_insights_management_client import ApplicationInsightsManagementClient +__all__ = ['ApplicationInsightsManagementClient', 'ApplicationInsightsManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/_application_insights_management_client.py new file mode 100644 index 00000000000..bb7008b820a --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/_application_insights_management_client.py @@ -0,0 +1,49 @@ +# 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 ApplicationInsightsManagementClientConfiguration +from .operations import WorkbookTemplatesOperations +from . import models + + +class ApplicationInsightsManagementClient(SDKClient): + """Composite Swagger for Application Insights Management Client + + :ivar config: Configuration for client. + :vartype config: ApplicationInsightsManagementClientConfiguration + + :ivar workbook_templates: WorkbookTemplates operations + :vartype workbook_templates: azure.mgmt.applicationinsights.v2019_10_17_preview.operations.WorkbookTemplatesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ApplicationInsightsManagementClientConfiguration(credentials, subscription_id, base_url) + super(ApplicationInsightsManagementClient, 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 = '2019-10-17-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.workbook_templates = WorkbookTemplatesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/_configuration.py new file mode 100644 index 00000000000..6c855295a4b --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/_configuration.py @@ -0,0 +1,48 @@ +# 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 ApplicationInsightsManagementClientConfiguration(AzureConfiguration): + """Configuration for ApplicationInsightsManagementClient + 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: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(ApplicationInsightsManagementClientConfiguration, 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-applicationinsights/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/__init__.py new file mode 100644 index 00000000000..99e1f673930 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/__init__.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import ErrorFieldContract + from ._models_py3 import WorkbookError, WorkbookErrorException + from ._models_py3 import WorkbookTemplate + from ._models_py3 import WorkbookTemplateGallery + from ._models_py3 import WorkbookTemplateLocalizedGallery + from ._models_py3 import WorkbookTemplateResource + from ._models_py3 import WorkbookTemplateUpdateParameters +except (SyntaxError, ImportError): + from ._models import ErrorFieldContract + from ._models import WorkbookError, WorkbookErrorException + from ._models import WorkbookTemplate + from ._models import WorkbookTemplateGallery + from ._models import WorkbookTemplateLocalizedGallery + from ._models import WorkbookTemplateResource + from ._models import WorkbookTemplateUpdateParameters +from ._paged_models import WorkbookTemplatePaged + +__all__ = [ + 'ErrorFieldContract', + 'WorkbookError', 'WorkbookErrorException', + 'WorkbookTemplate', + 'WorkbookTemplateGallery', + 'WorkbookTemplateLocalizedGallery', + 'WorkbookTemplateResource', + 'WorkbookTemplateUpdateParameters', + 'WorkbookTemplatePaged', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/_models.py new file mode 100644 index 00000000000..16880297700 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/_models.py @@ -0,0 +1,296 @@ +# 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 CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorFieldContract(Model): + """Error Field contract. + + :param code: Property level error code. + :type code: str + :param message: Human-readable representation of property-level error. + :type message: str + :param target: Property name. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorFieldContract, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + + +class WorkbookError(Model): + """Error message body that will indicate why the operation failed. + + :param code: Service-defined error code. This code serves as a sub-status + for the HTTP error code specified in the response. + :type code: str + :param message: Human-readable representation of the error. + :type message: str + :param details: The list of invalid fields send in request, in case of + validation error. + :type details: + list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.ErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + } + + def __init__(self, **kwargs): + super(WorkbookError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class WorkbookErrorException(HttpOperationError): + """Server responsed with exception of type: 'WorkbookError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(WorkbookErrorException, self).__init__(deserialize, response, 'WorkbookError', *args) + + +class WorkbookTemplateResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, **kwargs): + super(WorkbookTemplateResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class WorkbookTemplate(WorkbookTemplateResource): + """An Application Insights workbook template definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param priority: Priority of the template. Determines which template to + open when a workbook gallery is opened in viewer mode. + :type priority: int + :param author: Information about the author of the workbook template. + :type author: str + :param template_data: Required. Valid JSON object containing workbook + template payload. + :type template_data: object + :param galleries: Required. Workbook galleries supported by the template. + :type galleries: + list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateGallery] + :param localized: Key value pair of localized gallery. Each key is the + locale code of languages supported by the Azure portal. + :type localized: dict[str, + list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateLocalizedGallery]] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'template_data': {'required': True}, + 'galleries': {'required': 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}'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'template_data': {'key': 'properties.templateData', 'type': 'object'}, + 'galleries': {'key': 'properties.galleries', 'type': '[WorkbookTemplateGallery]'}, + 'localized': {'key': 'properties.localized', 'type': '{[WorkbookTemplateLocalizedGallery]}'}, + } + + def __init__(self, **kwargs): + super(WorkbookTemplate, self).__init__(**kwargs) + self.priority = kwargs.get('priority', None) + self.author = kwargs.get('author', None) + self.template_data = kwargs.get('template_data', None) + self.galleries = kwargs.get('galleries', None) + self.localized = kwargs.get('localized', None) + + +class WorkbookTemplateGallery(Model): + """Gallery information for a workbook template. + + :param name: Name of the workbook template in the gallery. + :type name: str + :param category: Category for the gallery. + :type category: str + :param type: Type of workbook supported by the workbook template. + :type type: str + :param order: Order of the template within the gallery. + :type order: int + :param resource_type: Azure resource type supported by the gallery. + :type resource_type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkbookTemplateGallery, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.category = kwargs.get('category', None) + self.type = kwargs.get('type', None) + self.order = kwargs.get('order', None) + self.resource_type = kwargs.get('resource_type', None) + + +class WorkbookTemplateLocalizedGallery(Model): + """Localized template data and gallery information. + + :param template_data: Valid JSON object containing workbook template + payload. + :type template_data: object + :param galleries: Workbook galleries supported by the template. + :type galleries: + list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateGallery] + """ + + _attribute_map = { + 'template_data': {'key': 'templateData', 'type': 'object'}, + 'galleries': {'key': 'galleries', 'type': '[WorkbookTemplateGallery]'}, + } + + def __init__(self, **kwargs): + super(WorkbookTemplateLocalizedGallery, self).__init__(**kwargs) + self.template_data = kwargs.get('template_data', None) + self.galleries = kwargs.get('galleries', None) + + +class WorkbookTemplateUpdateParameters(Model): + """The parameters that can be provided when updating workbook template. + + All required parameters must be populated in order to send to Azure. + + :param tags: Resource tags + :type tags: dict[str, str] + :param priority: Priority of the template. Determines which template to + open when a workbook gallery is opened in viewer mode. + :type priority: int + :param author: Information about the author of the workbook template. + :type author: str + :param template_data: Required. Valid JSON object containing workbook + template payload. + :type template_data: object + :param galleries: Required. Workbook galleries supported by the template. + :type galleries: + list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateGallery] + :param localized: Key value pair of localized gallery. Each key is the + locale code of languages supported by the Azure portal. + :type localized: dict[str, + list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateLocalizedGallery]] + """ + + _validation = { + 'template_data': {'required': True}, + 'galleries': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'template_data': {'key': 'properties.templateData', 'type': 'object'}, + 'galleries': {'key': 'properties.galleries', 'type': '[WorkbookTemplateGallery]'}, + 'localized': {'key': 'properties.localized', 'type': '{[WorkbookTemplateLocalizedGallery]}'}, + } + + def __init__(self, **kwargs): + super(WorkbookTemplateUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.priority = kwargs.get('priority', None) + self.author = kwargs.get('author', None) + self.template_data = kwargs.get('template_data', None) + self.galleries = kwargs.get('galleries', None) + self.localized = kwargs.get('localized', None) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/_models_py3.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/_models_py3.py new file mode 100644 index 00000000000..6fcea9531a0 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/_models_py3.py @@ -0,0 +1,296 @@ +# 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 CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ErrorFieldContract(Model): + """Error Field contract. + + :param code: Property level error code. + :type code: str + :param message: Human-readable representation of property-level error. + :type message: str + :param target: Property name. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, **kwargs) -> None: + super(ErrorFieldContract, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + + +class WorkbookError(Model): + """Error message body that will indicate why the operation failed. + + :param code: Service-defined error code. This code serves as a sub-status + for the HTTP error code specified in the response. + :type code: str + :param message: Human-readable representation of the error. + :type message: str + :param details: The list of invalid fields send in request, in case of + validation error. + :type details: + list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.ErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + } + + def __init__(self, *, code: str=None, message: str=None, details=None, **kwargs) -> None: + super(WorkbookError, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class WorkbookErrorException(HttpOperationError): + """Server responsed with exception of type: 'WorkbookError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(WorkbookErrorException, self).__init__(deserialize, response, 'WorkbookError', *args) + + +class WorkbookTemplateResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(WorkbookTemplateResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class WorkbookTemplate(WorkbookTemplateResource): + """An Application Insights workbook template definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param priority: Priority of the template. Determines which template to + open when a workbook gallery is opened in viewer mode. + :type priority: int + :param author: Information about the author of the workbook template. + :type author: str + :param template_data: Required. Valid JSON object containing workbook + template payload. + :type template_data: object + :param galleries: Required. Workbook galleries supported by the template. + :type galleries: + list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateGallery] + :param localized: Key value pair of localized gallery. Each key is the + locale code of languages supported by the Azure portal. + :type localized: dict[str, + list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateLocalizedGallery]] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'template_data': {'required': True}, + 'galleries': {'required': 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}'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'template_data': {'key': 'properties.templateData', 'type': 'object'}, + 'galleries': {'key': 'properties.galleries', 'type': '[WorkbookTemplateGallery]'}, + 'localized': {'key': 'properties.localized', 'type': '{[WorkbookTemplateLocalizedGallery]}'}, + } + + def __init__(self, *, location: str, template_data, galleries, tags=None, priority: int=None, author: str=None, localized=None, **kwargs) -> None: + super(WorkbookTemplate, self).__init__(location=location, tags=tags, **kwargs) + self.priority = priority + self.author = author + self.template_data = template_data + self.galleries = galleries + self.localized = localized + + +class WorkbookTemplateGallery(Model): + """Gallery information for a workbook template. + + :param name: Name of the workbook template in the gallery. + :type name: str + :param category: Category for the gallery. + :type category: str + :param type: Type of workbook supported by the workbook template. + :type type: str + :param order: Order of the template within the gallery. + :type order: int + :param resource_type: Azure resource type supported by the gallery. + :type resource_type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, category: str=None, type: str=None, order: int=None, resource_type: str=None, **kwargs) -> None: + super(WorkbookTemplateGallery, self).__init__(**kwargs) + self.name = name + self.category = category + self.type = type + self.order = order + self.resource_type = resource_type + + +class WorkbookTemplateLocalizedGallery(Model): + """Localized template data and gallery information. + + :param template_data: Valid JSON object containing workbook template + payload. + :type template_data: object + :param galleries: Workbook galleries supported by the template. + :type galleries: + list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateGallery] + """ + + _attribute_map = { + 'template_data': {'key': 'templateData', 'type': 'object'}, + 'galleries': {'key': 'galleries', 'type': '[WorkbookTemplateGallery]'}, + } + + def __init__(self, *, template_data=None, galleries=None, **kwargs) -> None: + super(WorkbookTemplateLocalizedGallery, self).__init__(**kwargs) + self.template_data = template_data + self.galleries = galleries + + +class WorkbookTemplateUpdateParameters(Model): + """The parameters that can be provided when updating workbook template. + + All required parameters must be populated in order to send to Azure. + + :param tags: Resource tags + :type tags: dict[str, str] + :param priority: Priority of the template. Determines which template to + open when a workbook gallery is opened in viewer mode. + :type priority: int + :param author: Information about the author of the workbook template. + :type author: str + :param template_data: Required. Valid JSON object containing workbook + template payload. + :type template_data: object + :param galleries: Required. Workbook galleries supported by the template. + :type galleries: + list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateGallery] + :param localized: Key value pair of localized gallery. Each key is the + locale code of languages supported by the Azure portal. + :type localized: dict[str, + list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateLocalizedGallery]] + """ + + _validation = { + 'template_data': {'required': True}, + 'galleries': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'template_data': {'key': 'properties.templateData', 'type': 'object'}, + 'galleries': {'key': 'properties.galleries', 'type': '[WorkbookTemplateGallery]'}, + 'localized': {'key': 'properties.localized', 'type': '{[WorkbookTemplateLocalizedGallery]}'}, + } + + def __init__(self, *, template_data, galleries, tags=None, priority: int=None, author: str=None, localized=None, **kwargs) -> None: + super(WorkbookTemplateUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.priority = priority + self.author = author + self.template_data = template_data + self.galleries = galleries + self.localized = localized diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/_paged_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/_paged_models.py new file mode 100644 index 00000000000..b521e3aeb23 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/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 WorkbookTemplatePaged(Paged): + """ + A paging container for iterating over a list of :class:`WorkbookTemplate ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[WorkbookTemplate]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkbookTemplatePaged, self).__init__(*args, **kwargs) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/operations/__init__.py new file mode 100644 index 00000000000..13a3437c8d3 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/operations/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._workbook_templates_operations import WorkbookTemplatesOperations + +__all__ = [ + 'WorkbookTemplatesOperations', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/operations/_workbook_templates_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/operations/_workbook_templates_operations.py new file mode 100644 index 00000000000..17066285b1a --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/operations/_workbook_templates_operations.py @@ -0,0 +1,372 @@ +# 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 WorkbookTemplatesOperations(object): + """WorkbookTemplatesOperations 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: The API version to use for this operation. Constant value: "2019-10-17-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-17-preview" + + self.config = config + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get all Workbook templates defined within a specified resource group. + + :param resource_group_name: The name of the resource group. 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: An iterator like instance of WorkbookTemplate + :rtype: + ~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplatePaged[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplate] + :raises: + :class:`WorkbookErrorException` + """ + def prepare_request(next_link=None): + if not next_link: + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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]: + raise models.WorkbookErrorException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WorkbookTemplatePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooktemplates'} + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Get a single workbook template by its resourceName. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: WorkbookTemplate or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplate + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`WorkbookErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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.WorkbookErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkbookTemplate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Delete a workbook template. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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:`WorkbookErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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, 204]: + raise models.WorkbookErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} + + def create_or_update( + self, resource_group_name, resource_name, workbook_template_properties, custom_headers=None, raw=False, **operation_config): + """Create a new workbook template. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param workbook_template_properties: Properties that need to be + specified to create a new workbook. + :type workbook_template_properties: + ~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplate + :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: WorkbookTemplate or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplate + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`WorkbookErrorException` + """ + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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(workbook_template_properties, 'WorkbookTemplate') + + # 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, 201]: + raise models.WorkbookErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkbookTemplate', response) + if response.status_code == 201: + deserialized = self._deserialize('WorkbookTemplate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} + + def update( + self, resource_group_name, resource_name, workbook_template_update_parameters=None, custom_headers=None, raw=False, **operation_config): + """Updates a workbook template that has already been added. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param workbook_template_update_parameters: Properties that need to be + specified to patch a workbook template. + :type workbook_template_update_parameters: + ~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateUpdateParameters + :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: WorkbookTemplate or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplate + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`WorkbookErrorException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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 + if workbook_template_update_parameters is not None: + body_content = self._serialize.body(workbook_template_update_parameters, 'WorkbookTemplateUpdateParameters') + else: + body_content = None + + # 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.WorkbookErrorException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkbookTemplate', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooktemplates/{resourceName}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/version.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/version.py new file mode 100644 index 00000000000..663461d3c4c --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/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 = "2019-10-17-preview" + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/__init__.py new file mode 100644 index 00000000000..298512941d9 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/__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 ApplicationInsightsManagementClientConfiguration +from ._application_insights_management_client import ApplicationInsightsManagementClient +__all__ = ['ApplicationInsightsManagementClient', 'ApplicationInsightsManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/_application_insights_management_client.py new file mode 100644 index 00000000000..4149a084c38 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/_application_insights_management_client.py @@ -0,0 +1,49 @@ +# 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 ApplicationInsightsManagementClientConfiguration +from .operations import ComponentsOperations +from . import models + + +class ApplicationInsightsManagementClient(SDKClient): + """Composite Swagger for Application Insights Management Client + + :ivar config: Configuration for client. + :vartype config: ApplicationInsightsManagementClientConfiguration + + :ivar components: Components operations + :vartype components: azure.mgmt.applicationinsights.v2020_02_02_preview.operations.ComponentsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ApplicationInsightsManagementClientConfiguration(credentials, subscription_id, base_url) + super(ApplicationInsightsManagementClient, 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 = '2020-02-02-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.components = ComponentsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/_configuration.py new file mode 100644 index 00000000000..6c855295a4b --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/_configuration.py @@ -0,0 +1,48 @@ +# 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 ApplicationInsightsManagementClientConfiguration(AzureConfiguration): + """Configuration for ApplicationInsightsManagementClient + 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: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(ApplicationInsightsManagementClientConfiguration, 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-applicationinsights/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/__init__.py new file mode 100644 index 00000000000..cbde4cca8f3 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/__init__.py @@ -0,0 +1,54 @@ +# 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 ApplicationInsightsComponent + from ._models_py3 import ComponentPurgeBody + from ._models_py3 import ComponentPurgeBodyFilters + from ._models_py3 import ComponentPurgeResponse + from ._models_py3 import ComponentPurgeStatusResponse + from ._models_py3 import ComponentsResource + from ._models_py3 import PrivateLinkScopedResource + from ._models_py3 import TagsResource +except (SyntaxError, ImportError): + from ._models import ApplicationInsightsComponent + from ._models import ComponentPurgeBody + from ._models import ComponentPurgeBodyFilters + from ._models import ComponentPurgeResponse + from ._models import ComponentPurgeStatusResponse + from ._models import ComponentsResource + from ._models import PrivateLinkScopedResource + from ._models import TagsResource +from ._paged_models import ApplicationInsightsComponentPaged +from ._application_insights_management_client_enums import ( + ApplicationType, + FlowType, + RequestSource, + PublicNetworkAccessType, + PurgeState, +) + +__all__ = [ + 'ApplicationInsightsComponent', + 'ComponentPurgeBody', + 'ComponentPurgeBodyFilters', + 'ComponentPurgeResponse', + 'ComponentPurgeStatusResponse', + 'ComponentsResource', + 'PrivateLinkScopedResource', + 'TagsResource', + 'ApplicationInsightsComponentPaged', + 'ApplicationType', + 'FlowType', + 'RequestSource', + 'PublicNetworkAccessType', + 'PurgeState', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_application_insights_management_client_enums.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_application_insights_management_client_enums.py new file mode 100644 index 00000000000..cab8df5318d --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_application_insights_management_client_enums.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ApplicationType(str, Enum): + + web = "web" + other = "other" + + +class FlowType(str, Enum): + + bluefield = "Bluefield" + + +class RequestSource(str, Enum): + + rest = "rest" + + +class PublicNetworkAccessType(str, Enum): + + enabled = "Enabled" #: Enables connectivity to Application Insights through public DNS. + disabled = "Disabled" #: Disables public connectivity to Application Insights through public DNS. + + +class PurgeState(str, Enum): + + pending = "pending" + completed = "completed" diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_models.py new file mode 100644 index 00000000000..256b50e40b1 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_models.py @@ -0,0 +1,381 @@ +# 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 + + +class ComponentsResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, **kwargs): + super(ComponentsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class ApplicationInsightsComponent(ComponentsResource): + """An Application Insights component definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. The kind of application that this component refers + to, used to customize UI. This value is a freeform string, values should + typically be one of the following: web, ios, other, store, java, phone. + :type kind: str + :ivar application_id: The unique ID of your application. This field + mirrors the 'Name' field and cannot be changed. + :vartype application_id: str + :ivar app_id: Application Insights Unique ID for your Application. + :vartype app_id: str + :param application_type: Required. Type of application being monitored. + Possible values include: 'web', 'other'. Default value: "web" . + :type application_type: str or + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationType + :param flow_type: Used by the Application Insights system to determine + what kind of flow this component was created by. This is to be set to + 'Bluefield' when creating/updating a component via the REST API. Possible + values include: 'Bluefield'. Default value: "Bluefield" . + :type flow_type: str or + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.FlowType + :param request_source: Describes what tool created this Application + Insights component. Customers using this API should set this to the + default 'rest'. Possible values include: 'rest'. Default value: "rest" . + :type request_source: str or + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.RequestSource + :ivar instrumentation_key: Application Insights Instrumentation key. A + read-only value that applications can use to identify the destination for + all telemetry sent to Azure Application Insights. This value will be + supplied upon construction of each new Application Insights component. + :vartype instrumentation_key: str + :ivar creation_date: Creation Date for the Application Insights component, + in ISO 8601 format. + :vartype creation_date: datetime + :ivar tenant_id: Azure Tenant Id. + :vartype tenant_id: str + :param hockey_app_id: The unique application ID created when a new + application is added to HockeyApp, used for communications with HockeyApp. + :type hockey_app_id: str + :ivar hockey_app_token: Token used to authenticate communications with + between Application Insights and HockeyApp. + :vartype hockey_app_token: str + :ivar provisioning_state: Current state of this component: whether or not + is has been provisioned within the resource group it is defined. Users + cannot change this value but are able to read from it. Values will include + Succeeded, Deploying, Canceled, and Failed. + :vartype provisioning_state: str + :param sampling_percentage: Percentage of the data produced by the + application being monitored that is being sampled for Application Insights + telemetry. + :type sampling_percentage: float + :ivar connection_string: Application Insights component connection string. + :vartype connection_string: str + :ivar retention_in_days: Retention period in days. + :vartype retention_in_days: int + :param disable_ip_masking: Disable IP masking. + :type disable_ip_masking: bool + :param immediate_purge_data_on30_days: Purge data immediately after 30 + days. + :type immediate_purge_data_on30_days: bool + :param workspace_resource_id: Required. ResourceId of the log analytics + workspace which the data will be ingested to. + :type workspace_resource_id: str + :ivar private_link_scoped_resources: List of linked private link scope + resources. + :vartype private_link_scoped_resources: + list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.PrivateLinkScopedResource] + :param public_network_access_for_ingestion: The network access type for + accessing Application Insights ingestion. Possible values include: + 'Enabled', 'Disabled'. Default value: "Enabled" . + :type public_network_access_for_ingestion: str or + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.PublicNetworkAccessType + :param public_network_access_for_query: The network access type for + accessing Application Insights query. Possible values include: 'Enabled', + 'Disabled'. Default value: "Enabled" . + :type public_network_access_for_query: str or + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.PublicNetworkAccessType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'application_id': {'readonly': True}, + 'app_id': {'readonly': True}, + 'application_type': {'required': True}, + 'instrumentation_key': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'hockey_app_token': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'connection_string': {'readonly': True}, + 'retention_in_days': {'readonly': True}, + 'workspace_resource_id': {'required': True}, + 'private_link_scoped_resources': {'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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'application_id': {'key': 'properties.ApplicationId', 'type': 'str'}, + 'app_id': {'key': 'properties.AppId', 'type': 'str'}, + 'application_type': {'key': 'properties.Application_Type', 'type': 'str'}, + 'flow_type': {'key': 'properties.Flow_Type', 'type': 'str'}, + 'request_source': {'key': 'properties.Request_Source', 'type': 'str'}, + 'instrumentation_key': {'key': 'properties.InstrumentationKey', 'type': 'str'}, + 'creation_date': {'key': 'properties.CreationDate', 'type': 'iso-8601'}, + 'tenant_id': {'key': 'properties.TenantId', 'type': 'str'}, + 'hockey_app_id': {'key': 'properties.HockeyAppId', 'type': 'str'}, + 'hockey_app_token': {'key': 'properties.HockeyAppToken', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sampling_percentage': {'key': 'properties.SamplingPercentage', 'type': 'float'}, + 'connection_string': {'key': 'properties.ConnectionString', 'type': 'str'}, + 'retention_in_days': {'key': 'properties.RetentionInDays', 'type': 'int'}, + 'disable_ip_masking': {'key': 'properties.DisableIpMasking', 'type': 'bool'}, + 'immediate_purge_data_on30_days': {'key': 'properties.ImmediatePurgeDataOn30Days', 'type': 'bool'}, + 'workspace_resource_id': {'key': 'properties.WorkspaceResourceId', 'type': 'str'}, + 'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'}, + 'public_network_access_for_ingestion': {'key': 'properties.publicNetworkAccessForIngestion', 'type': 'str'}, + 'public_network_access_for_query': {'key': 'properties.publicNetworkAccessForQuery', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsComponent, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.application_id = None + self.app_id = None + self.application_type = kwargs.get('application_type', "web") + self.flow_type = kwargs.get('flow_type', "Bluefield") + self.request_source = kwargs.get('request_source', "rest") + self.instrumentation_key = None + self.creation_date = None + self.tenant_id = None + self.hockey_app_id = kwargs.get('hockey_app_id', None) + self.hockey_app_token = None + self.provisioning_state = None + self.sampling_percentage = kwargs.get('sampling_percentage', None) + self.connection_string = None + self.retention_in_days = None + self.disable_ip_masking = kwargs.get('disable_ip_masking', None) + self.immediate_purge_data_on30_days = kwargs.get('immediate_purge_data_on30_days', None) + self.workspace_resource_id = kwargs.get('workspace_resource_id', None) + self.private_link_scoped_resources = None + self.public_network_access_for_ingestion = kwargs.get('public_network_access_for_ingestion', "Enabled") + self.public_network_access_for_query = kwargs.get('public_network_access_for_query', "Enabled") + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ComponentPurgeBody(Model): + """Describes the body of a purge request for an App Insights component. + + All required parameters must be populated in order to send to Azure. + + :param table: Required. Table from which to purge data. + :type table: str + :param filters: Required. The set of columns and filters (queries) to run + over them to purge the resulting data. + :type filters: + list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ComponentPurgeBodyFilters] + """ + + _validation = { + 'table': {'required': True}, + 'filters': {'required': True}, + } + + _attribute_map = { + 'table': {'key': 'table', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': '[ComponentPurgeBodyFilters]'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeBody, self).__init__(**kwargs) + self.table = kwargs.get('table', None) + self.filters = kwargs.get('filters', None) + + +class ComponentPurgeBodyFilters(Model): + """User-defined filters to return data which will be purged from the table. + + :param column: The column of the table over which the given query should + run + :type column: str + :param operator: A query operator to evaluate over the provided column and + value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, + and have the same behavior as they would in a KQL query. + :type operator: str + :param value: the value for the operator to function over. This can be a + number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of + values. + :type value: object + :param key: When filtering over custom dimensions, this key will be used + as the name of the custom dimension. + :type key: str + """ + + _attribute_map = { + 'column': {'key': 'column', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeBodyFilters, self).__init__(**kwargs) + self.column = kwargs.get('column', None) + self.operator = kwargs.get('operator', None) + self.value = kwargs.get('value', None) + self.key = kwargs.get('key', None) + + +class ComponentPurgeResponse(Model): + """Response containing operationId for a specific purge action. + + All required parameters must be populated in order to send to Azure. + + :param operation_id: Required. Id to use when querying for status for a + particular purge operation. + :type operation_id: str + """ + + _validation = { + 'operation_id': {'required': True}, + } + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeResponse, self).__init__(**kwargs) + self.operation_id = kwargs.get('operation_id', None) + + +class ComponentPurgeStatusResponse(Model): + """Response containing status for a specific purge operation. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Status of the operation represented by the + requested Id. Possible values include: 'pending', 'completed' + :type status: str or + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.PurgeState + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComponentPurgeStatusResponse, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + + +class PrivateLinkScopedResource(Model): + """The private link scope resource reference. + + :param resource_id: The full resource Id of the private link scope + resource. + :type resource_id: str + :param scope_id: The private link scope unique Identifier. + :type scope_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'ResourceId', 'type': 'str'}, + 'scope_id': {'key': 'ScopeId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkScopedResource, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.scope_id = kwargs.get('scope_id', None) + + +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a WebTest instance. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TagsResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_models_py3.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_models_py3.py new file mode 100644 index 00000000000..9b8fcb866f9 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_models_py3.py @@ -0,0 +1,381 @@ +# 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 + + +class ComponentsResource(Model): + """An azure resource object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(ComponentsResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class ApplicationInsightsComponent(ComponentsResource): + """An Application Insights component definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Azure resource Id + :vartype id: str + :ivar name: Azure resource name + :vartype name: str + :ivar type: Azure resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. The kind of application that this component refers + to, used to customize UI. This value is a freeform string, values should + typically be one of the following: web, ios, other, store, java, phone. + :type kind: str + :ivar application_id: The unique ID of your application. This field + mirrors the 'Name' field and cannot be changed. + :vartype application_id: str + :ivar app_id: Application Insights Unique ID for your Application. + :vartype app_id: str + :param application_type: Required. Type of application being monitored. + Possible values include: 'web', 'other'. Default value: "web" . + :type application_type: str or + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationType + :param flow_type: Used by the Application Insights system to determine + what kind of flow this component was created by. This is to be set to + 'Bluefield' when creating/updating a component via the REST API. Possible + values include: 'Bluefield'. Default value: "Bluefield" . + :type flow_type: str or + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.FlowType + :param request_source: Describes what tool created this Application + Insights component. Customers using this API should set this to the + default 'rest'. Possible values include: 'rest'. Default value: "rest" . + :type request_source: str or + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.RequestSource + :ivar instrumentation_key: Application Insights Instrumentation key. A + read-only value that applications can use to identify the destination for + all telemetry sent to Azure Application Insights. This value will be + supplied upon construction of each new Application Insights component. + :vartype instrumentation_key: str + :ivar creation_date: Creation Date for the Application Insights component, + in ISO 8601 format. + :vartype creation_date: datetime + :ivar tenant_id: Azure Tenant Id. + :vartype tenant_id: str + :param hockey_app_id: The unique application ID created when a new + application is added to HockeyApp, used for communications with HockeyApp. + :type hockey_app_id: str + :ivar hockey_app_token: Token used to authenticate communications with + between Application Insights and HockeyApp. + :vartype hockey_app_token: str + :ivar provisioning_state: Current state of this component: whether or not + is has been provisioned within the resource group it is defined. Users + cannot change this value but are able to read from it. Values will include + Succeeded, Deploying, Canceled, and Failed. + :vartype provisioning_state: str + :param sampling_percentage: Percentage of the data produced by the + application being monitored that is being sampled for Application Insights + telemetry. + :type sampling_percentage: float + :ivar connection_string: Application Insights component connection string. + :vartype connection_string: str + :ivar retention_in_days: Retention period in days. + :vartype retention_in_days: int + :param disable_ip_masking: Disable IP masking. + :type disable_ip_masking: bool + :param immediate_purge_data_on30_days: Purge data immediately after 30 + days. + :type immediate_purge_data_on30_days: bool + :param workspace_resource_id: Required. ResourceId of the log analytics + workspace which the data will be ingested to. + :type workspace_resource_id: str + :ivar private_link_scoped_resources: List of linked private link scope + resources. + :vartype private_link_scoped_resources: + list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.PrivateLinkScopedResource] + :param public_network_access_for_ingestion: The network access type for + accessing Application Insights ingestion. Possible values include: + 'Enabled', 'Disabled'. Default value: "Enabled" . + :type public_network_access_for_ingestion: str or + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.PublicNetworkAccessType + :param public_network_access_for_query: The network access type for + accessing Application Insights query. Possible values include: 'Enabled', + 'Disabled'. Default value: "Enabled" . + :type public_network_access_for_query: str or + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.PublicNetworkAccessType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'application_id': {'readonly': True}, + 'app_id': {'readonly': True}, + 'application_type': {'required': True}, + 'instrumentation_key': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'hockey_app_token': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'connection_string': {'readonly': True}, + 'retention_in_days': {'readonly': True}, + 'workspace_resource_id': {'required': True}, + 'private_link_scoped_resources': {'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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'application_id': {'key': 'properties.ApplicationId', 'type': 'str'}, + 'app_id': {'key': 'properties.AppId', 'type': 'str'}, + 'application_type': {'key': 'properties.Application_Type', 'type': 'str'}, + 'flow_type': {'key': 'properties.Flow_Type', 'type': 'str'}, + 'request_source': {'key': 'properties.Request_Source', 'type': 'str'}, + 'instrumentation_key': {'key': 'properties.InstrumentationKey', 'type': 'str'}, + 'creation_date': {'key': 'properties.CreationDate', 'type': 'iso-8601'}, + 'tenant_id': {'key': 'properties.TenantId', 'type': 'str'}, + 'hockey_app_id': {'key': 'properties.HockeyAppId', 'type': 'str'}, + 'hockey_app_token': {'key': 'properties.HockeyAppToken', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'sampling_percentage': {'key': 'properties.SamplingPercentage', 'type': 'float'}, + 'connection_string': {'key': 'properties.ConnectionString', 'type': 'str'}, + 'retention_in_days': {'key': 'properties.RetentionInDays', 'type': 'int'}, + 'disable_ip_masking': {'key': 'properties.DisableIpMasking', 'type': 'bool'}, + 'immediate_purge_data_on30_days': {'key': 'properties.ImmediatePurgeDataOn30Days', 'type': 'bool'}, + 'workspace_resource_id': {'key': 'properties.WorkspaceResourceId', 'type': 'str'}, + 'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'}, + 'public_network_access_for_ingestion': {'key': 'properties.publicNetworkAccessForIngestion', 'type': 'str'}, + 'public_network_access_for_query': {'key': 'properties.publicNetworkAccessForQuery', 'type': 'str'}, + } + + def __init__(self, *, location: str, kind: str, workspace_resource_id: str, tags=None, application_type="web", flow_type="Bluefield", request_source="rest", hockey_app_id: str=None, sampling_percentage: float=None, disable_ip_masking: bool=None, immediate_purge_data_on30_days: bool=None, public_network_access_for_ingestion="Enabled", public_network_access_for_query="Enabled", **kwargs) -> None: + super(ApplicationInsightsComponent, self).__init__(location=location, tags=tags, **kwargs) + self.kind = kind + self.application_id = None + self.app_id = None + self.application_type = application_type + self.flow_type = flow_type + self.request_source = request_source + self.instrumentation_key = None + self.creation_date = None + self.tenant_id = None + self.hockey_app_id = hockey_app_id + self.hockey_app_token = None + self.provisioning_state = None + self.sampling_percentage = sampling_percentage + self.connection_string = None + self.retention_in_days = None + self.disable_ip_masking = disable_ip_masking + self.immediate_purge_data_on30_days = immediate_purge_data_on30_days + self.workspace_resource_id = workspace_resource_id + self.private_link_scoped_resources = None + self.public_network_access_for_ingestion = public_network_access_for_ingestion + self.public_network_access_for_query = public_network_access_for_query + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ComponentPurgeBody(Model): + """Describes the body of a purge request for an App Insights component. + + All required parameters must be populated in order to send to Azure. + + :param table: Required. Table from which to purge data. + :type table: str + :param filters: Required. The set of columns and filters (queries) to run + over them to purge the resulting data. + :type filters: + list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ComponentPurgeBodyFilters] + """ + + _validation = { + 'table': {'required': True}, + 'filters': {'required': True}, + } + + _attribute_map = { + 'table': {'key': 'table', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': '[ComponentPurgeBodyFilters]'}, + } + + def __init__(self, *, table: str, filters, **kwargs) -> None: + super(ComponentPurgeBody, self).__init__(**kwargs) + self.table = table + self.filters = filters + + +class ComponentPurgeBodyFilters(Model): + """User-defined filters to return data which will be purged from the table. + + :param column: The column of the table over which the given query should + run + :type column: str + :param operator: A query operator to evaluate over the provided column and + value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, + and have the same behavior as they would in a KQL query. + :type operator: str + :param value: the value for the operator to function over. This can be a + number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of + values. + :type value: object + :param key: When filtering over custom dimensions, this key will be used + as the name of the custom dimension. + :type key: str + """ + + _attribute_map = { + 'column': {'key': 'column', 'type': 'str'}, + 'operator': {'key': 'operator', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'key': {'key': 'key', 'type': 'str'}, + } + + def __init__(self, *, column: str=None, operator: str=None, value=None, key: str=None, **kwargs) -> None: + super(ComponentPurgeBodyFilters, self).__init__(**kwargs) + self.column = column + self.operator = operator + self.value = value + self.key = key + + +class ComponentPurgeResponse(Model): + """Response containing operationId for a specific purge action. + + All required parameters must be populated in order to send to Azure. + + :param operation_id: Required. Id to use when querying for status for a + particular purge operation. + :type operation_id: str + """ + + _validation = { + 'operation_id': {'required': True}, + } + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + } + + def __init__(self, *, operation_id: str, **kwargs) -> None: + super(ComponentPurgeResponse, self).__init__(**kwargs) + self.operation_id = operation_id + + +class ComponentPurgeStatusResponse(Model): + """Response containing status for a specific purge operation. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Status of the operation represented by the + requested Id. Possible values include: 'pending', 'completed' + :type status: str or + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.PurgeState + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, status, **kwargs) -> None: + super(ComponentPurgeStatusResponse, self).__init__(**kwargs) + self.status = status + + +class PrivateLinkScopedResource(Model): + """The private link scope resource reference. + + :param resource_id: The full resource Id of the private link scope + resource. + :type resource_id: str + :param scope_id: The private link scope unique Identifier. + :type scope_id: str + """ + + _attribute_map = { + 'resource_id': {'key': 'ResourceId', 'type': 'str'}, + 'scope_id': {'key': 'ScopeId', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str=None, scope_id: str=None, **kwargs) -> None: + super(PrivateLinkScopedResource, self).__init__(**kwargs) + self.resource_id = resource_id + self.scope_id = scope_id + + +class TagsResource(Model): + """A container holding only the Tags for a resource, allowing the user to + update the tags on a WebTest instance. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TagsResource, self).__init__(**kwargs) + self.tags = tags diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_api_key_paged.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_paged_models.py similarity index 73% rename from src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_api_key_paged.py rename to src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_paged_models.py index d3b65643a2b..0f4379ac3bd 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/application_insights_component_api_key_paged.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_paged_models.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class ApplicationInsightsComponentAPIKeyPaged(Paged): +class ApplicationInsightsComponentPaged(Paged): """ - A paging container for iterating over a list of :class:`ApplicationInsightsComponentAPIKey ` object + A paging container for iterating over a list of :class:`ApplicationInsightsComponent ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ApplicationInsightsComponentAPIKey]'} + 'current_page': {'key': 'value', 'type': '[ApplicationInsightsComponent]'} } def __init__(self, *args, **kwargs): - super(ApplicationInsightsComponentAPIKeyPaged, self).__init__(*args, **kwargs) + super(ApplicationInsightsComponentPaged, self).__init__(*args, **kwargs) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/operations/__init__.py new file mode 100644 index 00000000000..e4259a934db --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/operations/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._components_operations import ComponentsOperations + +__all__ = [ + 'ComponentsOperations', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/operations/_components_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/operations/_components_operations.py new file mode 100644 index 00000000000..fb453f6f5ce --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/operations/_components_operations.py @@ -0,0 +1,594 @@ +# 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 ComponentsOperations(object): + """ComponentsOperations 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: The API version to use for this operation. Constant value: "2020-02-02-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-02-02-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of all Application Insights components within a + subscription. + + :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 ApplicationInsightsComponent + :rtype: + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponentPaged[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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.ApplicationInsightsComponentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/components'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of Application Insights components within a resource group. + + :param resource_group_name: The name of the resource group. 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: An iterator like instance of ApplicationInsightsComponent + :rtype: + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponentPaged[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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.ApplicationInsightsComponentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components'} + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Deletes an Application Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Returns an Application Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: ApplicationInsightsComponent or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponent', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} + + def create_or_update( + self, resource_group_name, resource_name, insight_properties, custom_headers=None, raw=False, **operation_config): + """Creates (or updates) an Application Insights component. Note: You + cannot specify a different value for InstrumentationKey nor AppId in + the Put operation. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param insight_properties: Properties that need to be specified to + create an Application Insights component. + :type insight_properties: + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent + :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: ApplicationInsightsComponent or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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(insight_properties, 'ApplicationInsightsComponent') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponent', 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.Insights/components/{resourceName}'} + + def update_tags( + self, resource_group_name, resource_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates an existing component's tags. To update other fields use the + CreateOrUpdate method. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApplicationInsightsComponent or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + component_tags = models.TagsResource(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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(component_tags, 'TagsResource') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationInsightsComponent', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} + + def purge( + self, resource_group_name, resource_name, table, filters, custom_headers=None, raw=False, **operation_config): + """Purges data in an Application Insights component by a set of + user-defined filters. + In order to manage system resources, purge requests are throttled at 50 + requests per hour. You should batch the execution of purge requests by + sending a single command whose predicate includes all user identities + that require purging. Use the in operator to specify multiple + identities. You should run the query prior to using for a purge request + to verify that the results are expected. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param table: Table from which to purge data. + :type table: str + :param filters: The set of columns and filters (queries) to run over + them to purge the resulting data. + :type filters: + list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ComponentPurgeBodyFilters] + :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: ComponentPurgeResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ComponentPurgeResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = models.ComponentPurgeBody(table=table, filters=filters) + + # Construct URL + url = self.purge.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_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', min_length=1) + + # 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(body, 'ComponentPurgeBody') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 202: + deserialized = self._deserialize('ComponentPurgeResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge'} + + def get_purge_status( + self, resource_group_name, resource_name, purge_id, custom_headers=None, raw=False, **operation_config): + """Get status for an ongoing purge operation. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param purge_id: In a purge status request, this is the Id of the + operation the status of which is returned. + :type purge_id: 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: ComponentPurgeStatusResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ComponentPurgeStatusResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_purge_status.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'purgeId': self._serialize.url("purge_id", purge_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ComponentPurgeStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_purge_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/version.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/version.py new file mode 100644 index 00000000000..87adec2812d --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/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 = "2020-02-02-preview" + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/__init__.py new file mode 100644 index 00000000000..298512941d9 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/__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 ApplicationInsightsManagementClientConfiguration +from ._application_insights_management_client import ApplicationInsightsManagementClient +__all__ = ['ApplicationInsightsManagementClient', 'ApplicationInsightsManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/_application_insights_management_client.py new file mode 100644 index 00000000000..047f9a69313 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/_application_insights_management_client.py @@ -0,0 +1,49 @@ +# 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 ApplicationInsightsManagementClientConfiguration +from .operations import ComponentLinkedStorageAccountsOperations +from . import models + + +class ApplicationInsightsManagementClient(SDKClient): + """Composite Swagger for Application Insights Management Client + + :ivar config: Configuration for client. + :vartype config: ApplicationInsightsManagementClientConfiguration + + :ivar component_linked_storage_accounts: ComponentLinkedStorageAccounts operations + :vartype component_linked_storage_accounts: azure.mgmt.applicationinsights.v2020_03_01_preview.operations.ComponentLinkedStorageAccountsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = ApplicationInsightsManagementClientConfiguration(credentials, subscription_id, base_url) + super(ApplicationInsightsManagementClient, 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 = '2020-03-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.component_linked_storage_accounts = ComponentLinkedStorageAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/_configuration.py new file mode 100644 index 00000000000..6c855295a4b --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/_configuration.py @@ -0,0 +1,48 @@ +# 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 ApplicationInsightsManagementClientConfiguration(AzureConfiguration): + """Configuration for ApplicationInsightsManagementClient + 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: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(ApplicationInsightsManagementClientConfiguration, 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-applicationinsights/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/__init__.py new file mode 100644 index 00000000000..a622440af61 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/__init__.py @@ -0,0 +1,37 @@ +# 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 AzureEntityResource + from ._models_py3 import ComponentLinkedStorageAccounts + from ._models_py3 import ComponentLinkedStorageAccountsPatch + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import TrackedResource +except (SyntaxError, ImportError): + from ._models import AzureEntityResource + from ._models import ComponentLinkedStorageAccounts + from ._models import ComponentLinkedStorageAccountsPatch + from ._models import ErrorResponse, ErrorResponseException + from ._models import ProxyResource + from ._models import Resource + from ._models import TrackedResource + +__all__ = [ + 'AzureEntityResource', + 'ComponentLinkedStorageAccounts', + 'ComponentLinkedStorageAccountsPatch', + 'ErrorResponse', 'ErrorResponseException', + 'ProxyResource', + 'Resource', + 'TrackedResource', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/_models.py new file mode 100644 index 00000000000..1d6c7cfb916 --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/_models.py @@ -0,0 +1,254 @@ +# 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 Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + + +class ComponentLinkedStorageAccounts(ProxyResource): + """An Application Insights component linked storage accounts. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param linked_storage_account: Linked storage account resource ID + :type linked_storage_account: str + """ + + _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'}, + 'linked_storage_account': {'key': 'properties.linkedStorageAccount', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComponentLinkedStorageAccounts, self).__init__(**kwargs) + self.linked_storage_account = kwargs.get('linked_storage_account', None) + + +class ComponentLinkedStorageAccountsPatch(Model): + """An Application Insights component linked storage accounts patch. + + :param linked_storage_account: Linked storage account resource ID + :type linked_storage_account: str + """ + + _attribute_map = { + 'linked_storage_account': {'key': 'properties.linkedStorageAccount', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComponentLinkedStorageAccountsPatch, self).__init__(**kwargs) + self.linked_storage_account = kwargs.get('linked_storage_account', None) + + +class ErrorResponse(Model): + """Describe the format of an Error response. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/_models_py3.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/_models_py3.py new file mode 100644 index 00000000000..887bad54fdf --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/_models_py3.py @@ -0,0 +1,254 @@ +# 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 Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + + +class ComponentLinkedStorageAccounts(ProxyResource): + """An Application Insights component linked storage accounts. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param linked_storage_account: Linked storage account resource ID + :type linked_storage_account: str + """ + + _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'}, + 'linked_storage_account': {'key': 'properties.linkedStorageAccount', 'type': 'str'}, + } + + def __init__(self, *, linked_storage_account: str=None, **kwargs) -> None: + super(ComponentLinkedStorageAccounts, self).__init__(**kwargs) + self.linked_storage_account = linked_storage_account + + +class ComponentLinkedStorageAccountsPatch(Model): + """An Application Insights component linked storage accounts patch. + + :param linked_storage_account: Linked storage account resource ID + :type linked_storage_account: str + """ + + _attribute_map = { + 'linked_storage_account': {'key': 'properties.linkedStorageAccount', 'type': 'str'}, + } + + def __init__(self, *, linked_storage_account: str=None, **kwargs) -> None: + super(ComponentLinkedStorageAccountsPatch, self).__init__(**kwargs) + self.linked_storage_account = linked_storage_account + + +class ErrorResponse(Model): + """Describe the format of an Error response. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :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(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/operations/__init__.py new file mode 100644 index 00000000000..c3463e0465f --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/operations/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._component_linked_storage_accounts_operations import ComponentLinkedStorageAccountsOperations + +__all__ = [ + 'ComponentLinkedStorageAccountsOperations', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/operations/_component_linked_storage_accounts_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/operations/_component_linked_storage_accounts_operations.py new file mode 100644 index 00000000000..8f664f7027d --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/operations/_component_linked_storage_accounts_operations.py @@ -0,0 +1,309 @@ +# 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 ComponentLinkedStorageAccountsOperations(object): + """ComponentLinkedStorageAccountsOperations 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: The API version to use for this operation. Constant value: "2020-03-01-preview". + :ivar storage_type: The type of the Application Insights component data source for the linked storage account. Constant value: "serviceprofiler". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-01-preview" + self.storage_type = "serviceprofiler" + + self.config = config + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Returns the current linked storage settings for an Application Insights + component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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: ComponentLinkedStorageAccounts or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.ComponentLinkedStorageAccounts + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'storageType': self._serialize.url("self.storage_type", self.storage_type, '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', min_length=1) + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ComponentLinkedStorageAccounts', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'} + + def create_and_update( + self, resource_group_name, resource_name, linked_storage_account=None, custom_headers=None, raw=False, **operation_config): + """Replace current linked storage account for an Application Insights + component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param linked_storage_account: Linked storage account resource ID + :type linked_storage_account: 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: ComponentLinkedStorageAccounts or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.ComponentLinkedStorageAccounts + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + linked_storage_accounts_properties = models.ComponentLinkedStorageAccounts(linked_storage_account=linked_storage_account) + + # Construct URL + url = self.create_and_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'storageType': self._serialize.url("self.storage_type", self.storage_type, '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', min_length=1) + + # 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(linked_storage_accounts_properties, 'ComponentLinkedStorageAccounts') + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ComponentLinkedStorageAccounts', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_and_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'} + + def update( + self, resource_group_name, resource_name, linked_storage_account=None, custom_headers=None, raw=False, **operation_config): + """Update linked storage accounts for an Application Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_name: str + :param linked_storage_account: Linked storage account resource ID + :type linked_storage_account: 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: ComponentLinkedStorageAccounts or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.ComponentLinkedStorageAccounts + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + linked_storage_accounts_properties = models.ComponentLinkedStorageAccountsPatch(linked_storage_account=linked_storage_account) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'storageType': self._serialize.url("self.storage_type", self.storage_type, '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', min_length=1) + + # 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(linked_storage_accounts_properties, 'ComponentLinkedStorageAccountsPatch') + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ComponentLinkedStorageAccounts', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'} + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Delete linked storage accounts for an Application Insights component. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component + resource. + :type resource_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:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'storageType': self._serialize.url("self.storage_type", self.storage_type, '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', min_length=1) + + # 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, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'} diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/version.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/version.py new file mode 100644 index 00000000000..b6fb60cec9a --- /dev/null +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/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 = "2020-03-01-preview" + diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/version.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/version.py index e7efe25ea7e..9bd1dfac7ec 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/version.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.1" +VERSION = "0.2.0" diff --git a/src/application-insights/setup.py b/src/application-insights/setup.py index a9e0e15e9e2..9ee322d1994 100644 --- a/src/application-insights/setup.py +++ b/src/application-insights/setup.py @@ -8,7 +8,7 @@ from codecs import open from setuptools import setup, find_packages -VERSION = "0.1.6" +VERSION = "0.1.7" CLASSIFIERS = [ 'Development Status :: 4 - Beta', diff --git a/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_firewall_ip_config.yaml b/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_firewall_ip_config.yaml index c9a87a897fd..b8af428ac75 100644 --- a/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_firewall_ip_config.yaml +++ b/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_firewall_ip_config.yaml @@ -285,7 +285,7 @@ interactions: accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"pubip\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip\",\r\n @@ -391,7 +391,7 @@ interactions: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.81 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"pubip\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip\",\r\n @@ -502,7 +502,7 @@ interactions: accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip2?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip2?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"pubip2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip2\",\r\n @@ -608,7 +608,7 @@ interactions: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.81 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip2?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip2?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"pubip2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip2\",\r\n @@ -720,7 +720,7 @@ interactions: accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"myvnet\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet\",\r\n @@ -835,7 +835,7 @@ interactions: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.81 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"myvnet\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet\",\r\n diff --git a/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_firewall_management_ip_config.yaml b/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_firewall_management_ip_config.yaml index c08cb014ef1..da8450d3aaf 100644 --- a/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_firewall_management_ip_config.yaml +++ b/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_firewall_management_ip_config.yaml @@ -285,7 +285,7 @@ interactions: accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"pubip\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip\",\r\n @@ -391,7 +391,7 @@ interactions: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.81 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"pubip\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip\",\r\n @@ -502,7 +502,7 @@ interactions: accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip2?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip2?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"pubip2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip2\",\r\n @@ -608,7 +608,7 @@ interactions: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.81 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip2?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip2?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"pubip2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip2\",\r\n @@ -719,7 +719,7 @@ interactions: accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip3?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip3?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"pubip3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip3\",\r\n @@ -825,7 +825,7 @@ interactions: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.81 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip3?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip3?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"pubip3\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip3\",\r\n @@ -936,7 +936,7 @@ interactions: accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip4?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip4?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"pubip4\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip4\",\r\n @@ -1042,7 +1042,7 @@ interactions: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.81 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip4?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip4?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"pubip4\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/publicIPAddresses/pubip4\",\r\n @@ -1154,7 +1154,7 @@ interactions: accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"myvnet\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet\",\r\n @@ -1269,7 +1269,7 @@ interactions: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.81 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"myvnet\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet\",\r\n @@ -1389,7 +1389,7 @@ interactions: accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet2?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet2?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"myvnet2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet2\",\r\n @@ -1504,7 +1504,7 @@ interactions: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.81 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet2?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet2?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"myvnet2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet2\",\r\n @@ -1624,7 +1624,7 @@ interactions: accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet4?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet4?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"myvnet4\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet4\",\r\n @@ -1739,7 +1739,7 @@ interactions: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.81 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet4?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet4?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"myvnet4\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_management_ip_config000001/providers/Microsoft.Network/virtualNetworks/myvnet4\",\r\n diff --git a/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_firewall_with_firewall_policy.yaml b/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_firewall_with_firewall_policy.yaml index 472d97e0c03..724f61d1083 100644 --- a/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_firewall_with_firewall_policy.yaml +++ b/src/azure-firewall/azext_firewall/tests/latest/recordings/test_azure_firewall_with_firewall_policy.yaml @@ -8457,7 +8457,7 @@ interactions: accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_with_firewall_policy000001/providers/Microsoft.Network/publicIPAddresses/pubip?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_with_firewall_policy000001/providers/Microsoft.Network/publicIPAddresses/pubip?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"pubip\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_with_firewall_policy000001/providers/Microsoft.Network/publicIPAddresses/pubip\",\r\n @@ -8565,7 +8565,7 @@ interactions: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.81 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_with_firewall_policy000001/providers/Microsoft.Network/publicIPAddresses/pubip?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_with_firewall_policy000001/providers/Microsoft.Network/publicIPAddresses/pubip?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"pubip\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_with_firewall_policy000001/providers/Microsoft.Network/publicIPAddresses/pubip\",\r\n @@ -8632,7 +8632,7 @@ interactions: accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_with_firewall_policy000001/providers/Microsoft.Network/virtualNetworks/myvnet?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_with_firewall_policy000001/providers/Microsoft.Network/virtualNetworks/myvnet?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"myvnet\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_with_firewall_policy000001/providers/Microsoft.Network/virtualNetworks/myvnet\",\r\n @@ -8749,7 +8749,7 @@ interactions: - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/9.0.0 Azure-SDK-For-Python AZURECLI/2.0.81 method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_with_firewall_policy000001/providers/Microsoft.Network/virtualNetworks/myvnet?api-version=2019-11-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_with_firewall_policy000001/providers/Microsoft.Network/virtualNetworks/myvnet?api-version=2020-03-01 response: body: string: "{\r\n \"name\": \"myvnet\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_azure_firewall_with_firewall_policy000001/providers/Microsoft.Network/virtualNetworks/myvnet\",\r\n diff --git a/src/connectedk8s/HISTORY.rst b/src/connectedk8s/HISTORY.rst index 8c34bccfff8..26167b8bc70 100644 --- a/src/connectedk8s/HISTORY.rst +++ b/src/connectedk8s/HISTORY.rst @@ -3,6 +3,15 @@ Release History =============== -0.1.0 +0.2.1 +++++++ +* `az connectedk8s connect`: Added kubernetes distribution. + +0.2.0 +++++++ +* `az connectedk8s connect`: Added telemetry. +* `az connectedk8s delete`: Added telemetry. + +0.1.5 ++++++ * Initial release. \ No newline at end of file diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index d7f3033261a..eafb6b8460c 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -5,7 +5,6 @@ import os import json -import uuid import time import subprocess from subprocess import Popen, PIPE @@ -17,6 +16,7 @@ from azure.cli.core.commands.client_factory import get_subscription_id from azure.cli.core.util import sdk_no_wait from azure.cli.core._profile import Profile +from azure.cli.core import telemetry from azext_connectedk8s._client_factory import _graph_client_factory from azext_connectedk8s._client_factory import cf_resource_groups from azext_connectedk8s._client_factory import _resource_client_factory @@ -31,6 +31,34 @@ logger = get_logger(__name__) +Invalid_Location_Fault_Type = 'location-validation-error' +Load_Kubeconfig_Fault_Type = 'kubeconfig-load-error' +Read_ConfigMap_Fault_Type = 'configmap-read-error' +Create_ConnectedCluster_Fault_Type = 'connected-cluster-create-error' +Delete_ConnectedCluster_Fault_Type = 'connected-cluster-delete-error' +Bad_DeleteRequest_Fault_Type = 'bad-delete-request-error' +Cluster_Already_Onboarded_Fault_Type = 'cluster-already-onboarded-error' +Resource_Already_Exists_Fault_Type = 'resource-already-exists-error' +Create_ResourceGroup_Fault_Type = 'resource-group-creation-error' +Add_HelmRepo_Fault_Type = 'helm-repo-add-error' +List_HelmRelease_Fault_Type = 'helm-list-release-error' +KeyPair_Generate_Fault_Type = 'keypair-generation-error' +PublicKey_Export_Fault_Type = 'publickey-export-error' +PrivateKey_Export_Fault_Type = 'privatekey-export-error' +Install_HelmRelease_Fault_Type = 'helm-release-install-error' +Delete_HelmRelease_Fault_Type = 'helm-release-delete-error' +Check_PodStatus_Fault_Type = 'check-pod-status-error' +Kubernetes_Connectivity_FaultType = 'kubernetes-cluster-connection-error' +Helm_Version_Fault_Type = 'helm-not-updated-error' +Check_HelmVersion_Fault_Type = 'helm-version-check-error' +Helm_Installation_Fault_Type = 'helm-not-installed-error' +Check_HelmInstallation_Fault_Type = 'check-helm-installed-error' +Get_HelmRegistery_Path_Fault_Type = 'helm-registry-path-fetch-error' +Pull_HelmChart_Fault_Type = 'helm-chart-pull-error' +Export_HelmChart_Fault_Type = 'helm-chart-export-error' +Get_Kubernetes_Version_Fault_Type = 'kubernetes-get-version-error' +Get_Kubernetes_Distro_Fault_Type = 'kubernetes-get-distribution-error' + # pylint:disable=unused-argument # pylint: disable=too-many-locals @@ -62,6 +90,9 @@ def create_connectedk8s(cmd, client, resource_group_name, cluster_name, location try: config.load_kube_config(config_file=kube_config, context=kube_context) except Exception as e: + telemetry.set_user_fault() + telemetry.set_exception(exception=e, fault_type=Load_Kubeconfig_Fault_Type, + summary='Problem loading the kubeconfig file') raise CLIError("Problem loading the kubeconfig file." + str(e)) configuration = kube_client.Configuration() @@ -70,11 +101,22 @@ def create_connectedk8s(cmd, client, resource_group_name, cluster_name, location # if the user had not logged in. check_kube_connection(configuration) + # Get kubernetes cluster info for telemetry + kubernetes_version = get_server_version(configuration) + kubernetes_distro = get_kubernetes_distro(configuration) + + kubernetes_properties = { + 'Context.Default.AzureCLI.KubernetesVersion': kubernetes_version, + 'Context.Default.AzureCLI.KubernetesDistro': kubernetes_distro + } + telemetry.add_extension_event('connectedk8s', kubernetes_properties) + # Checking helm installation check_helm_install(kube_config, kube_context) # Check helm version - check_helm_version(kube_config, kube_context) + helm_version = check_helm_version(kube_config, kube_context) + telemetry.add_extension_event('connectedk8s', {'Context.Default.AzureCLI.HelmVersion': helm_version}) # Validate location rp_locations = [] @@ -84,6 +126,9 @@ def create_connectedk8s(cmd, client, resource_group_name, cluster_name, location if resourceTypes.resource_type == 'connectedClusters': rp_locations = [location.replace(" ", "").lower() for location in resourceTypes.locations] if location.lower() not in rp_locations: + telemetry.set_user_fault() + telemetry.set_exception(exception='Location not supported', fault_type=Invalid_Location_Fault_Type, + summary='Provided location is not supported for creating connected clusters') raise CLIError("Connected cluster resource creation is supported only in the following locations: " + ', '.join(map(str, rp_locations)) + ". Use the --location flag to specify one of these locations.") @@ -97,6 +142,8 @@ def create_connectedk8s(cmd, client, resource_group_name, cluster_name, location try: configmap = api_instance.read_namespaced_config_map('azure-clusterconfig', 'azure-arc') except Exception as e: # pylint: disable=broad-except + telemetry.set_exception(exception=e, fault_type=Read_ConfigMap_Fault_Type, + summary='Unable to read ConfigMap') raise CLIError("Unable to read ConfigMap 'azure-clusterconfig' in 'azure-arc' namespace: %s\n" % e) configmap_rg_name = configmap.data["AZURE_RESOURCE_GROUP"] configmap_cluster_name = configmap.data["AZURE_RESOURCE_NAME"] @@ -111,9 +158,14 @@ def create_connectedk8s(cmd, client, resource_group_name, cluster_name, location return sdk_no_wait(no_wait, client.create, resource_group_name=resource_group_name, cluster_name=cluster_name, connected_cluster=cc) except CloudError as ex: + telemetry.set_exception(exception=ex, fault_type=Create_ConnectedCluster_Fault_Type, + summary='Unable to create connected cluster resource') raise CLIError(ex) else: - raise CLIError("The kubernetes cluster you are trying to onboard" + + telemetry.set_user_fault() + telemetry.set_exception(exception='The kubernetes cluster is already onboarded', fault_type=Cluster_Already_Onboarded_Fault_Type, + summary='Kubernetes cluster already onboarded') + raise CLIError("The kubernetes cluster you are trying to onboard " + "is already onboarded to the resource group" + " '{}' with resource name '{}'.".format(configmap_rg_name, configmap_cluster_name)) else: @@ -121,6 +173,9 @@ def create_connectedk8s(cmd, client, resource_group_name, cluster_name, location delete_arc_agents(release_namespace, kube_config, kube_context, configuration) else: if connected_cluster_exists(client, resource_group_name, cluster_name): + telemetry.set_user_fault() + telemetry.set_exception(exception='The connected cluster resource already exists', fault_type=Resource_Already_Exists_Fault_Type, + summary='Connected cluster resource already exists') raise CLIError("The connected cluster resource {} already exists ".format(cluster_name) + "in the resource group {} ".format(resource_group_name) + "and corresponds to a different Kubernetes cluster. To onboard this Kubernetes cluster" + @@ -132,6 +187,8 @@ def create_connectedk8s(cmd, client, resource_group_name, cluster_name, location try: resourceClient.resource_groups.create_or_update(resource_group_name, resource_group_params) except Exception as e: + telemetry.set_exception(exception=e, fault_type=Create_ResourceGroup_Fault_Type, + summary='Failed to create the resource group') raise CLIError("Failed to create the resource group {} :".format(resource_group_name) + str(e)) # Adding helm repo @@ -144,38 +201,51 @@ def create_connectedk8s(cmd, client, resource_group_name, cluster_name, location response_helm_repo = Popen(cmd_helm_repo, stdout=PIPE, stderr=PIPE) _, error_helm_repo = response_helm_repo.communicate() if response_helm_repo.returncode != 0: + telemetry.set_exception(exception=error_helm_repo.decode("ascii"), fault_type=Add_HelmRepo_Fault_Type, + summary='Failed to add helm repository') raise CLIError("Unable to add repository {} to helm: ".format(repo_url) + error_helm_repo.decode("ascii")) # Retrieving Helm chart OCI Artifact location - registery_path = get_helm_registery(profile, location) + registry_path = os.getenv('HELMREGISTRY') if os.getenv('HELMREGISTRY') else get_helm_registry(profile, location) - # Pulling helm chart from registery + # Get azure-arc agent version for telemetry + azure_arc_agent_version = registry_path.split(':')[1] + telemetry.add_extension_event('connectedk8s', {'Context.Default.AzureCLI.AgentVersion': azure_arc_agent_version}) + + # Pulling helm chart from registry os.environ['HELM_EXPERIMENTAL_OCI'] = '1' - pull_helm_chart(registery_path, kube_config, kube_context) + pull_helm_chart(registry_path, kube_config, kube_context) # Exporting helm chart chart_export_path = os.path.join(os.path.expanduser('~'), '.azure', 'AzureArcCharts') - export_helm_chart(registery_path, chart_export_path, kube_config, kube_context) + export_helm_chart(registry_path, chart_export_path, kube_config, kube_context) # Generate public-private key pair try: key_pair = RSA.generate(4096) except Exception as e: + telemetry.set_exception(exception=e, fault_type=KeyPair_Generate_Fault_Type, + summary='Failed to generate public-private key pair') raise CLIError("Failed to generate public-private key pair. " + str(e)) try: public_key = get_public_key(key_pair) except Exception as e: - raise CLIError("Failed to generate public key." + str(e)) + telemetry.set_exception(exception=e, fault_type=PublicKey_Export_Fault_Type, + summary='Failed to export public key') + raise CLIError("Failed to export public key." + str(e)) try: private_key_pem = get_private_key(key_pair) except Exception as e: - raise CLIError("Failed to generate private key." + str(e)) + telemetry.set_exception(exception=e, fault_type=PrivateKey_Export_Fault_Type, + summary='Failed to export private key') + raise CLIError("Failed to export private key." + str(e)) # Helm Install helm_chart_path = os.path.join(chart_export_path, 'azure-arc-k8sagents') chart_path = os.getenv('HELMCHART') if os.getenv('HELMCHART') else helm_chart_path cmd_helm_install = ["helm", "upgrade", "--install", "azure-arc", chart_path, "--set", "global.subscriptionId={}".format(subscription_id), + "--set", "global.kubernetesDistro={}".format(kubernetes_distro), "--set", "global.resourceGroupName={}".format(resource_group_name), "--set", "global.resourceName={}".format(cluster_name), "--set", "global.location={}".format(location), @@ -188,6 +258,8 @@ def create_connectedk8s(cmd, client, resource_group_name, cluster_name, location response_helm_install = Popen(cmd_helm_install, stdout=PIPE, stderr=PIPE) _, error_helm_install = response_helm_install.communicate() if response_helm_install.returncode != 0: + telemetry.set_exception(exception=error_helm_install.decode("ascii"), fault_type=Install_HelmRelease_Fault_Type, + summary='Unable to install helm release') raise CLIError("Unable to install helm release: " + error_helm_install.decode("ascii")) # Create connected cluster resource @@ -199,6 +271,8 @@ def create_connectedk8s(cmd, client, resource_group_name, cluster_name, location if no_wait: return put_cc_response except CloudError as ex: + telemetry.set_exception(exception=ex, fault_type=Create_ConnectedCluster_Fault_Type, + summary='Unable to create connected cluster resource') raise CLIError(ex) # Getting total number of pods scheduled to run in azure-arc namespace @@ -209,6 +283,8 @@ def create_connectedk8s(cmd, client, resource_group_name, cluster_name, location try: check_pod_status(pod_dict) except Exception as e: # pylint: disable=broad-except + telemetry.set_exception(exception=e, fault_type=Check_PodStatus_Fault_Type, + summary='Failed to check arc agent pods statuses') logger.warning("Failed to check arc agent pods statuses: %s", e) return put_cc_response @@ -234,6 +310,9 @@ def check_kube_connection(configuration): try: api_instance.get_api_resources() except Exception as e: + telemetry.set_user_fault() + telemetry.set_exception(exception=e, fault_type=Kubernetes_Connectivity_FaultType, + summary='Unable to verify connectivity to the Kubernetes cluster') logger.warning("Unable to verify connectivity to the Kubernetes cluster: %s\n", e) raise CLIError("If you are using AAD Enabled cluster, " + "verify that you are able to access the cluster. Learn more at " + @@ -249,10 +328,18 @@ def check_helm_install(kube_config, kube_context): _, error_helm_installed = response_helm_installed.communicate() if response_helm_installed.returncode != 0: if "unknown flag" in error_helm_installed.decode("ascii"): + telemetry.set_user_fault() + telemetry.set_exception(exception='Helm 3 not found', fault_type=Helm_Version_Fault_Type, + summary='Helm3 not found on the machine') raise CLIError("Please install the latest version of Helm. " + "Learn more at https://aka.ms/arc/k8s/onboarding-helm-install") + telemetry.set_user_fault() + telemetry.set_exception(exception=error_helm_installed.decode("ascii"), fault_type=Helm_Installation_Fault_Type, + summary='Helm3 not installed on the machine') raise CLIError(error_helm_installed.decode("ascii")) - except FileNotFoundError: + except FileNotFoundError as e: + telemetry.set_exception(exception=e, fault_type=Check_HelmInstallation_Fault_Type, + summary='Unable to verify helm installation') raise CLIError("Helm is not installed or requires elevated permissions. " + "Ensure that you have the latest version of Helm installed on your machine. " + "Learn more at https://aka.ms/arc/k8s/onboarding-helm-install") @@ -268,11 +355,17 @@ def check_helm_version(kube_config, kube_context): response_helm_version = Popen(cmd_helm_version, stdout=PIPE, stderr=PIPE) output_helm_version, error_helm_version = response_helm_version.communicate() if response_helm_version.returncode != 0: + telemetry.set_exception(exception=error_helm_version.decode('ascii'), fault_type=Check_HelmVersion_Fault_Type, + summary='Unable to determine helm version') raise CLIError("Unable to determine helm version: " + error_helm_version.decode("ascii")) if "v2" in output_helm_version.decode("ascii"): + telemetry.set_user_fault() + telemetry.set_exception(exception='Helm 3 not found', fault_type=Helm_Version_Fault_Type, + summary='Helm3 not found on the machine') raise CLIError("Helm version 3+ is required. " + "Ensure that you have installed the latest version of Helm. " + "Learn more at https://aka.ms/arc/k8s/onboarding-helm-install") + return output_helm_version.decode('ascii') def resource_group_exists(ctx, resource_group_name, subscription_id=None): @@ -294,44 +387,52 @@ def connected_cluster_exists(client, resource_group_name, cluster_name): return True -def get_helm_registery(profile, location): +def get_helm_registry(profile, location): cred, _, _ = profile.get_login_credentials( resource='https://management.core.windows.net/') token = cred._token_retriever()[2].get('accessToken') # pylint: disable=protected-access get_chart_location_url = "https://{}.dp.kubernetesconfiguration.azure.com/{}/GetLatestHelmPackagePath?api-version=2019-11-01-preview".format(location, 'azure-arc-k8sagents') query_parameters = {} - query_parameters['releaseTrain'] = 'stable' + query_parameters['releaseTrain'] = os.getenv('RELEASETRAIN') if os.getenv('RELEASETRAIN') else 'stable' header_parameters = {} header_parameters['Authorization'] = "Bearer {}".format(str(token)) try: response = requests.post(get_chart_location_url, params=query_parameters, headers=header_parameters) except Exception as e: - raise CLIError("Error while fetching helm chart registery path: " + str(e)) + telemetry.set_exception(exception=e, fault_type=Get_HelmRegistery_Path_Fault_Type, + summary='Error while fetching helm chart registry path') + raise CLIError("Error while fetching helm chart registry path: " + str(e)) if response.status_code == 200: return response.json().get('repositoryPath') - raise CLIError("Error while fetching helm chart registery path: {}".format(str(response.json()))) + telemetry.set_exception(exception=str(response.json()), fault_type=Get_HelmRegistery_Path_Fault_Type, + summary='Error while fetching helm chart registry path') + raise CLIError("Error while fetching helm chart registry path: {}".format(str(response.json()))) -def pull_helm_chart(registery_path, kube_config, kube_context): - cmd_helm_chart_pull = ["helm", "chart", "pull", registery_path, "--kubeconfig", kube_config] +def pull_helm_chart(registry_path, kube_config, kube_context): + cmd_helm_chart_pull = ["helm", "chart", "pull", registry_path, "--kubeconfig", kube_config] if kube_context: cmd_helm_chart_pull.extend(["--kube-context", kube_context]) response_helm_chart_pull = subprocess.Popen(cmd_helm_chart_pull, stdout=PIPE, stderr=PIPE) _, error_helm_chart_pull = response_helm_chart_pull.communicate() if response_helm_chart_pull.returncode != 0: - raise CLIError("Unable to pull helm chart from the registery '{}': ".format(registery_path) + error_helm_chart_pull.decode("ascii")) + telemetry.set_exception(exception=error_helm_chart_pull.decode("ascii"), fault_type=Pull_HelmChart_Fault_Type, + summary='Unable to pull helm chart from the registry') + raise CLIError("Unable to pull helm chart from the registry '{}': ".format(registry_path) + error_helm_chart_pull.decode("ascii")) -def export_helm_chart(registery_path, chart_export_path, kube_config, kube_context): +def export_helm_chart(registry_path, chart_export_path, kube_config, kube_context): chart_export_path = os.path.join(os.path.expanduser('~'), '.azure', 'AzureArcCharts') - cmd_helm_chart_export = ["helm", "chart", "export", registery_path, "--destination", chart_export_path, "--kubeconfig", kube_config] + cmd_helm_chart_export = ["helm", "chart", "export", registry_path, "--destination", chart_export_path, "--kubeconfig", kube_config] if kube_context: cmd_helm_chart_export.extend(["--kube-context", kube_context]) response_helm_chart_export = subprocess.Popen(cmd_helm_chart_export, stdout=PIPE, stderr=PIPE) _, error_helm_chart_export = response_helm_chart_export.communicate() if response_helm_chart_export.returncode != 0: - raise CLIError("Unable to export helm chart from the registery '{}': ".format(registery_path) + error_helm_chart_export.decode("ascii")) + telemetry.set_exception(exception=error_helm_chart_export.decode("ascii"), fault_type=Export_HelmChart_Fault_Type, + summary='Unable to export helm chart from the registry') + raise CLIError("Unable to export helm chart from the registry '{}': ".format(registry_path) + error_helm_chart_export.decode("ascii")) def get_public_key(key_pair): @@ -346,39 +447,33 @@ def get_private_key(key_pair): return PEM.encode(privKey_DER, "RSA PRIVATE KEY") -def get_node_count(configuration): - api_instance = kube_client.CoreV1Api(kube_client.ApiClient(configuration)) - try: - api_response = api_instance.list_node() - return len(api_response.items) - except Exception as e: # pylint: disable=broad-except - logger.warning("Exception while fetching nodes: %s\n", e) - - def get_server_version(configuration): api_instance = kube_client.VersionApi(kube_client.ApiClient(configuration)) try: api_response = api_instance.get_code() return api_response.git_version except Exception as e: # pylint: disable=broad-except + telemetry.set_exception(exception=e, fault_type=Get_Kubernetes_Version_Fault_Type, + summary='Unable to fetch kubernetes version') logger.warning("Unable to fetch kubernetes version: %s\n", e) -def get_agent_version(configuration): +def get_kubernetes_distro(configuration): api_instance = kube_client.CoreV1Api(kube_client.ApiClient(configuration)) try: - api_response = api_instance.read_namespaced_config_map('azure-clusterconfig', 'azure-arc') - return api_response.data["AZURE_ARC_AGENT_VERSION"] + api_response = api_instance.list_node() + if api_response.items: + labels = api_response.items[0].metadata.labels + if labels.get("node.openshift.io/os_id") == "rhcos" or labels.get("node.openshift.io/os_id") == "rhel": + return "openshift" + return "default" except Exception as e: # pylint: disable=broad-except - logger.warning("Unable to read ConfigMap 'azure-clusterconfig' in 'azure-arc' namespace: %s\n", e) + telemetry.set_exception(exception=e, fault_type=Get_Kubernetes_Distro_Fault_Type, + summary='Unable to fetch kubernetes distribution') + logger.warning("Exception while trying to fetch kubernetes distribution: %s\n", e) def generate_request_payload(configuration, location, public_key, tags): - # Fetch cluster info - total_node_count = get_node_count(configuration) - kubernetes_version = get_server_version(configuration) - azure_arc_agent_version = get_agent_version(configuration) - # Create connected cluster resource object aad_profile = ConnectedClusterAADProfile( tenant_id="", @@ -395,9 +490,6 @@ def generate_request_payload(configuration, location, public_key, tags): identity=identity, agent_public_key_certificate=public_key, aad_profile=aad_profile, - kubernetes_version=kubernetes_version, - total_node_count=total_node_count, - agent_version=azure_arc_agent_version, tags=tags ) return cc @@ -439,6 +531,7 @@ def check_pod_status(pod_dict): "Run 'kubectl get pods -n azure-arc' to check the pod status.") if all(ele == 1 for ele in list(pod_dict.values())): return + telemetry.add_extension_event('connectedk8s', {'Context.Default.AzureCLI.ExitStatus': 'Timedout'}) logger.warning("%s%s", 'The pods were unable to start before timeout. ', 'Please run "kubectl get pods -n azure-arc" to ensure if the pods are in running state.') @@ -468,6 +561,9 @@ def delete_connectedk8s(cmd, client, resource_group_name, cluster_name, try: config.load_kube_config(config_file=kube_config, context=kube_context) except Exception as e: + telemetry.set_user_fault() + telemetry.set_exception(exception=e, fault_type=Load_Kubeconfig_Fault_Type, + summary='Problem loading the kubeconfig file') raise CLIError("Problem loading the kubeconfig file." + str(e)) configuration = kube_client.Configuration() @@ -493,12 +589,17 @@ def delete_connectedk8s(cmd, client, resource_group_name, cluster_name, try: configmap = api_instance.read_namespaced_config_map('azure-clusterconfig', 'azure-arc') except Exception as e: # pylint: disable=broad-except - logger.warning("Unable to read ConfigMap 'azure-clusterconfig' in 'azure-arc' namespace: %s\n", e) + telemetry.set_exception(exception=e, fault_type=Read_ConfigMap_Fault_Type, + summary='Unable to read ConfigMap') + raise CLIError("Unable to read ConfigMap 'azure-clusterconfig' in 'azure-arc' namespace: %s\n" % e) if (configmap.data["AZURE_RESOURCE_GROUP"].lower() == resource_group_name.lower() and configmap.data["AZURE_RESOURCE_NAME"].lower() == cluster_name.lower()): delete_cc_resource(client, resource_group_name, cluster_name, no_wait) else: + telemetry.set_user_fault() + telemetry.set_exception(exception='Unable to delete connected cluster', fault_type=Bad_DeleteRequest_Fault_Type, + summary='The resource cannot be deleted as kubernetes cluster is onboarded with some other resource id') raise CLIError("The current context in the kubeconfig file does not correspond " + "to the connected cluster resource specified. Agents installed on this cluster correspond " + "to the resource group name '{}' ".format(configmap.data["AZURE_RESOURCE_GROUP"]) + @@ -515,6 +616,8 @@ def get_release_namespace(kube_config, kube_context): response_helm_release = Popen(cmd_helm_release, stdout=PIPE, stderr=PIPE) output_helm_release, error_helm_release = response_helm_release.communicate() if response_helm_release.returncode != 0: + telemetry.set_exception(exception=error_helm_release.decode("ascii"), fault_type=List_HelmRelease_Fault_Type, + summary='Unable to list helm release') raise CLIError("Helm list release failed: " + error_helm_release.decode("ascii")) output_helm_release = output_helm_release.decode("ascii") output_helm_release = json.loads(output_helm_release) @@ -530,6 +633,8 @@ def delete_cc_resource(client, resource_group_name, cluster_name, no_wait): resource_group_name=resource_group_name, cluster_name=cluster_name) except CloudError as ex: + telemetry.set_exception(exception=ex, fault_type=Delete_ConnectedCluster_Fault_Type, + summary='Unable to create connected cluster resource') raise CLIError(ex) @@ -540,6 +645,8 @@ def delete_arc_agents(release_namespace, kube_config, kube_context, configuratio response_helm_delete = Popen(cmd_helm_delete, stdout=PIPE, stderr=PIPE) _, error_helm_delete = response_helm_delete.communicate() if response_helm_delete.returncode != 0: + telemetry.set_exception(exception=error_helm_delete.decode("ascii"), fault_type=Delete_HelmRelease_Fault_Type, + summary='Unable to delete helm release') raise CLIError("Error occured while cleaning up arc agents. " + "Helm release deletion failed: " + error_helm_delete.decode("ascii")) ensure_namespace_cleanup(configuration) @@ -565,11 +672,3 @@ def update_connectedk8s(cmd, instance, tags=None): with cmd.update_context(instance) as c: c.set_param('tags', tags) return instance - - -def _is_guid(guid): - try: - uuid.UUID(guid) - return True - except ValueError: - return False diff --git a/src/connectedk8s/setup.py b/src/connectedk8s/setup.py index 2b549d2c1e5..572dfe2f9e3 100644 --- a/src/connectedk8s/setup.py +++ b/src/connectedk8s/setup.py @@ -16,7 +16,8 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.1.5' + +VERSION = '0.2.1' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers diff --git a/src/custom-providers/HISTORY.rst b/src/custom-providers/HISTORY.rst new file mode 100644 index 00000000000..1c139576ba0 --- /dev/null +++ b/src/custom-providers/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/custom-providers/README.md b/src/custom-providers/README.md new file mode 100644 index 00000000000..e675d470514 --- /dev/null +++ b/src/custom-providers/README.md @@ -0,0 +1,43 @@ +# Azure CLI Custom Providers Extension +This is a extension for Custom Providers features. + +### How to use +Install this extension using the below CLI command +``` +az extension add --name custom-providers +``` + +### Included Features +#### Manage custom resource provider: + + +##### Create or update a custom resource provider + +``` +az custom-providers resource-provider create -n MyRP -g MyRG --action name=ping endpoint=https://test.azurewebsites.net/api routing_type=Proxy --resource-type name=users endpoint=https://test.azurewebsites.net/api routing_type="Proxy, Cache" --validation validation_type=swagger specification=https://raw.githubusercontent.com/test.json +``` + +##### Update the tags for a custom resource provider +``` +az custom-providers resource-provider update -g MyRG -n MyRP --tags a=b +``` + +##### Get a custom resource provider +``` +az custom-providers resource-provider show -g MyRG -n MyRP +``` + +##### Get all the custom resource providers within a resource group or in the current subscription +``` +az custom-providers resource-provider list +``` +``` +az custom-providers resource-provider list -g MyRG +``` + +##### Delete a custom resource provider +``` +az custom-providers resource-provider delete -g MyRG -n MyRP +``` + +If you have issues, please give feedback by opening an issue at https://github.com/Azure/azure-cli-extensions/issues. \ No newline at end of file diff --git a/src/custom-providers/azext_custom_providers/__init__.py b/src/custom-providers/azext_custom_providers/__init__.py new file mode 100644 index 00000000000..04ccaa71739 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/__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_custom_providers._help import helps # pylint: disable=unused-import + + +class CustomprovidersCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_custom_providers._client_factory import cf_custom_providers + custom_providers_custom = CliCommandType( + operations_tmpl='azext_custom_providers.custom#{}', + client_factory=cf_custom_providers) + super(CustomprovidersCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=custom_providers_custom) + + def load_command_table(self, args): + from azext_custom_providers.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_custom_providers._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = CustomprovidersCommandsLoader diff --git a/src/custom-providers/azext_custom_providers/_client_factory.py b/src/custom-providers/azext_custom_providers/_client_factory.py new file mode 100644 index 00000000000..07af0d4489e --- /dev/null +++ b/src/custom-providers/azext_custom_providers/_client_factory.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def cf_custom_providers(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from .vendored_sdks.customproviders import CustomProvidersClient + return get_mgmt_service_client(cli_ctx, CustomProvidersClient) + + +def cf_custom_resource_provider(cli_ctx, *_): + return cf_custom_providers(cli_ctx).custom_resource_provider diff --git a/src/custom-providers/azext_custom_providers/_help.py b/src/custom-providers/azext_custom_providers/_help.py new file mode 100644 index 00000000000..5709cbf6eb2 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/_help.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=line-too-long +from knack.help_files import helps # pylint: disable=unused-import + + +helps['custom-providers resource-provider'] = """ +type: group +short-summary: Commands to manage custom resource provider. +""" + +helps['custom-providers resource-provider create'] = """ +type: command +short-summary: Create or update the custom resource provider. +parameters: + - name: --action -a + short-summary: Add an action to the custom resource provider. + long-summary: | + Usage: --action name=ping endpoint="https://test.azurewebsites.net/api/{requestPath}" routing_type=Proxy + + name: Required. The name of the action. + endpoint: Required. The endpoint URI that the custom resource provider will proxy requests to. + routing_type: The routing types that are supported for action requests. Possible values include: 'Proxy'. + + Multiple actions can be specified by using more than one `--action` argument. + - name: --resource-type -r + short-summary: Add a custom resource type to the custom resource provider. + long-summary: | + Usage: --resource-type name=user endpoint="https://test.azurewebsites.net/api/{requestPath}" routing_type="Proxy, Cache" + + name: Required. The name of the resource type. + endpoint: Required. The endpoint URI that the custom resource provider will proxy requests to. + routing_type: The routing types that are supported for resource requests. Possible values include: 'Proxy', 'Proxy,Cache'. + + Multiple resource types can be specified by using more than one `--resource-type` argument. + - name: --validation -v + short-summary: Add a validation to the custom resource provider. + long-summary: | + Usage: --validation specification="https://raw.githubusercontent.com/" validation_type="Swagger" + + specification: A link to the validation specification.vThe specification must be hosted on raw.githubusercontent.com. + validation_type: The type of validation to run against a matching request. Possible values include: 'Swagger'. + + Multiple validations can be specified by using more than one `--validation` argument. +examples: + - name: Create or update a custom resource provider. + text: |- + az custom-providers resource-provider create -n MyRP -g MyRG \\ + --action name=ping endpoint=https://test.azurewebsites.net/api routing_type=Proxy \\ + --resource-type name=users endpoint=https://test.azurewebsites.net/api routing_type="Proxy, Cache" \\ + --validation validation_type=swagger specification=https://raw.githubusercontent.com/test.json +""" + +helps['custom-providers resource-provider update'] = """ +type: command +short-summary: Update the custom resource provider. Only tags can be updated. +examples: + - name: Update the tags for a custom resource provider. + text: |- + az custom-providers resource-provider update -g MyRG -n MyRP --tags a=b +""" + +helps['custom-providers resource-provider delete'] = """ +type: command +short-summary: Delete the custom resource provider. +examples: + - name: Delete a custom resource provider. + text: |- + az custom-providers resource-provider delete -g MyRG -n MyRP +""" + +helps['custom-providers resource-provider show'] = """ +type: command +short-summary: Get the properties for the custom resource provider. +examples: + - name: Get a custom resource provider. + text: |- + az custom-providers resource-provider show -g MyRG -n MyRP +""" + +helps['custom-providers resource-provider list'] = """ +type: command +short-summary: Get all the custom resource providers within a resource group or in the current subscription. +examples: + - name: List all custom resource providers in the resource group. + text: |- + az custom-providers resource-provider list -g MyRG + - name: List all custom resource providers in the current subscription. + text: |- + az custom-providers resource-provider list +""" diff --git a/src/custom-providers/azext_custom_providers/_params.py b/src/custom-providers/azext_custom_providers/_params.py new file mode 100644 index 00000000000..a4dc6f04469 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/_params.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core.commands.parameters import ( + tags_type, + get_location_type, + name_type) +from azure.cli.core.commands.validators import get_default_location_from_resource_group +from .actions import (ActionAddAction, ResourceTypeAddAction, ValidationAddAction) + + +def load_arguments(self, _): + with self.argument_context('custom-providers resource-provider') as c: + c.argument('resource_provider_name', arg_type=name_type, help='The name of the resource provider.') + c.argument('location', + arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('actions', options_list=['--action', '-a'], action=ActionAddAction, nargs='+') + c.argument('resource_types', options_list=['--resource-type', '-r'], action=ResourceTypeAddAction, nargs='+') + c.argument('validations', options_list=['--validation', '-v'], action=ValidationAddAction, nargs='+') diff --git a/src/custom-providers/azext_custom_providers/actions.py b/src/custom-providers/azext_custom_providers/actions.py new file mode 100644 index 00000000000..e38a48a6924 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/actions.py @@ -0,0 +1,44 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=protected-access +# pylint: disable=line-too-long +# pylint: disable=too-few-public-methods +import argparse +from knack.util import CLIError + + +class ActionAddAction(argparse._AppendAction): + + def __call__(self, parser, namespace, values, option_string=None): + from azext_custom_providers.vendored_sdks.customproviders.models import CustomRPActionRouteDefinition as model + action = get_object(values, option_string, model) + super(ActionAddAction, self).__call__(parser, namespace, action, option_string) + + +class ResourceTypeAddAction(argparse._AppendAction): + + def __call__(self, parser, namespace, values, option_string=None): + from azext_custom_providers.vendored_sdks.customproviders.models import CustomRPResourceTypeRouteDefinition as model + resource_type = get_object(values, option_string, model) + super(ResourceTypeAddAction, self).__call__(parser, namespace, resource_type, option_string) + + +class ValidationAddAction(argparse._AppendAction): + + def __call__(self, parser, namespace, values, option_string=None): + from azext_custom_providers.vendored_sdks.customproviders.models import CustomRPValidations as model + validation = get_object(values, option_string, model) + super(ValidationAddAction, self).__call__(parser, namespace, validation, option_string) + + +def get_object(values, option_string, model): + kwargs = {} + for item in values: + try: + key, value = item.split('=', 1) + kwargs[key] = value + except ValueError: + raise CLIError('usage error: {} KEY=VALUE [KEY=VALUE ...]'.format(option_string)) + return model(**kwargs) diff --git a/src/custom-providers/azext_custom_providers/azext_metadata.json b/src/custom-providers/azext_custom_providers/azext_metadata.json new file mode 100644 index 00000000000..13025150393 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1" +} \ No newline at end of file diff --git a/src/custom-providers/azext_custom_providers/commands.py b/src/custom-providers/azext_custom_providers/commands.py new file mode 100644 index 00000000000..f4675335515 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/commands.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# 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 + + +def load_command_table(self, _): + + from ._client_factory import cf_custom_resource_provider + custom_providers_custom_resource_provider = CliCommandType( + operations_tmpl='azext_custom_providers.vendored_sdks.customproviders.operations._custom_resource_provider_operations#CustomResourceProviderOperations.{}', + client_factory=cf_custom_resource_provider) + with self.command_group('custom-providers resource-provider', custom_providers_custom_resource_provider, client_factory=cf_custom_resource_provider, is_experimental=True) as g: + g.custom_command('create', 'create_custom_providers_custom_resource_provider', supports_no_wait=True) + g.custom_command('update', 'update_custom_providers_custom_resource_provider') + g.custom_command('delete', 'delete_custom_providers_custom_resource_provider', supports_no_wait=True, confirmation=True) + g.custom_show_command('show', 'get_custom_providers_custom_resource_provider') + g.custom_command('list', 'list_custom_providers_custom_resource_provider') diff --git a/src/custom-providers/azext_custom_providers/custom.py b/src/custom-providers/azext_custom_providers/custom.py new file mode 100644 index 00000000000..240586f9211 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/custom.py @@ -0,0 +1,52 @@ +# -------------------------------------------------------------------------------------------- +# 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_custom_providers_custom_resource_provider(client, + resource_group_name, + resource_provider_name, + location=None, + tags=None, + actions=None, + resource_types=None, + validations=None, + no_wait=False): + body = {'location': location, 'tags': tags, + 'actions': actions, 'resource_types': resource_types, + 'validations': validations} + return sdk_no_wait(no_wait, client.create_or_update, resource_group_name=resource_group_name, resource_provider_name=resource_provider_name, resource_provider=body) + + +def update_custom_providers_custom_resource_provider(client, + resource_group_name, + resource_provider_name, + tags=None): + return client.update(resource_group_name=resource_group_name, resource_provider_name=resource_provider_name, tags=tags) + + +def delete_custom_providers_custom_resource_provider(client, + resource_group_name, + resource_provider_name, + no_wait=False): + return sdk_no_wait(no_wait, client.delete, resource_group_name=resource_group_name, resource_provider_name=resource_provider_name) + + +def get_custom_providers_custom_resource_provider(client, + resource_group_name, + resource_provider_name): + return client.get(resource_group_name=resource_group_name, resource_provider_name=resource_provider_name) + + +def list_custom_providers_custom_resource_provider(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/custom-providers/azext_custom_providers/tests/latest/recordings/test_custom_providers_common_scenario.yaml b/src/custom-providers/azext_custom_providers/tests/latest/recordings/test_custom_providers_common_scenario.yaml new file mode 100644 index 00000000000..36df7918bf8 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/tests/latest/recordings/test_custom_providers_common_scenario.yaml @@ -0,0 +1,459 @@ +interactions: +- request: + body: '{"location": "westus2", "properties": {"actions": [{"name": "ping", "endpoint": + "https://ayniadjso4lay.azurewebsites.net/api", "routingType": "Proxy"}, {"name": + "ping1", "endpoint": "https://ayniadjso4lay.azurewebsites.net/api1", "routingType": + "Proxy"}], "resourceTypes": [{"name": "users", "endpoint": "https://ayniadjso4lay.azurewebsites.net/api", + "routingType": "Proxy, Cache"}], "validations": [{"validationType": "swagger", + "specification": "https://raw.githubusercontent.com/jsntcy/TestFixDelete/master/test.json"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - custom-providers resource-provider create + Connection: + - keep-alive + Content-Length: + - '524' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --location --action --action --resource-type --validation + User-Agent: + - python/3.7.6 (Windows-10-10.0.18362-SP0) msrest/0.6.11 yulocal msrest_azure/0.6.3 + azure-mgmt-customproviders/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/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/resourceProviders/clitest-crp000002?api-version=2018-09-01-preview + response: + body: + string: '{"properties":{"actions":[{"name":"ping","routingType":"Proxy","endpoint":"https://ayniadjso4lay.azurewebsites.net/api"},{"name":"ping1","routingType":"Proxy","endpoint":"https://ayniadjso4lay.azurewebsites.net/api1"}],"resourceTypes":[{"name":"users","routingType":"Proxy, + Cache","endpoint":"https://ayniadjso4lay.azurewebsites.net/api"}],"validations":[{"validationType":"Swagger","specification":"https://raw.githubusercontent.com/jsntcy/TestFixDelete/master/test.json"}],"provisioningState":"Accepted"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/resourceproviders/clitest-crp000002","name":"clitest-crp000002","type":"Microsoft.CustomProviders/resourceproviders","location":"westus2","tags":{}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/locations/westus2/operationstatuses/eyJqb2JJZCI6Ik1SUENSVUQ6MkRDTEk6NUZURVNUOjVGQ1VTVE9NOjVGUFJPVklERVJTU0JJQ0VCUkZGWFlWV0s2T1ZKVDdUUzVJN1FEM0RZM1lFQ0FYWE8zNUsyRFlQT1hFVk86MkRDTElURVNUOjJEQ1JQNEpOVDNGSEZJIiwiam9iTG9jYXRpb24iOiJXRVNUVVMyIn0?api-version=2018-09-01-preview + cache-control: + - no-cache + content-length: + - '846' + content-type: + - application/json; charset=utf-8 + date: + - Sat, 09 May 2020 08:16:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - custom-providers resource-provider create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --action --action --resource-type --validation + User-Agent: + - python/3.7.6 (Windows-10-10.0.18362-SP0) msrest/0.6.11 yulocal msrest_azure/0.6.3 + azure-mgmt-customproviders/0.1.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/locations/westus2/operationstatuses/eyJqb2JJZCI6Ik1SUENSVUQ6MkRDTEk6NUZURVNUOjVGQ1VTVE9NOjVGUFJPVklERVJTU0JJQ0VCUkZGWFlWV0s2T1ZKVDdUUzVJN1FEM0RZM1lFQ0FYWE8zNUsyRFlQT1hFVk86MkRDTElURVNUOjJEQ1JQNEpOVDNGSEZJIiwiam9iTG9jYXRpb24iOiJXRVNUVVMyIn0?api-version=2018-09-01-preview + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Sat, 09 May 2020 08:16:26 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/locations/westus2/operationstatuses/eyJqb2JJZCI6Ik1SUENSVUQ6MkRDTEk6NUZURVNUOjVGQ1VTVE9NOjVGUFJPVklERVJTU0JJQ0VCUkZGWFlWV0s2T1ZKVDdUUzVJN1FEM0RZM1lFQ0FYWE8zNUsyRFlQT1hFVk86MkRDTElURVNUOjJEQ1JQNEpOVDNGSEZJIiwiam9iTG9jYXRpb24iOiJXRVNUVVMyIn0?api-version=2018-09-01-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - custom-providers resource-provider create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --action --action --resource-type --validation + User-Agent: + - python/3.7.6 (Windows-10-10.0.18362-SP0) msrest/0.6.11 yulocal msrest_azure/0.6.3 + azure-mgmt-customproviders/0.1.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/resourceProviders/clitest-crp000002?api-version=2018-09-01-preview + response: + body: + string: '{"properties":{"actions":[{"name":"ping","routingType":"Proxy","endpoint":"https://ayniadjso4lay.azurewebsites.net/api"},{"name":"ping1","routingType":"Proxy","endpoint":"https://ayniadjso4lay.azurewebsites.net/api1"}],"resourceTypes":[{"name":"users","routingType":"Proxy, + Cache","endpoint":"https://ayniadjso4lay.azurewebsites.net/api"}],"validations":[{"validationType":"Swagger","specification":"https://raw.githubusercontent.com/jsntcy/TestFixDelete/master/test.json"}],"provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/resourceproviders/clitest-crp000002","name":"clitest-crp000002","type":"Microsoft.CustomProviders/resourceproviders","location":"westus2","tags":{}}' + headers: + cache-control: + - no-cache + content-length: + - '847' + content-type: + - application/json; charset=utf-8 + date: + - Sat, 09 May 2020 08:16:27 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - custom-providers resource-provider show + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.7.6 (Windows-10-10.0.18362-SP0) msrest/0.6.11 yulocal msrest_azure/0.6.3 + azure-mgmt-customproviders/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/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/resourceProviders/clitest-crp000002?api-version=2018-09-01-preview + response: + body: + string: '{"properties":{"actions":[{"name":"ping","routingType":"Proxy","endpoint":"https://ayniadjso4lay.azurewebsites.net/api"},{"name":"ping1","routingType":"Proxy","endpoint":"https://ayniadjso4lay.azurewebsites.net/api1"}],"resourceTypes":[{"name":"users","routingType":"Proxy, + Cache","endpoint":"https://ayniadjso4lay.azurewebsites.net/api"}],"validations":[{"validationType":"Swagger","specification":"https://raw.githubusercontent.com/jsntcy/TestFixDelete/master/test.json"}],"provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/resourceproviders/clitest-crp000002","name":"clitest-crp000002","type":"Microsoft.CustomProviders/resourceproviders","location":"westus2","tags":{}}' + headers: + cache-control: + - no-cache + content-length: + - '847' + content-type: + - application/json; charset=utf-8 + date: + - Sat, 09 May 2020 08:16:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - custom-providers resource-provider list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - python/3.7.6 (Windows-10-10.0.18362-SP0) msrest/0.6.11 yulocal msrest_azure/0.6.3 + azure-mgmt-customproviders/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/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/resourceProviders?api-version=2018-09-01-preview + response: + body: + string: '{"value":[{"properties":{"actions":[{"name":"ping","routingType":"Proxy","endpoint":"https://ayniadjso4lay.azurewebsites.net/api"},{"name":"ping1","routingType":"Proxy","endpoint":"https://ayniadjso4lay.azurewebsites.net/api1"}],"resourceTypes":[{"name":"users","routingType":"Proxy, + Cache","endpoint":"https://ayniadjso4lay.azurewebsites.net/api"}],"validations":[{"validationType":"Swagger","specification":"https://raw.githubusercontent.com/jsntcy/TestFixDelete/master/test.json"}],"provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/resourceproviders/clitest-crp000002","name":"clitest-crp000002","type":"Microsoft.CustomProviders/resourceproviders","location":"westus2","tags":{}}]}' + headers: + cache-control: + - no-cache + content-length: + - '859' + content-type: + - application/json; charset=utf-8 + date: + - Sat, 09 May 2020 08:16:33 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"tags": {"a": "b"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - custom-providers resource-provider update + Connection: + - keep-alive + Content-Length: + - '20' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --tags + User-Agent: + - python/3.7.6 (Windows-10-10.0.18362-SP0) msrest/0.6.11 yulocal msrest_azure/0.6.3 + azure-mgmt-customproviders/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/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/resourceProviders/clitest-crp000002?api-version=2018-09-01-preview + response: + body: + string: '{"properties":{"actions":[{"name":"ping","routingType":"Proxy","endpoint":"https://ayniadjso4lay.azurewebsites.net/api"},{"name":"ping1","routingType":"Proxy","endpoint":"https://ayniadjso4lay.azurewebsites.net/api1"}],"resourceTypes":[{"name":"users","routingType":"Proxy, + Cache","endpoint":"https://ayniadjso4lay.azurewebsites.net/api"}],"validations":[{"validationType":"Swagger","specification":"https://raw.githubusercontent.com/jsntcy/TestFixDelete/master/test.json"}],"provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/resourceproviders/clitest-crp000002","name":"clitest-crp000002","type":"Microsoft.CustomProviders/resourceproviders","location":"westus2","tags":{"a":"b"}}' + headers: + cache-control: + - no-cache + content-length: + - '854' + content-type: + - application/json; charset=utf-8 + date: + - Sat, 09 May 2020 08:16:40 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - custom-providers resource-provider delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --resource-group --name -y + User-Agent: + - python/3.7.6 (Windows-10-10.0.18362-SP0) msrest/0.6.11 yulocal msrest_azure/0.6.3 + azure-mgmt-customproviders/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/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/resourceProviders/clitest-crp000002?api-version=2018-09-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/locations/westus2/operationstatuses/eyJqb2JJZCI6Ik1SUENSVUQ6MkRDTEk6NUZURVNUOjVGQ1VTVE9NOjVGUFJPVklERVJTU0JJQ0VCUkZGWFlWV0s2T1ZKVDdUUzVJN1FEM0RZM1lFQ0FYWE8zNUsyRFlQT1hFVk86MkRDTElURVNUOjJEQ1JQNEpOVDNGSEZJIiwiam9iTG9jYXRpb24iOiJXRVNUVVMyIn0?api-version=2018-09-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Sat, 09 May 2020 08:16:44 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/locations/westus2/operationresults/eyJqb2JJZCI6Ik1SUENSVUQ6MkRDTEk6NUZURVNUOjVGQ1VTVE9NOjVGUFJPVklERVJTU0JJQ0VCUkZGWFlWV0s2T1ZKVDdUUzVJN1FEM0RZM1lFQ0FYWE8zNUsyRFlQT1hFVk86MkRDTElURVNUOjJEQ1JQNEpOVDNGSEZJIiwiam9iTG9jYXRpb24iOiJXRVNUVVMyIn0?api-version=2018-09-01-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - custom-providers resource-provider delete + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name -y + User-Agent: + - python/3.7.6 (Windows-10-10.0.18362-SP0) msrest/0.6.11 yulocal msrest_azure/0.6.3 + azure-mgmt-customproviders/0.1.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/locations/westus2/operationstatuses/eyJqb2JJZCI6Ik1SUENSVUQ6MkRDTEk6NUZURVNUOjVGQ1VTVE9NOjVGUFJPVklERVJTU0JJQ0VCUkZGWFlWV0s2T1ZKVDdUUzVJN1FEM0RZM1lFQ0FYWE8zNUsyRFlQT1hFVk86MkRDTElURVNUOjJEQ1JQNEpOVDNGSEZJIiwiam9iTG9jYXRpb24iOiJXRVNUVVMyIn0?api-version=2018-09-01-preview + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Sat, 09 May 2020 08:17:00 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/locations/westus2/operationstatuses/eyJqb2JJZCI6Ik1SUENSVUQ6MkRDTEk6NUZURVNUOjVGQ1VTVE9NOjVGUFJPVklERVJTU0JJQ0VCUkZGWFlWV0s2T1ZKVDdUUzVJN1FEM0RZM1lFQ0FYWE8zNUsyRFlQT1hFVk86MkRDTElURVNUOjJEQ1JQNEpOVDNGSEZJIiwiam9iTG9jYXRpb24iOiJXRVNUVVMyIn0?api-version=2018-09-01-preview + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - custom-providers resource-provider show + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.7.6 (Windows-10-10.0.18362-SP0) msrest/0.6.11 yulocal msrest_azure/0.6.3 + azure-mgmt-customproviders/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/cli_test_custom_providers000001/providers/Microsoft.CustomProviders/resourceProviders/clitest-crp000002?api-version=2018-09-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Sat, 09 May 2020 08:17:03 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 404 + message: Not Found +version: 1 diff --git a/src/custom-providers/azext_custom_providers/tests/latest/test_custom-providers_scenario.py b/src/custom-providers/azext_custom_providers/tests/latest/test_custom-providers_scenario.py new file mode 100644 index 00000000000..c7e31291a46 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/tests/latest/test_custom-providers_scenario.py @@ -0,0 +1,86 @@ +# -------------------------------------------------------------------------------------------- +# 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.testsdk import (ScenarioTest, ResourceGroupPreparer) + + +class CustomProvidersScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_custom_providers') + def test_custom_providers_common_scenario(self): + + rp_name = self.create_random_name('clitest-crp', 20) + self.kwargs.update({ + 'rp_name': rp_name + }) + + self.cmd('az custom-providers resource-provider create ' + '--resource-group {rg} ' + '--name {rp_name} ' + '--location westus2 ' + '--action ' + 'name=ping ' + 'endpoint=https://ayniadjso4lay.azurewebsites.net/api ' + 'routing_type=Proxy ' + '--action ' + 'name=ping1 ' + 'endpoint=https://ayniadjso4lay.azurewebsites.net/api1 ' + 'routing_type=Proxy ' + '--resource-type ' + 'name=users ' + 'endpoint=https://ayniadjso4lay.azurewebsites.net/api ' + 'routing_type="Proxy, Cache" ' + '--validation ' + 'validation_type=swagger ' + 'specification=https://raw.githubusercontent.com/jsntcy/TestFixDelete/master/test.json', + checks=[ + self.check('provisioningState', 'Succeeded'), + self.check('name', rp_name), + self.check('actions[0].name', 'ping'), + self.check('resourceTypes[0].name', 'users'), + self.check('validations[0].validationType', 'Swagger') + ]) + + self.cmd('az custom-providers resource-provider show ' + '--resource-group {rg} ' + '--name {rp_name}', + checks=[ + self.check('provisioningState', 'Succeeded'), + self.check('name', rp_name), + self.check('actions[0].name', 'ping'), + self.check('actions[0].endpoint', 'https://ayniadjso4lay.azurewebsites.net/api'), + self.check('actions[0].routingType', 'Proxy'), + self.check('resourceTypes[0].name', 'users'), + self.check('resourceTypes[0].endpoint', 'https://ayniadjso4lay.azurewebsites.net/api'), + self.check('resourceTypes[0].routingType', 'Proxy, Cache'), + self.check('validations[0].validationType', 'Swagger'), + self.check('validations[0].specification', + 'https://raw.githubusercontent.com/jsntcy/TestFixDelete/master/test.json') + ]) + + self.cmd('az custom-providers resource-provider list ' + '--resource-group {rg}', + checks=[ + self.check('length(@)', 1) + ]) + + self.cmd('az custom-providers resource-provider update ' + '--resource-group {rg} ' + '--name {rp_name} ' + '--tags a=b', + checks=[ + self.check('tags.a', 'b'), + ]) + + self.cmd('az custom-providers resource-provider delete ' + '--resource-group {rg} ' + '--name {rp_name} ' + '-y', + checks=[]) + + self.cmd('az custom-providers resource-provider show ' + '--resource-group {rg} ' + '--name {rp_name}', + expect_failure=True) diff --git a/src/custom-providers/azext_custom_providers/vendored_sdks/__init__.py b/src/custom-providers/azext_custom_providers/vendored_sdks/__init__.py new file mode 100644 index 00000000000..0260537a02b --- /dev/null +++ b/src/custom-providers/azext_custom_providers/vendored_sdks/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/__init__.py b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/__init__.py new file mode 100644 index 00000000000..6fa80a79fc8 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/__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 CustomProvidersClientConfiguration +from ._custom_providers_client import CustomProvidersClient +__all__ = ['CustomProvidersClient', 'CustomProvidersClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/_configuration.py b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/_configuration.py new file mode 100644 index 00000000000..b7b2545c2f0 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/_configuration.py @@ -0,0 +1,49 @@ +# 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 CustomProvidersClientConfiguration(AzureConfiguration): + """Configuration for CustomProvidersClient + 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: The Azure subscription ID. This is a + GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(CustomProvidersClientConfiguration, 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-customproviders/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/_custom_providers_client.py b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/_custom_providers_client.py new file mode 100644 index 00000000000..099a8d5e31b --- /dev/null +++ b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/_custom_providers_client.py @@ -0,0 +1,60 @@ +# 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 CustomProvidersClientConfiguration +from .operations import Operations +from .operations import CustomResourceProviderOperations +from .operations import AssociationsOperations +from . import models + + +class CustomProvidersClient(SDKClient): + """Allows extension of ARM control plane with custom resource providers. + + :ivar config: Configuration for client. + :vartype config: CustomProvidersClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.customproviders.operations.Operations + :ivar custom_resource_provider: CustomResourceProvider operations + :vartype custom_resource_provider: azure.mgmt.customproviders.operations.CustomResourceProviderOperations + :ivar associations: Associations operations + :vartype associations: azure.mgmt.customproviders.operations.AssociationsOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Azure subscription ID. This is a + GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = CustomProvidersClientConfiguration(credentials, subscription_id, base_url) + super(CustomProvidersClient, 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 = '2018-09-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.custom_resource_provider = CustomResourceProviderOperations( + self._client, self.config, self._serialize, self._deserialize) + self.associations = AssociationsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/__init__.py b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/__init__.py new file mode 100644 index 00000000000..52df0f54944 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/__init__.py @@ -0,0 +1,68 @@ +# 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 Association + from ._models_py3 import CustomRPActionRouteDefinition + from ._models_py3 import CustomRPManifest + from ._models_py3 import CustomRPResourceTypeRouteDefinition + from ._models_py3 import CustomRPRouteDefinition + from ._models_py3 import CustomRPValidations + from ._models_py3 import ErrorDefinition + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import Resource + from ._models_py3 import ResourceProviderOperation + from ._models_py3 import ResourceProviderOperationDisplay + from ._models_py3 import ResourceProvidersUpdate +except (SyntaxError, ImportError): + from ._models import Association + from ._models import CustomRPActionRouteDefinition + from ._models import CustomRPManifest + from ._models import CustomRPResourceTypeRouteDefinition + from ._models import CustomRPRouteDefinition + from ._models import CustomRPValidations + from ._models import ErrorDefinition + from ._models import ErrorResponse, ErrorResponseException + from ._models import Resource + from ._models import ResourceProviderOperation + from ._models import ResourceProviderOperationDisplay + from ._models import ResourceProvidersUpdate +from ._paged_models import AssociationPaged +from ._paged_models import CustomRPManifestPaged +from ._paged_models import ResourceProviderOperationPaged +from ._custom_providers_client_enums import ( + ActionRouting, + ResourceTypeRouting, + ValidationType, + ProvisioningState, +) + +__all__ = [ + 'Association', + 'CustomRPActionRouteDefinition', + 'CustomRPManifest', + 'CustomRPResourceTypeRouteDefinition', + 'CustomRPRouteDefinition', + 'CustomRPValidations', + 'ErrorDefinition', + 'ErrorResponse', 'ErrorResponseException', + 'Resource', + 'ResourceProviderOperation', + 'ResourceProviderOperationDisplay', + 'ResourceProvidersUpdate', + 'ResourceProviderOperationPaged', + 'CustomRPManifestPaged', + 'AssociationPaged', + 'ActionRouting', + 'ResourceTypeRouting', + 'ValidationType', + 'ProvisioningState', +] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/tags_resource.py b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_custom_providers_client_enums.py similarity index 52% rename from src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/tags_resource.py rename to src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_custom_providers_client_enums.py index b00182fe1ed..66c28c30a9a 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/tags_resource.py +++ b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_custom_providers_client_enums.py @@ -9,21 +9,29 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.serialization import Model +from enum import Enum -class TagsResource(Model): - """A container holding only the Tags for a resource, allowing the user to - update the tags on a WebTest instance. +class ActionRouting(str, Enum): - :param tags: Resource tags - :type tags: dict[str, str] - """ + proxy = "Proxy" - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - def __init__(self, tags=None): - super(TagsResource, self).__init__() - self.tags = tags +class ResourceTypeRouting(str, Enum): + + proxy = "Proxy" + proxy_cache = "Proxy,Cache" + + +class ValidationType(str, Enum): + + swagger = "Swagger" + + +class ProvisioningState(str, Enum): + + accepted = "Accepted" + deleting = "Deleting" + running = "Running" + succeeded = "Succeeded" + failed = "Failed" diff --git a/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py new file mode 100644 index 00000000000..4f296d9d2ad --- /dev/null +++ b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models.py @@ -0,0 +1,440 @@ +# 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 Association(Model): + """The resource definition of this association. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The association id. + :vartype id: str + :ivar name: The association name. + :vartype name: str + :ivar type: The association type. + :vartype type: str + :param target_resource_id: The REST resource instance of the target + resource for this association. + :type target_resource_id: str + :ivar provisioning_state: The provisioning state of the association. + Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', + 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.customproviders.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'target_resource_id': {'key': 'properties.targetResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Association, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.target_resource_id = kwargs.get('target_resource_id', None) + self.provisioning_state = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomRPRouteDefinition(Model): + """A route definition that defines an action or resource that can be + interacted with through the custom resource provider. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the route definition. This becomes the + name for the ARM extension (e.g. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}') + :type name: str + :param endpoint: Required. The route definition endpoint URI that the + custom resource provider will proxy requests to. This can be in the form + of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a + path (e.g. 'https://testendpoint/{requestPath}') + :type endpoint: str + """ + + _validation = { + 'name': {'required': True}, + 'endpoint': {'required': True, 'pattern': r'^https://.+'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomRPRouteDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.endpoint = kwargs.get('endpoint', None) + + +class CustomRPActionRouteDefinition(CustomRPRouteDefinition): + """The route definition for an action implemented by the custom resource + provider. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the route definition. This becomes the + name for the ARM extension (e.g. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}') + :type name: str + :param endpoint: Required. The route definition endpoint URI that the + custom resource provider will proxy requests to. This can be in the form + of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a + path (e.g. 'https://testendpoint/{requestPath}') + :type endpoint: str + :param routing_type: The routing types that are supported for action + requests. Possible values include: 'Proxy' + :type routing_type: str or + ~azure.mgmt.customproviders.models.ActionRouting + """ + + _validation = { + 'name': {'required': True}, + 'endpoint': {'required': True, 'pattern': r'^https://.+'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'routing_type': {'key': 'routingType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomRPActionRouteDefinition, self).__init__(**kwargs) + self.routing_type = kwargs.get('routing_type', None) + + +class Resource(Model): + """The resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class CustomRPManifest(Resource): + """A manifest file that defines the custom resource provider resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param actions: A list of actions that the custom resource provider + implements. + :type actions: + list[~azure.mgmt.customproviders.models.CustomRPActionRouteDefinition] + :param resource_types: A list of resource types that the custom resource + provider implements. + :type resource_types: + list[~azure.mgmt.customproviders.models.CustomRPResourceTypeRouteDefinition] + :param validations: A list of validations to run on the custom resource + provider's requests. + :type validations: + list[~azure.mgmt.customproviders.models.CustomRPValidations] + :ivar provisioning_state: The provisioning state of the resource provider. + Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', + 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.customproviders.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'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}'}, + 'actions': {'key': 'properties.actions', 'type': '[CustomRPActionRouteDefinition]'}, + 'resource_types': {'key': 'properties.resourceTypes', 'type': '[CustomRPResourceTypeRouteDefinition]'}, + 'validations': {'key': 'properties.validations', 'type': '[CustomRPValidations]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomRPManifest, self).__init__(**kwargs) + self.actions = kwargs.get('actions', None) + self.resource_types = kwargs.get('resource_types', None) + self.validations = kwargs.get('validations', None) + self.provisioning_state = None + + +class CustomRPResourceTypeRouteDefinition(CustomRPRouteDefinition): + """The route definition for a resource implemented by the custom resource + provider. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the route definition. This becomes the + name for the ARM extension (e.g. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}') + :type name: str + :param endpoint: Required. The route definition endpoint URI that the + custom resource provider will proxy requests to. This can be in the form + of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a + path (e.g. 'https://testendpoint/{requestPath}') + :type endpoint: str + :param routing_type: The routing types that are supported for resource + requests. Possible values include: 'Proxy', 'Proxy,Cache' + :type routing_type: str or + ~azure.mgmt.customproviders.models.ResourceTypeRouting + """ + + _validation = { + 'name': {'required': True}, + 'endpoint': {'required': True, 'pattern': r'^https://.+'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'routing_type': {'key': 'routingType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomRPResourceTypeRouteDefinition, self).__init__(**kwargs) + self.routing_type = kwargs.get('routing_type', None) + + +class CustomRPValidations(Model): + """A validation to apply on custom resource provider requests. + + All required parameters must be populated in order to send to Azure. + + :param validation_type: The type of validation to run against a matching + request. Possible values include: 'Swagger' + :type validation_type: str or + ~azure.mgmt.customproviders.models.ValidationType + :param specification: Required. A link to the validation specification. + The specification must be hosted on raw.githubusercontent.com. + :type specification: str + """ + + _validation = { + 'specification': {'required': True, 'pattern': r'^https://raw.githubusercontent.com/.+'}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'specification': {'key': 'specification', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomRPValidations, self).__init__(**kwargs) + self.validation_type = kwargs.get('validation_type', None) + self.specification = kwargs.get('specification', None) + + +class ErrorDefinition(Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Service specific error code which serves as the substatus for + the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: list[~azure.mgmt.customproviders.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__(self, **kwargs): + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None + + +class ErrorResponse(Model): + """Error response. + + :param error: The error details. + :type error: ~azure.mgmt.customproviders.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ResourceProviderOperation(Model): + """Supported operations of this resource provider. + + :param name: Operation name, in format of + {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.customproviders.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class ResourceProviderOperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft Custom Providers. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ResourceProvidersUpdate(Model): + """custom resource provider update information. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ResourceProvidersUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models_py3.py b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models_py3.py new file mode 100644 index 00000000000..08049a74bcc --- /dev/null +++ b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_models_py3.py @@ -0,0 +1,440 @@ +# 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 Association(Model): + """The resource definition of this association. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The association id. + :vartype id: str + :ivar name: The association name. + :vartype name: str + :ivar type: The association type. + :vartype type: str + :param target_resource_id: The REST resource instance of the target + resource for this association. + :type target_resource_id: str + :ivar provisioning_state: The provisioning state of the association. + Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', + 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.customproviders.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'target_resource_id': {'key': 'properties.targetResourceId', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, target_resource_id: str=None, **kwargs) -> None: + super(Association, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.target_resource_id = target_resource_id + self.provisioning_state = None + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomRPRouteDefinition(Model): + """A route definition that defines an action or resource that can be + interacted with through the custom resource provider. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the route definition. This becomes the + name for the ARM extension (e.g. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}') + :type name: str + :param endpoint: Required. The route definition endpoint URI that the + custom resource provider will proxy requests to. This can be in the form + of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a + path (e.g. 'https://testendpoint/{requestPath}') + :type endpoint: str + """ + + _validation = { + 'name': {'required': True}, + 'endpoint': {'required': True, 'pattern': r'^https://.+'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + } + + def __init__(self, *, name: str, endpoint: str, **kwargs) -> None: + super(CustomRPRouteDefinition, self).__init__(**kwargs) + self.name = name + self.endpoint = endpoint + + +class CustomRPActionRouteDefinition(CustomRPRouteDefinition): + """The route definition for an action implemented by the custom resource + provider. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the route definition. This becomes the + name for the ARM extension (e.g. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}') + :type name: str + :param endpoint: Required. The route definition endpoint URI that the + custom resource provider will proxy requests to. This can be in the form + of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a + path (e.g. 'https://testendpoint/{requestPath}') + :type endpoint: str + :param routing_type: The routing types that are supported for action + requests. Possible values include: 'Proxy' + :type routing_type: str or + ~azure.mgmt.customproviders.models.ActionRouting + """ + + _validation = { + 'name': {'required': True}, + 'endpoint': {'required': True, 'pattern': r'^https://.+'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'routing_type': {'key': 'routingType', 'type': 'str'}, + } + + def __init__(self, *, name: str, endpoint: str, routing_type=None, **kwargs) -> None: + super(CustomRPActionRouteDefinition, self).__init__(name=name, endpoint=endpoint, **kwargs) + self.routing_type = routing_type + + +class Resource(Model): + """The resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class CustomRPManifest(Resource): + """A manifest file that defines the custom resource provider resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param actions: A list of actions that the custom resource provider + implements. + :type actions: + list[~azure.mgmt.customproviders.models.CustomRPActionRouteDefinition] + :param resource_types: A list of resource types that the custom resource + provider implements. + :type resource_types: + list[~azure.mgmt.customproviders.models.CustomRPResourceTypeRouteDefinition] + :param validations: A list of validations to run on the custom resource + provider's requests. + :type validations: + list[~azure.mgmt.customproviders.models.CustomRPValidations] + :ivar provisioning_state: The provisioning state of the resource provider. + Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', + 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.customproviders.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'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}'}, + 'actions': {'key': 'properties.actions', 'type': '[CustomRPActionRouteDefinition]'}, + 'resource_types': {'key': 'properties.resourceTypes', 'type': '[CustomRPResourceTypeRouteDefinition]'}, + 'validations': {'key': 'properties.validations', 'type': '[CustomRPValidations]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, actions=None, resource_types=None, validations=None, **kwargs) -> None: + super(CustomRPManifest, self).__init__(location=location, tags=tags, **kwargs) + self.actions = actions + self.resource_types = resource_types + self.validations = validations + self.provisioning_state = None + + +class CustomRPResourceTypeRouteDefinition(CustomRPRouteDefinition): + """The route definition for a resource implemented by the custom resource + provider. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of the route definition. This becomes the + name for the ARM extension (e.g. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}/{name}') + :type name: str + :param endpoint: Required. The route definition endpoint URI that the + custom resource provider will proxy requests to. This can be in the form + of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a + path (e.g. 'https://testendpoint/{requestPath}') + :type endpoint: str + :param routing_type: The routing types that are supported for resource + requests. Possible values include: 'Proxy', 'Proxy,Cache' + :type routing_type: str or + ~azure.mgmt.customproviders.models.ResourceTypeRouting + """ + + _validation = { + 'name': {'required': True}, + 'endpoint': {'required': True, 'pattern': r'^https://.+'}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'routing_type': {'key': 'routingType', 'type': 'str'}, + } + + def __init__(self, *, name: str, endpoint: str, routing_type=None, **kwargs) -> None: + super(CustomRPResourceTypeRouteDefinition, self).__init__(name=name, endpoint=endpoint, **kwargs) + self.routing_type = routing_type + + +class CustomRPValidations(Model): + """A validation to apply on custom resource provider requests. + + All required parameters must be populated in order to send to Azure. + + :param validation_type: The type of validation to run against a matching + request. Possible values include: 'Swagger' + :type validation_type: str or + ~azure.mgmt.customproviders.models.ValidationType + :param specification: Required. A link to the validation specification. + The specification must be hosted on raw.githubusercontent.com. + :type specification: str + """ + + _validation = { + 'specification': {'required': True, 'pattern': r'^https://raw.githubusercontent.com/.+'}, + } + + _attribute_map = { + 'validation_type': {'key': 'validationType', 'type': 'str'}, + 'specification': {'key': 'specification', 'type': 'str'}, + } + + def __init__(self, *, specification: str, validation_type=None, **kwargs) -> None: + super(CustomRPValidations, self).__init__(**kwargs) + self.validation_type = validation_type + self.specification = specification + + +class ErrorDefinition(Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Service specific error code which serves as the substatus for + the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: list[~azure.mgmt.customproviders.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None + + +class ErrorResponse(Model): + """Error response. + + :param error: The error details. + :type error: ~azure.mgmt.customproviders.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ResourceProviderOperation(Model): + """Supported operations of this resource provider. + + :param name: Operation name, in format of + {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.customproviders.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = name + self.display = display + + +class ResourceProviderOperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft Custom Providers. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ResourceProvidersUpdate(Model): + """custom resource provider update information. + + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ResourceProvidersUpdate, self).__init__(**kwargs) + self.tags = tags diff --git a/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_paged_models.py b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_paged_models.py new file mode 100644 index 00000000000..7928b4d67e2 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/models/_paged_models.py @@ -0,0 +1,53 @@ +# 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 ResourceProviderOperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceProviderOperation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceProviderOperation]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceProviderOperationPaged, self).__init__(*args, **kwargs) +class CustomRPManifestPaged(Paged): + """ + A paging container for iterating over a list of :class:`CustomRPManifest ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CustomRPManifest]'} + } + + def __init__(self, *args, **kwargs): + + super(CustomRPManifestPaged, self).__init__(*args, **kwargs) +class AssociationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Association ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Association]'} + } + + def __init__(self, *args, **kwargs): + + super(AssociationPaged, self).__init__(*args, **kwargs) diff --git a/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/operations/__init__.py b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/operations/__init__.py new file mode 100644 index 00000000000..fa463a41f90 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/operations/__init__.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._custom_resource_provider_operations import CustomResourceProviderOperations +from ._associations_operations import AssociationsOperations + +__all__ = [ + 'Operations', + 'CustomResourceProviderOperations', + 'AssociationsOperations', +] diff --git a/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/operations/_associations_operations.py b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/operations/_associations_operations.py new file mode 100644 index 00000000000..072810c650d --- /dev/null +++ b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/operations/_associations_operations.py @@ -0,0 +1,350 @@ +# 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 AssociationsOperations(object): + """AssociationsOperations 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: The API version to be used with the HTTP request. Constant value: "2018-09-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-09-01-preview" + + self.config = config + + + def _create_or_update_initial( + self, scope, association_name, target_resource_id=None, custom_headers=None, raw=False, **operation_config): + association = models.Association(target_resource_id=target_resource_id) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'associationName': self._serialize.url("association_name", 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(association, 'Association') + + # 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, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Association', response) + if response.status_code == 201: + deserialized = self._deserialize('Association', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, scope, association_name, target_resource_id=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update an association. + + :param scope: The scope of the association. The scope can be any valid + REST resource instance. For example, use + '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Compute/virtualMachines/{vm-name}' + for a virtual machine resource. + :type scope: str + :param association_name: The name of the association. + :type association_name: str + :param target_resource_id: The REST resource instance of the target + resource for this association. + :type target_resource_id: 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 Association or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.customproviders.models.Association] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.customproviders.models.Association]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + scope=scope, + association_name=association_name, + target_resource_id=target_resource_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Association', 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': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} + + + def _delete_initial( + self, scope, association_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'associationName': self._serialize.url("association_name", 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, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, scope, association_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete an association. + + :param scope: The scope of the association. + :type scope: str + :param association_name: The name of the association. + :type association_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:`ErrorResponseException` + """ + raw_result = self._delete_initial( + scope=scope, + association_name=association_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': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} + + def get( + self, scope, association_name, custom_headers=None, raw=False, **operation_config): + """Get an association. + + :param scope: The scope of the association. + :type scope: str + :param association_name: The name of the association. + :type 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: Association or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.customproviders.models.Association or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'associationName': self._serialize.url("association_name", 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Association', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations/{associationName}'} + + def list_all( + self, scope, custom_headers=None, raw=False, **operation_config): + """Gets all association for the given scope. + + :param scope: The scope of the association. + :type scope: 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: An iterator like instance of Association + :rtype: + ~azure.mgmt.customproviders.models.AssociationPaged[~azure.mgmt.customproviders.models.Association] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) + } + 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') + + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AssociationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_all.metadata = {'url': '/{scope}/providers/Microsoft.CustomProviders/associations'} diff --git a/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/operations/_custom_resource_provider_operations.py b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/operations/_custom_resource_provider_operations.py new file mode 100644 index 00000000000..5eeee033cc1 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/operations/_custom_resource_provider_operations.py @@ -0,0 +1,484 @@ +# 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 CustomResourceProviderOperations(object): + """CustomResourceProviderOperations 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: The API version to be used with the HTTP request. Constant value: "2018-09-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-09-01-preview" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, resource_provider_name, resource_provider, 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'), + 'resourceProviderName': self._serialize.url("resource_provider_name", resource_provider_name, 'str', max_length=64, min_length=3) + } + 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(resource_provider, 'CustomRPManifest') + + # 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, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CustomRPManifest', response) + if response.status_code == 201: + deserialized = self._deserialize('CustomRPManifest', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, resource_provider_name, resource_provider, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates the custom resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_provider_name: The name of the resource provider. + :type resource_provider_name: str + :param resource_provider: The parameters required to create or update + a custom resource provider definition. + :type resource_provider: + ~azure.mgmt.customproviders.models.CustomRPManifest + :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 CustomRPManifest or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.customproviders.models.CustomRPManifest] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.customproviders.models.CustomRPManifest]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_provider_name=resource_provider_name, + resource_provider=resource_provider, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('CustomRPManifest', 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.CustomProviders/resourceProviders/{resourceProviderName}'} + + + def _delete_initial( + self, resource_group_name, resource_provider_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'), + 'resourceProviderName': self._serialize.url("resource_provider_name", resource_provider_name, 'str', max_length=64, min_length=3) + } + 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, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, resource_provider_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the custom resource provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_provider_name: The name of the resource provider. + :type resource_provider_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:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_provider_name=resource_provider_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.CustomProviders/resourceProviders/{resourceProviderName}'} + + def get( + self, resource_group_name, resource_provider_name, custom_headers=None, raw=False, **operation_config): + """Gets the custom resource provider manifest. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_provider_name: The name of the resource provider. + :type resource_provider_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: CustomRPManifest or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.customproviders.models.CustomRPManifest or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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'), + 'resourceProviderName': self._serialize.url("resource_provider_name", resource_provider_name, 'str', max_length=64, min_length=3) + } + 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CustomRPManifest', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} + + def update( + self, resource_group_name, resource_provider_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates an existing custom resource provider. The only value that can + be updated via PATCH currently is the tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_provider_name: The name of the resource provider. + :type resource_provider_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: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CustomRPManifest or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.customproviders.models.CustomRPManifest or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + patchable_resource = models.ResourceProvidersUpdate(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'), + 'resourceProviderName': self._serialize.url("resource_provider_name", resource_provider_name, 'str', max_length=64, min_length=3) + } + 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(patchable_resource, 'ResourceProvidersUpdate') + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CustomRPManifest', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders/{resourceProviderName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all the custom resource providers within a resource group. + + :param resource_group_name: The name of the resource group. + :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: An iterator like instance of CustomRPManifest + :rtype: + ~azure.mgmt.customproviders.models.CustomRPManifestPaged[~azure.mgmt.customproviders.models.CustomRPManifest] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # 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') + } + 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') + + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.CustomRPManifestPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProviders'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the custom resource providers within a subscription. + + :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 CustomRPManifest + :rtype: + ~azure.mgmt.customproviders.models.CustomRPManifestPaged[~azure.mgmt.customproviders.models.CustomRPManifest] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # 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') + + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.CustomRPManifestPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CustomProviders/resourceProviders'} diff --git a/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/operations/_operations.py b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/operations/_operations.py new file mode 100644 index 00000000000..3e58a7db597 --- /dev/null +++ b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/operations/_operations.py @@ -0,0 +1,100 @@ +# 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 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: The API version to be used with the HTTP request. Constant value: "2018-09-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-09-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """The list of operations provided by Microsoft CustomProviders. + + :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 ResourceProviderOperation + :rtype: + ~azure.mgmt.customproviders.models.ResourceProviderOperationPaged[~azure.mgmt.customproviders.models.ResourceProviderOperation] + :raises: + :class:`ErrorResponseException` + """ + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ResourceProviderOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.CustomProviders/operations'} diff --git a/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/version.py b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/version.py new file mode 100644 index 00000000000..e0ec669828c --- /dev/null +++ b/src/custom-providers/azext_custom_providers/vendored_sdks/customproviders/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/custom-providers/setup.cfg b/src/custom-providers/setup.cfg new file mode 100644 index 00000000000..3c6e79cf31d --- /dev/null +++ b/src/custom-providers/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/src/custom-providers/setup.py b/src/custom-providers/setup.py new file mode 100644 index 00000000000..149ceed2817 --- /dev/null +++ b/src/custom-providers/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='custom-providers', + version=VERSION, + description='Microsoft Azure Command-Line Tools Custom Providers 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_custom_providers': ['azext_metadata.json']}, +) diff --git a/src/datashare/HISTORY.rst b/src/datashare/HISTORY.rst new file mode 100644 index 00000000000..27f152061e8 --- /dev/null +++ b/src/datashare/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/datashare/README.md b/src/datashare/README.md new file mode 100644 index 00000000000..9b8be0ab667 --- /dev/null +++ b/src/datashare/README.md @@ -0,0 +1,201 @@ +# Azure CLI datashare Extension # +This package is for the 'datashare' extension, i.e. 'az datashare'. More info on what is [Data Share](https://docs.microsoft.com/azure/data-share/). + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name datashare +``` + +Register DataShare Resource Provider for your default susbcription. +``` +az provider register -n "Microsoft.DataShare" +``` + +### Included Features +#### Datashare Account Management +*Examples:* + +##### Create a Datashare Account + +``` +az datashare account create \ +--location "West US 2" \ +--tags tag1=Red tag2=White \ +--name "cli_test_account" \ +--resource-group "datashare_provider_rg" +``` + +##### Wait for the Datashare Account to be provisioned +``` +az datashare account wait \ +--name "cli_test_account" \ +--resource-group "datashare_provider_rg" \ +--created +``` + +#### Datashare Resource Management for a Provider +*Examples:* + +##### Create a Datashare +``` +az datashare create \ +--account-name "cli_test_account" \ +--resource-group "datashare_provider_rg" \ +--description "share description" \ +--share-kind "CopyBased" \ +--terms "Confidential" \ +--name "cli_test_share" +``` + +##### Create a Data Set +``` +az datashare dataset create \ +--account-name "cli_test_account" \ +--name "cli_test_data_set" \ +--resource-group "datashare_provider_rg" \ +--share-name "cli_test_share" \ +--dataset "{\"container_name\":\"mycontainer\",\"storage_account_name\":\"mysa\",\"kind\":\"Container\"}" +``` + +Please make sure the datashare account has the right permission of the data source when creating a data set upon it. +For instance, you can use `az datashare account show` to get 'identity.principalId' of the account, then assign the right role to it. +``` +az role assignment create \ +--role "Storage Blob Data Reader" \ +--assignee-object-id {DatashareAccountPrincipalId} \ +--assignee-principal-type ServicePrincipal \ +--scope {StorageAccountId} +``` + +##### Create a Synchronization Setting +``` +az datashare synchronization-setting create \ +--account-name cli_test_account \ +--resource-group datashare_provider_rg \ +--share-name cli_test_share \ +--name cli_test_synchronization_setting \ +--recurrence-interval Day \ +--synchronization-time "2020-04-05 10:50:00 +00:00" \ +--kind ScheduleBased +``` + +##### List Synchronization History +``` +az datashare synchronization list \ +--account-name "cli_test_account" \ +--resource-group "datashare_provider_rg" \ +--share-name "cli_test_share" +``` + +##### Create a Datashare Invitation +``` +az datashare invitation create \ +--account-name "cli_test_account" \ +--target-email "myname@microsoft.com" \ +--name "cli_test_invitation" \ +--resource-group "datashare_provider_rg" \ +--share-name "cli_test_share" +``` + +##### List Share Subscriptions +``` +az datashare provider-share-subscription list \ +--account-name "cli_test_account" \ +--resource-group "datashare_provider_rg" \ +--share-name "cli_test_share" +``` +Share subscriptions are created by Datashare consumers when they accept invitations. + +##### Revoke Datashare for a Share Subscription +``` +az datashare provider-share-subscription revoke \ +--account-name "cli_test_account" \ +--share-subscription "{ProviderShareSubscriptionObjectId}" \ +--resource-group "datashare_provider_rg" \ +--share-name "cli_test_share" +``` + +##### Reinstate Datashare for a Share Subscription +``` +az datashare provider-share-subscription reinstate \ +--account-name "cli_test_account" \ +--share-subscription "{ProviderShareSubscriptionObjectId}" \ +--resource-group "datashare_provider_rg" \ +--share-name "cli_test_share" +``` + +#### Datashare Resource Management for a Consumer +*Examples:* + +##### List received Invitations +``` +az datashare consumer invitation list +``` + +##### Create a Share Subscription from an Invitation +``` +az datashare consumer share-subscription create \ +--account-name "cli_test_consumer_account" \ +--resource-group "datashare_consumer_rg" \ +--invitation-id "{InvitationId1}" \ +--source-share-location "sourceShareLocation" \ +--name "cli_test_share_subscription" +``` + +##### List Source Data Sets in the Share Subscription +``` +az datashare consumer share-subscription list-source-dataset \ +--account-name "cli_test_consumer_account" \ +--resource-group "datashare_consumer_rg" \ +--share-subscription-name "cli_test_share_subscription" +``` + +##### Create a Data Set Mapping of the Source Data Set +``` +az datashare consumer dataset-mapping create \ +--account-name "cli_test_consumer_account" \ +--name "cli_test_data_set_mapping" \ +--resource-group "datashare_consumer_rg" \ +--share-subscription-name "cli_test_share_subscription" \ +--mapping "{\"data_set_id\":\"2036a39f-add6-4347-9c82-a424dfaf4e8d\", \ +\"container_name\":\"newcontainer\", \"storage_account_name\":\"consumersa\", \ +\"kind\":\"BlobFolder\",\"prefix\":\"myprefix\"}" +``` +Please make sure the datashare consumer account has the right permission of the data target when creating a data set mapping on it. For instance, you can use `az datashare account show` to get 'identity.principalId' of the account, then assign the right role to it. +``` +az role assignment create \ +--role "Storage Blob Data Contributor" \ +--assignee-object-id "{ConsumerDatashareAccountPrincipalId}" \ +--assignee-principal-type ServicePrincipal \ +--scope "{ConsumerStorageAccountId}" +``` + +##### List the synchronization settings of the Source Datashare +``` +az datashare consumer share-subscription list-source-share-synchronization-setting \ +--account-name "cli_test_consumer_account" \ +--resource-group "datashare_consumer_rg" \ +--share-subscription-name "cli_test_share_subscription" +``` + +##### Create a trigger for the Share Subsciption +``` +az datashare consumer trigger create \ +--account-name "cli_test_consumer_account" \ +--resource-group "datashare_consumer_rg" \ +--share-subscription-name "cli_test_share_subscription" \ +--name "cli_test_trigger" \ +--recurrence-interval Day \ +--synchronization-time "2020-04-05 10:50:00 +00:00" \ +--kind ScheduleBased +``` + +##### Start a synchronization for the Share Subscription +``` +az datashare consumer share-subscription synchronization start \ +--account-name "cli_test_consumer_account" \ +--resource-group "datashare_consumer_rg" \ +--share-subscription-name "cli_test_share_subscription" \ +--synchronization-mode "Incremental" +``` diff --git a/src/datashare/azext_datashare/__init__.py b/src/datashare/azext_datashare/__init__.py new file mode 100644 index 00000000000..505737b668a --- /dev/null +++ b/src/datashare/azext_datashare/__init__.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=unused-argument +# pylint: disable=unused-import + +from azure.cli.core import AzCommandsLoader +from azext_datashare._help import helps + + +class DataShareManagementClientCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_datashare.generated._client_factory import cf_datashare + datashare_custom = CliCommandType( + operations_tmpl='azext_datashare.manual.custom#{}', # modified + client_factory=cf_datashare) + super(DataShareManagementClientCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=datashare_custom) + + def load_command_table(self, args): + try: + from azext_datashare.generated.commands import load_command_table + load_command_table(self, args) + except ImportError: + pass + try: + from azext_datashare.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError: + pass + return self.command_table + + def load_arguments(self, command): + try: + from azext_datashare.generated._params import load_arguments + load_arguments(self, command) + except ImportError: + pass + try: + from azext_datashare.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass + + +COMMAND_LOADER_CLS = DataShareManagementClientCommandsLoader diff --git a/src/datashare/azext_datashare/_help.py b/src/datashare/azext_datashare/_help.py new file mode 100644 index 00000000000..c0b36e140d8 --- /dev/null +++ b/src/datashare/azext_datashare/_help.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +# try: +# from .generated._help import * # noqa: F403 +# except ImportError: +# pass + +try: + from .manual._help import * # noqa: F403 +except ImportError: + pass diff --git a/src/datashare/azext_datashare/_params.py b/src/datashare/azext_datashare/_params.py new file mode 100644 index 00000000000..d1283049baf --- /dev/null +++ b/src/datashare/azext_datashare/_params.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +try: + from .generated._params import * # noqa: F403 +except ImportError: + pass + +try: + from .manual._params import * # noqa: F403 +except ImportError: + pass diff --git a/src/datashare/azext_datashare/action.py b/src/datashare/azext_datashare/action.py new file mode 100644 index 00000000000..4ad472a8c52 --- /dev/null +++ b/src/datashare/azext_datashare/action.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +try: + from .generated.action import * # noqa: F403 +except ImportError: + pass + +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/datashare/azext_datashare/azext_metadata.json b/src/datashare/azext_datashare/azext_metadata.json new file mode 100644 index 00000000000..7b56fb1e11a --- /dev/null +++ b/src/datashare/azext_datashare/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1" +} \ No newline at end of file diff --git a/src/datashare/azext_datashare/generated/__init__.py b/src/datashare/azext_datashare/generated/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/datashare/azext_datashare/generated/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/datashare/azext_datashare/generated/_client_factory.py b/src/datashare/azext_datashare/generated/_client_factory.py new file mode 100644 index 00000000000..bba6d6bcfb5 --- /dev/null +++ b/src/datashare/azext_datashare/generated/_client_factory.py @@ -0,0 +1,54 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def cf_datashare(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from ..vendored_sdks.datashare import DataShareManagementClient + return get_mgmt_service_client(cli_ctx, DataShareManagementClient) + + +def cf_account(cli_ctx, *_): + return cf_datashare(cli_ctx).account + + +def cf_consumer_invitation(cli_ctx, *_): + return cf_datashare(cli_ctx).consumer_invitation + + +def cf_data_set(cli_ctx, *_): + return cf_datashare(cli_ctx).data_set + + +def cf_data_set_mapping(cli_ctx, *_): + return cf_datashare(cli_ctx).data_set_mapping + + +def cf_invitation(cli_ctx, *_): + return cf_datashare(cli_ctx).invitation + + +def cf_share(cli_ctx, *_): + return cf_datashare(cli_ctx).share + + +def cf_provider_share_subscription(cli_ctx, *_): + return cf_datashare(cli_ctx).provider_share_subscription + + +def cf_share_subscription(cli_ctx, *_): + return cf_datashare(cli_ctx).share_subscription + + +def cf_consumer_source_data_set(cli_ctx, *_): + return cf_datashare(cli_ctx).consumer_source_data_set + + +def cf_synchronization_setting(cli_ctx, *_): + return cf_datashare(cli_ctx).synchronization_setting + + +def cf_trigger(cli_ctx, *_): + return cf_datashare(cli_ctx).trigger diff --git a/src/datashare/azext_datashare/manual/__init__.py b/src/datashare/azext_datashare/manual/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/datashare/azext_datashare/manual/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/datashare/azext_datashare/manual/_help.py b/src/datashare/azext_datashare/manual/_help.py new file mode 100644 index 00000000000..e9d2ba56a72 --- /dev/null +++ b/src/datashare/azext_datashare/manual/_help.py @@ -0,0 +1,613 @@ +# -------------------------------------------------------------------------------------------- +# 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 + +from knack.help_files import helps + + +helps['datashare consumer'] = """ + type: group + short-summary: Commands for consumers to manage datashare +""" + +helps['datashare account'] = """ + type: group + short-summary: Commands to manage datashare accounts +""" + +helps['datashare account list'] = """ + type: command + short-summary: List datashare accounts + examples: + - name: List accounts by resource group + text: |- + az datashare account list --resource-group MyResourceGroup +""" + +helps['datashare account show'] = """ + type: command + short-summary: Show an account + examples: + - name: Show account information + text: |- + az datashare account show --name MyAccount --resource-group MyResourceGroup +""" + +helps['datashare account create'] = """ + type: command + short-summary: Create an account + examples: + - name: Create an account + text: |- + az datashare account create --location "West US 2" --tags tag1=Red tag2=White --name MyAccount --resource-group MyResourceGroup +""" + +helps['datashare account update'] = """ + type: command + short-summary: Patch an account + examples: + - name: Update account tags + text: |- + az datashare account update --name MyAccount --tags tag1=Red tag2=White --resource-group MyResourceGroup +""" + +helps['datashare account delete'] = """ + type: command + short-summary: Delete an account + examples: + - name: Delete the account + text: |- + az datashare account delete --name MyAccount --resource-group MyResourceGroup +""" + +helps['datashare account wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the datashare account is met. + examples: + - name: Pause executing next line of CLI script until the datashare account is successfully provisioned. + text: az datashare account wait --name MyAccount --resource-group MyResourceGroup --created +""" + +helps['datashare consumer invitation'] = """ + type: group + short-summary: Commands for consumers to manage datashare invitations +""" + +helps['datashare consumer invitation list'] = """ + type: command + short-summary: List received invitations + examples: + - name: List invitations + text: |- + az datashare consumer invitation list +""" + +helps['datashare consumer invitation show'] = """ + type: command + short-summary: Show a received invitation + examples: + - name: Show an invitation + text: |- + az datashare consumer invitation show --invitation-id 00000000-0000-0000-0000-000000000000 --location "East US 2" +""" + +helps['datashare consumer invitation reject'] = """ + type: command + short-summary: Reject an invitation + examples: + - name: Reject an invitation + text: |- + az datashare consumer invitation reject --invitation-id 00000000-0000-0000-0000-000000000000 --location "East US 2" +""" + +helps['datashare dataset'] = """ + type: group + short-summary: Commands for providers to manage datashare datasets +""" + +helps['datashare dataset list'] = """ + type: command + short-summary: List datasets in a share + examples: + - name: List datasets + text: |- + az datashare dataset list --account-name MyAccount --resource-group MyResourceGroup --share-name MyShare +""" + +helps['datashare dataset show'] = """ + type: command + short-summary: Show a dataset + examples: + - name: Show a dataset + text: |- + az datashare dataset show --account-name MyAccount --name MyDataset --resource-group MyResourceGroup --share-name MyShare +""" + +helps['datashare dataset create'] = """ + type: command + short-summary: Create a dataset + examples: + - name: Create a Blob dataset + text: |- + az datashare dataset create --account-name MyAccount --name MyDataset --resource-group MyResourceGroup --share-name MyShare \ +--dataset "{\\"kind\\":\\"Blob\\",\\"properties\\":{\\"containerName\\":\\"C1\\",\\"filePath\\":\\"file21\\",\\"resourceGroup\\": \ +\\"SampleResourceGroup\\",\\"storageAccountName\\":\\"storage2\\",\\"subscriptionId\\":\\"00000000-0000-0000-0000-000000000000\\"}}" + - name: Create a KustoCluster dataset + text: |- + az datashare dataset create --account-name MyAccount --name MyDataset --resource-group MyResourceGroup --share-name MyShare \ +--dataset "{\\"kind\\":\\"KustoCluster\\",\\"properties\\":{\\"kustoClusterResourceId\\": \ +\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SampleResourceGroup/providers/Microsoft.Kusto/clusters/Cluster1\\"}}" + - name: Create a KustoDatabase dataset + text: |- + az datashare dataset create --account-name MyAccount --name MyDataset --resource-group MyResourceGroup --share-name MyShare \ +--dataset "{\\"kind\\":\\"KustoDatabase\\",\\"properties\\":{\\"kustoDatabaseResourceId\\": \ +\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SampleResourceGroup/providers/Microsoft.Kusto/clusters/Cluster1/databases/Database1\\"}}" + - name: Create a SqlDBTable dataset + text: |- + az datashare dataset create --account-name MyAccount --name MyDataset --resource-group MyResourceGroup --share-name MyShare \ +--dataset "{\\"kind\\":\\"SqlDBTable\\",\\"properties\\":{\\"databaseName\\":\\"MySqlDB\\",\\"schemaName\\":\\"dbo\\", \ +\\"sqlServerResourceId\\":\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SampleResourceGroup/providers/Microsoft.Sql/servers/Server1\\", \ +\\"tableName\\":\\"Table1\\"}}" + - name: Create a SqlDWTable dataset + text: |- + az datashare dataset create --account-name MyAccount --name MyDataset --resource-group MyResourceGroup --share-name MyShare \ +--dataset "{\\"kind\\":\\"SqlDWTable\\",\\"properties\\":{\\"dataWarehouseName\\":\\"MyDataWarehouse\\",\\"schemaName\\":\\"dbo\\", \ +\\"sqlServerResourceId\\":\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.Sql/servers/MyServer\ +\\",\\"tableName\\":\\"MyTable\\"}}" +""" + +helps['datashare dataset delete'] = """ + type: command + short-summary: Delete a dataset in a share + examples: + - name: Delete a dataset + text: |- + az datashare dataset delete --account-name MyAccount --name MyDataset --resource-group MyResourceGroup --share-name MyShare +""" + +helps['datashare dataset wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the datashare dataset is met. + examples: + - name: Pause executing next line of CLI script until the datashare dataset is successfully provisioned. + text: az datashare dataset wait --account-name MyAccount --share-name MyShare --name MyDataset --resource-group MyResourceGroup --created +""" + +helps['datashare consumer dataset-mapping'] = """ + type: group + short-summary: Commands for consumers to manage datashare dataset mappings +""" + +helps['datashare consumer dataset-mapping list'] = """ + type: command + short-summary: List dataset mappings in a share subscription + examples: + - name: List dataset mappings + text: |- + az datashare consumer dataset-mapping list --account-name MyAccount --resource-group MyResourceGroup --share-subscription-name MyShareSubscription +""" + +helps['datashare consumer dataset-mapping show'] = """ + type: command + short-summary: Show a dataset mapping in a share subscription + examples: + - name: Show a dataset mapping + text: |- + az datashare consumer dataset-mapping show --account-name MyAccount --name MyDatasetMapping --resource-group MyResourceGroup --share-subscription-name MyShareSubscription +""" + +helps['datashare consumer dataset-mapping create'] = """ + type: command + short-summary: Create a dataSet mapping + examples: + - name: Create a Blob dataset mapping + text: |- + az datashare consumer dataset-mapping create --account-name MyAccount --name MyDatasetMapping --resource-group MyResourceGroup --share-subscription-name MyShareSubscription \ +--mapping "{\\"kind\\":\\"Blob\\",\\"properties\\":{\\"containerName\\":\\"C1\\",\\"dataSetId\\":\\"00000000-0000-0000-0000-000000000000\\",\\"filePath\ +\\":\\"file21\\",\\"resourceGroup\\":\\"SampleResourceGroup\\",\\"storageAccountName\\":\\"storage2\\",\\"subscriptionId\\":\\"00000000-0000-0000-0000-000000000000\\"}}" + - name: Create a SqlDBTable dataset mapping + text: |- + az datashare consumer dataset-mapping create --account-name MyAccount --name MyDatasetMapping --resource-group MyResourceGroup --share-subscription-name MyShareSubscription \ +--mapping "{\\"kind\\":\\"SqlDBTable\\",\\"properties\\":{\\"dataSetId\\":\\"00000000-0000-0000-0000-000000000000\\",\\"databaseName\\":\\"Database1\\"\ +,\\"schemaName\\":\\"dbo\\",\\"sqlServerResourceId\\":\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SampleResourceGroup/providers/Microsoft.Sql/servers/Server1\\",\\"tableName\\":\\"Table1\\"}}" + - name: Create a AdlsGen2File dataset mapping + text: |- + az datashare consumer dataset-mapping create --account-name MyAccount --name MyDatasetMapping --resource-group MyResourceGroup --share-subscription-name MyShareSubscription \ +--mapping "{\\"kind\\":\\"AdlsGen2File\\",\\"properties\\":{\\"dataSetId\\":\\"00000000-0000-0000-0000-000000000000\\",\\"filePath\\":\\"file21\\",\\"fileSystem\\": \ +\\"fileSystem\\",\\"outputType\\":\\"Csv\\",\\"resourceGroup\\":\\"SampleResourceGroup\\",\\"storageAccountName\\":\\"storage2\\",\\"subscriptionId\\":\\"00000000-0000-0000-0000-000000000000\\"}}" + - name: Create a SqlDWTable dataset mapping + text: |- + az datashare consumer dataset-mapping create --account-name MyAccount --name MyDatasetMapping --resource-group MyResourceGroup --share-subscription-name MyShareSubscription \ +--mapping "{\\"kind\\":\\"SqlDWTable\\",\\"properties\\":{\\"dataSetId\\":\\"00000000-0000-0000-0000-000000000000\\",\\"dataWarehouseName\\":\\"DataWarehouse1\\",\ +\\"schemaName\\":\\"dbo\\",\\"sqlServerResourceId\\":\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SampleResourceGroup/providers/Microsoft.Sql/servers/Server1\\",\\"tableName\\":\\"Table1\\"}}" +""" + +helps['datashare consumer dataset-mapping delete'] = """ + type: command + short-summary: Delete a dataset mapping in a share subscription + examples: + - name: Delete a dataset mapping + text: |- + az datashare consumer dataset-mapping delete --account-name MyAccount --name MyDatasetMapping --resource-group MyResourceGroup --share-subscription-name MyShareSubscription +""" + +helps['datashare invitation'] = """ + type: group + short-summary: Commands for providers to manage datashare invitations +""" + +helps['datashare invitation list'] = """ + type: command + short-summary: List invitations in a share + examples: + - name: List invitations + text: |- + az datashare invitation list --account-name MyAccount --resource-group MyResourceGroup --share-name MyShare +""" + +helps['datashare invitation show'] = """ + type: command + short-summary: Show an invitation in a share + examples: + - name: Show an invitation + text: |- + az datashare invitation show --account-name MyAccount --name MyInvitation --resource-group MyResourceGroup --share-name MyShare +""" + +helps['datashare invitation create'] = """ + type: command + short-summary: Create an invitation + examples: + - name: Create an invitation + text: |- + az datashare invitation create --account-name MyAccount --target-email "receiver@microsoft.com" --name MyInvitation --resource-group MyResourceGroup --share-name MyShare +""" + +helps['datashare invitation delete'] = """ + type: command + short-summary: Delete an invitation in a share + examples: + - name: Delete an invitation + text: |- + az datashare invitation delete --account-name MyAccount --name MyInvitation --resource-group MyResourceGroup --share-name MyShare +""" + +helps['datashare'] = """ + type: group + short-summary: Commands to manage datashare +""" + +helps['datashare list'] = """ + type: command + short-summary: List datashares in an account + examples: + - name: List datashares + text: |- + az datashare list --account-name MyAccount --resource-group MyResourceGroup +""" + +helps['datashare show'] = """ + type: command + short-summary: Show a datashare + examples: + - name: Show a datashare + text: |- + az datashare show --account-name MyAccount --resource-group MyResourceGroup --name MyShare +""" + +helps['datashare create'] = """ + type: command + short-summary: Create a datashare + examples: + - name: Create a datashare + text: |- + az datashare create --account-name MyAccount --resource-group MyResourceGroup --description "share description" --share-kind "CopyBased" --terms "Confidential" --name MyShare +""" + +helps['datashare delete'] = """ + type: command + short-summary: Delete a datashare + examples: + - name: Delete a datashare + text: |- + az datashare delete --account-name MyAccount --resource-group MyResourceGroup --name MyShare +""" + +helps['datashare synchronization'] = """ + type: group + short-summary: Commands to manage datashare synchronization +""" + +helps['datashare synchronization list-detail'] = """ + type: command + short-summary: List synchronization details + examples: + - name: List synchronization details + text: |- + az datashare synchronization list-detail --account-name MyAccount --resource-group MyResourceGroup --share-name MyShare --synchronization-id 00000000-0000-0000-0000-000000000000 +""" + +helps['datashare synchronization list'] = """ + type: command + short-summary: List synchronizations of a datashare + examples: + - name: List synchronizations + text: |- + az datashare synchronization list --account-name MyAccount --resource-group MyResourceGroup --share-name MyShare +""" + +helps['datashare wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the datashare is met. + examples: + - name: Pause executing next line of CLI script until the datashare is successfully provisioned. + text: az datashare wait --account-name MyAccount --resource-group MyResourceGroup --name MyShare --created +""" + +helps['datashare provider-share-subscription'] = """ + type: group + short-summary: Commands for providers to manage datashare share subscriptions +""" + +helps['datashare provider-share-subscription list'] = """ + type: command + short-summary: List share subscriptions in a provider share + examples: + - name: List share subscriptions + text: |- + az datashare provider-share-subscription list --account-name MyAccount --resource-group MyResourceGroup --share-name MyShare +""" + +helps['datashare provider-share-subscription show'] = """ + type: command + short-summary: Show a share subscription in a provider share + examples: + - name: Show a share subscription + text: |- + az datashare provider-share-subscription show --account-name MyAccount --share-subscription 00000000-0000-0000-0000-000000000000 --resource-group MyResourceGroup --share-name MyShare +""" + +helps['datashare provider-share-subscription revoke'] = """ + type: command + short-summary: Revoke a share subscription in a provider share + examples: + - name: Revoke a share subscription + text: |- + az datashare provider-share-subscription revoke --account-name MyAccount --share-subscription 00000000-0000-0000-0000-000000000000 --resource-group MyResourceGroup --share-name MyShare +""" + +helps['datashare provider-share-subscription reinstate'] = """ + type: command + short-summary: Reinstate a share subscription in a provider share + examples: + - name: Reinstate a share subscription + text: |- + az datashare provider-share-subscription reinstate --account-name MyAccount --share-subscription 00000000-0000-0000-0000-000000000000 --resource-group MyResourceGroup --share-name MyShare +""" + +helps['datashare provider-share-subscription wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the datashare provider share subscription is met. + examples: + - name: Pause executing next line of CLI script until the datashare provider share subscription is successfully provisioned. + text: az datashare provider-share-subscription wait --account-name MyAccount --share-subscription 00000000-0000-0000-0000-000000000000 --resource-group MyResourceGroup --share-name MyShare --created +""" + +helps['datashare consumer share-subscription'] = """ + type: group + short-summary: Commands for consumers to manage datashare share subscriptions +""" + +helps['datashare consumer share-subscription list'] = """ + type: command + short-summary: List share subscriptions in an account + examples: + - name: List share subscriptions + text: |- + az datashare consumer share-subscription list --account-name MyAccount --resource-group MyResourceGroup +""" + +helps['datashare consumer share-subscription show'] = """ + type: command + short-summary: Show a share subscription in an account + examples: + - name: Show a share subscription + text: |- + az datashare consumer share-subscription show --account-name MyAccount --resource-group MyResourceGroup --name MyShareSubscription +""" + +helps['datashare consumer share-subscription create'] = """ + type: command + short-summary: Create a share subscription in an account + examples: + - name: Create a share subscription + text: |- + az datashare consumer share-subscription create --account-name MyAccount --resource-group MyResourceGroup --invitation-id 00000000-0000-0000-0000-000000000000 --source-share-location "eastus2" --name MyShareSubscription +""" + +helps['datashare consumer share-subscription delete'] = """ + type: command + short-summary: Delete a share subscription in an account + examples: + - name: Delete a share subscription + text: |- + az datashare consumer share-subscription delete --account-name MyAccount --resource-group MyResourceGroup --name MyShareSubscription +""" + +helps['datashare consumer share-subscription synchronization'] = """ + type: group + short-summary: Commands for consumers to manage datashare share subscription synchronizations +""" + +helps['datashare consumer share-subscription synchronization list-detail'] = """ + type: command + short-summary: List synchronization details + examples: + - name: List synchronization details + text: |- + az datashare consumer share-subscription synchronization list-detail --account-name MyAccount --resource-group MyResourceGroup --share-subscription-name MyShareSub --synchronization-id 00000000-0000-0000-0000-000000000000 +""" + +helps['datashare consumer share-subscription synchronization start'] = """ + type: command + short-summary: Initiate a dataset synchronization + examples: + - name: Initiate a dataset synchronization + text: |- + az datashare consumer share-subscription synchronization start --account-name MyAccount --resource-group MyResourceGroup --share-subscription-name MyShareSubscription --synchronization-mode "Incremental" +""" + +helps['datashare consumer share-subscription synchronization cancel'] = """ + type: command + short-summary: Request to cancel a synchronization. + examples: + - name: Request to cancel a synchronization + text: |- + az datashare consumer share-subscription synchronization cancel --account-name MyAccount --resource-group MyResourceGroup --share-subscription-name MyShareSubscription --synchronization-id 00000000-0000-0000-0000-000000000000 +""" + +helps['datashare consumer share-subscription synchronization wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the datashare share subscription synchronization is met. + examples: + - name: Pause executing next line of CLI script until the datashare share subscription synchronization finishes successfully. + text: az datashare consumer share-subscription synchronization wait --custom "status=='Succeeded'" --account-name MyAccount --resource-group MyResourceGroup --share-subscription-name MyShareSubscription --synchronization-id 00000000-0000-0000-0000-000000000000 + - name: Pause executing next line of CLI script until the datashare share subscription synchronization is cancelled. + text: az datashare consumer share-subscription synchronization wait --custom "status=='Cancelled'" --account-name MyAccount --resource-group MyResourceGroup --share-subscription-name MyShareSubscription --synchronization-id 00000000-0000-0000-0000-000000000000 +""" + +helps['datashare consumer share-subscription list-source-share-synchronization-setting'] = """ + type: command + short-summary: List synchronization settings set on a share + examples: + - name: List synchronization settings + text: |- + az datashare consumer share-subscription list-source-share-synchronization-setting --account-name MyAccount --resource-group MyResourceGroup --share-subscription-name MyShareSub +""" + +helps['datashare consumer share-subscription synchronization list'] = """ + type: command + short-summary: List synchronizations of a share subscription + examples: + - name: List synchronizations + text: |- + az datashare consumer share-subscription synchronization list --account-name MyAccount --resource-group MyResourceGroup --share-subscription-name MyShareSub +""" + +helps['datashare consumer share-subscription wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the datashare share subscription is met. + examples: + - name: Pause executing next line of CLI script until the datashare share subscription is successfully provisioned. + text: az datashare consumer share-subscription wait --account-name MyAccount --resource-group MyResourceGroup --name MyShareSubscription --created +""" + +helps['datashare consumer share-subscription list-source-dataset'] = """ + type: command + short-summary: List source datasets of a share subscription + examples: + - name: List source datasets + text: |- + az datashare consumer share-subscription list-source-dataset --account-name MyAccount --resource-group MyResourceGroup --share-subscription-name MyShare +""" + +helps['datashare synchronization-setting'] = """ + type: group + short-summary: Commands for providers to manage datashare synchronization settings +""" + +helps['datashare synchronization-setting list'] = """ + type: command + short-summary: List synchronization settings in a share + examples: + - name: List synchronization settings + text: |- + az datashare synchronization-setting list --account-name MyAccount --resource-group MyResourceGroup --share-name MyShare +""" + +helps['datashare synchronization-setting show'] = """ + type: command + short-summary: Show a synchronization setting in a share + examples: + - name: Show a synchronization setting + text: |- + az datashare synchronization-setting show --account-name MyAccount --resource-group MyResourceGroup --share-name MyShare --name MySyncrhonizationSetting +""" + +helps['datashare synchronization-setting create'] = """ + type: command + short-summary: Create a synchronization setting + examples: + - name: Create a synchronization setting + text: |- + az datashare synchronization-setting create --account-name MyAccount --resource-group MyResourceGroup --share-name MyShare --name MyDataset --recurrence-interval Day --synchronization-time "2020-04-05 10:50:00 +00:00" --kind ScheduleBased +""" + +helps['datashare synchronization-setting delete'] = """ + type: command + short-summary: Delete a synchronization setting in a share + examples: + - name: Delete a synchronization setting + text: |- + az datashare synchronization-setting delete --account-name MyAccount --resource-group MyResourceGroup --share-name MyShare --name MySyncrhonizationSetting +""" + +helps['datashare synchronization-setting wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the datashare synchronization setting is met. + examples: + - name: Pause executing next line of CLI script until the datashare synchronization setting is successfully provisioned. + text: az datashare synchronization-setting wait --account-name MyAccount --resource-group MyResourceGroup --share-name MyShare --name MySyncrhonizationSetting --created +""" + +helps['datashare consumer trigger'] = """ + type: group + short-summary: Commands for consumers to manage datashare consumer triggers +""" + +helps['datashare consumer trigger list'] = """ + type: command + short-summary: List triggers in a share subscription + examples: + - name: List triggers + text: |- + az datashare consumer trigger list --account-name MyAccount --resource-group MyResourceGroup --share-subscription-name MyShareSubscription +""" + +helps['datashare consumer trigger show'] = """ + type: command + short-summary: Show a trigger in a share subscription + examples: + - name: Show a trigger + text: |- + az datashare consumer trigger show --account-name MyAccount --resource-group MyResourceGroup --share-subscription-name MyShareSubscription --name MyTrigger +""" + +helps['datashare consumer trigger create'] = """ + type: command + short-summary: Create a trigger + examples: + - name: Create a trigger + text: |- + az datashare consumer trigger create --account-name MyAccount --resource-group MyResourceGroup --share-subscription-name MyShareSubscription --name MyTrigger --recurrence-interval Day --synchronization-time "2020-04-05 10:50:00 +00:00" --kind ScheduleBased +""" + +helps['datashare consumer trigger delete'] = """ + type: command + short-summary: Delete a trigger in a share subscription + examples: + - name: Delete a trigger + text: |- + az datashare consumer trigger delete --account-name MyAccount --resource-group MyResourceGroup --share-subscription-name MyShareSubscription --name MyTrigger +""" + +helps['datashare consumer trigger wait'] = """ + type: command + short-summary: Place the CLI in a waiting state until a condition of the datashare trigger is met. + examples: + - name: Pause executing next line of CLI script until the datashare trigger is successfully provisioned. + text: az datashare consumer trigger wait --account-name MyAccount --resource-group MyResourceGroup --share-subscription-name MyShareSubscription --name MyTrigger --created +""" diff --git a/src/datashare/azext_datashare/manual/_params.py b/src/datashare/azext_datashare/manual/_params.py new file mode 100644 index 00000000000..f7dbfbae2ac --- /dev/null +++ b/src/datashare/azext_datashare/manual/_params.py @@ -0,0 +1,333 @@ +# -------------------------------------------------------------------------------------------- +# 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=unused-import + +from knack.arguments import CLIArgumentType +from azure.cli.core.commands.parameters import ( + tags_type, + get_enum_type, + resource_group_name_type, + get_location_type, + get_datetime_type +) +from azure.cli.core.commands.validators import get_default_location_from_resource_group, validate_file_or_dict +from azext_datashare.vendored_sdks.datashare.models._data_share_management_client_enums import ShareKind, Kind, SynchronizationMode, SynchronizationKind, RecurrenceInterval +from azext_datashare.manual._validators import invitation_id_validator + + +def load_arguments(self, _): + + with self.argument_context('datashare account list') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + + with self.argument_context('datashare account show') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', options_list=['--name', '-n'], id_part='name', help='The name of the share account.') # modified + + with self.argument_context('datashare account create') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', options_list=['--name', '-n'], help='The name of the share account.') # modified + c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) # modified + c.argument('tags', tags_type) # modified + c.ignore('identity') # Only system assigned identity is supported, we can omit this option + + with self.argument_context('datashare account update') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', options_list=['--name', '-n'], id_part='name', help='The name of the share account.') # modified + c.argument('tags', tags_type) # modified + + with self.argument_context('datashare account delete') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', options_list=['--name', '-n'], id_part='name', help='The name of the share account.') + + with self.argument_context('datashare account wait') as c: + c.argument('account_name', options_list=['--name', '-n'], id_part='name', help='The name of the share account.') # modified + + with self.argument_context('datashare list') as c: # modified + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + + with self.argument_context('datashare show') as c: # modified + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_name', options_list=['--name', '-n'], id_part='child_name_1', help='The name of the share.') # modified + + with self.argument_context('datashare create') as c: # modified + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', options_list=['--name', '-n'], help='The name of the share.') # modified + c.argument('description', help='Share description.') # modified + c.argument('share_kind', arg_type=get_enum_type(ShareKind), help='Share kind.') # modified + c.argument('terms', help='Share terms.') # modified + + with self.argument_context('datashare delete') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_name', options_list=['--name', '-n'], id_part='child_name_1', help='The name of the share.') # modified + + with self.argument_context('datashare wait') as c: + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_name', options_list=['--name', '-n'], id_part='child_name_1', help='The name of the share.') # modified + + with self.argument_context('datashare dataset list') as c: # modified + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', help='The name of the share.') + + with self.argument_context('datashare dataset show') as c: # modified + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified + c.argument('data_set_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the dataset.') # modified + + with self.argument_context('datashare dataset create') as c: # modified + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', help='The name of the share.') + c.argument('data_set_name', options_list=['--name', '-n'], help='The name of the dataset.') # modified + c.argument('data_set', options_list=['--dataset'], type=validate_file_or_dict, help='Dataset parameters in JSON string or path to JSON file.') # modified + + with self.argument_context('datashare dataset delete') as c: # modified + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified + c.argument('data_set_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the dataset.') # modified + + with self.argument_context('datashare dataset wait') as c: + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified + c.argument('data_set_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the dataset.') # modified + + with self.argument_context('datashare invitation list') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', help='The name of the share.') + + with self.argument_context('datashare invitation show') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified + c.argument('invitation_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the invitation.') # modified + + with self.argument_context('datashare invitation create') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', help='The name of the share.') + c.argument('invitation_name', options_list=['--name', '-n'], help='The name of the invitation.') # modified + c.argument('target_active_directory_id', help='The target Azure AD Id. Can\'t be combined with email.') # modified + c.argument('target_email', help='The email the invitation is directed to.') # modified + c.argument('target_object_id', help='The target user or application Id that invitation is being sent to. Must be specified along TargetActiveDirectoryId. This enables sending invitations to specific users or applications in an AD tenant.') # modified + + with self.argument_context('datashare invitation delete') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified + c.argument('invitation_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the invitation.') # modified + + with self.argument_context('datashare synchronization-setting list') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', help='The name of the share.') + + with self.argument_context('datashare synchronization-setting show') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified + c.argument('synchronization_setting_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the synchronizationSetting.') # modified + + with self.argument_context('datashare synchronization-setting create') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', help='The name of the share.') + c.argument('synchronization_setting_name', options_list=['--name', '-n'], help='The name of the synchronizationSetting.') # modified + c.argument('recurrence_interval', arg_type=get_enum_type(RecurrenceInterval), arg_group='Synchronization Setting', help='Synchronization Recurrence Interval.') + c.argument('synchronization_time', arg_group='Synchronization Setting', arg_type=get_datetime_type(help='Synchronization time.')) + c.argument('kind', arg_type=get_enum_type(SynchronizationKind), arg_group='Synchronization Setting', default='ScheduleBased', help='Kind of synchronization.') + + with self.argument_context('datashare synchronization-setting delete') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified + c.argument('synchronization_setting_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the synchronizationSetting.') # modified + + with self.argument_context('datashare synchronization-setting wait') as c: + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified + c.argument('synchronization_setting_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the synchronizationSetting.') # modified + + with self.argument_context('datashare synchronization list-detail') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') # modified + c.argument('share_name', help='The name of the share.') # modified + c.argument('synchronization_id', help='The synchronization GUID.') + + with self.argument_context('datashare synchronization list') as c: # modified + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') # modified + c.argument('share_name', help='The name of the share.') # modified + + with self.argument_context('datashare provider-share-subscription list') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_name', help='The name of the share.') + + with self.argument_context('datashare provider-share-subscription show') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified + c.argument('provider_share_subscription_id', options_list=['--share-subscription'], id_part='child_name_2', help='To locate share subscription') # modified TODO validator + + with self.argument_context('datashare provider-share-subscription revoke') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified + c.argument('provider_share_subscription_id', options_list=['--share-subscription'], id_part='child_name_2', help='To locate share subscription') # modified + + with self.argument_context('datashare provider-share-subscription reinstate') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified + c.argument('provider_share_subscription_id', options_list=['--share-subscription'], id_part='child_name_2', help='To locate share subscription') # modified + + with self.argument_context('datashare provider-share-subscription wait') as c: + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_name', id_part='child_name_1', help='The name of the share.') # modified + c.argument('provider_share_subscription_id', options_list=['--share-subscription'], id_part='child_name_2', help='To locate share subscription') # modified + + with self.argument_context('datashare consumer invitation list') as c: + pass + + with self.argument_context('datashare consumer invitation show') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx)) # modified + c.argument('invitation_id', validator=invitation_id_validator, help='An invitation id') + + with self.argument_context('datashare consumer invitation reject') as c: + c.argument('location', arg_type=get_location_type(self.cli_ctx)) # modified + c.argument('invitation_id', validator=invitation_id_validator, help='An invitation id') # modified + + with self.argument_context('datashare consumer share-subscription list') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + + with self.argument_context('datashare consumer share-subscription show') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_subscription_name', options_list=['--name', '-n'], id_part='child_name_1', help='The name of the share subscription.') # modified + + with self.argument_context('datashare consumer share-subscription create') as c: + from azure.cli.core.commands.parameters import get_location_name_type, get_location_completion_list + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', options_list=['--name', '-n'], help='The name of the share subscription.') # modified + c.argument('invitation_id', validator=invitation_id_validator, help='The invitation id.') # modified + c.argument('source_share_location', type=get_location_name_type(self.cli_ctx), help='Source share location.', completer=get_location_completion_list) # modified + + with self.argument_context('datashare consumer share-subscription delete') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_subscription_name', options_list=['--name', '-n'], id_part='child_name_1', help='The name of the share subscription.') # modified + + with self.argument_context('datashare consumer share-subscription list-source-share-synchronization-setting') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the share subscription.') + + with self.argument_context('datashare consumer share-subscription list-source-dataset') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the share subscription.') + + with self.argument_context('datashare consumer share-subscription wait') as c: + c.argument('account_name', id_part='name', help='The name of the share account.') + c.argument('share_subscription_name', options_list=['--name', '-n'], id_part='child_name_1', help='The name of the share subscription.') # modified + + with self.argument_context('datashare consumer share-subscription synchronization start') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the share subscription.') + c.argument('synchronization_mode', arg_type=get_enum_type(SynchronizationMode), help='Synchronization mode') # modified + + with self.argument_context('datashare consumer share-subscription synchronization cancel') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the share subscription.') + c.argument('synchronization_id', help='The synchronization GUID') + + with self.argument_context('datashare consumer share-subscription synchronization wait') as c: + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the share subscription.') + c.argument('synchronization_id', help='The synchronization GUID') + + with self.argument_context('datashare consumer share-subscription synchronization list') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the share subscription.') + + with self.argument_context('datashare consumer share-subscription synchronization list-detail') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the share subscription.') + c.argument('synchronization_id', help='Synchronization id') + + with self.argument_context('datashare consumer dataset-mapping list') as c: # modified + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the share subscription.') + + with self.argument_context('datashare consumer dataset-mapping show') as c: # modified + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') + c.argument('share_subscription_name', id_part='child_name_1', help='The name of the share subscription.') + c.argument('data_set_mapping_name', id_part='child_name_2', options_list=['--name', '-n'], help='The name of the datasetMapping.') # modified + + with self.argument_context('datashare consumer dataset-mapping create') as c: # modified + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the share subscription.') + c.argument('data_set_mapping_name', options_list=['--name', '-n'], help='The name of the datasetMapping.') # modified + c.argument('data_set_mapping', options_list=['--mapping'], type=validate_file_or_dict, help='Dataset mapping in JSON string or path to JSON file.') # modified + + with self.argument_context('datashare consumer dataset-mapping delete') as c: # modified + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') + c.argument('share_subscription_name', id_part='child_name_1', help='The name of the share subscription.') + c.argument('data_set_mapping_name', id_part='child_name_2', options_list=['--name', '-n'], help='The name of the datasetMapping.') # modified + + with self.argument_context('datashare consumer dataset-mapping wait') as c: + c.argument('account_name', id_part='name', help='The name of the share account.') + c.argument('share_subscription_name', id_part='child_name_1', help='The name of the share subscription.') + c.argument('data_set_mapping_name', id_part='child_name_2', options_list=['--name', '-n'], help='The name of the datasetMapping.') # modified + + with self.argument_context('datashare consumer trigger list') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the share subscription.') + + with self.argument_context('datashare consumer trigger show') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') + c.argument('share_subscription_name', id_part='child_name_1', help='The name of the share subscription.') + c.argument('trigger_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the trigger.') + + with self.argument_context('datashare consumer trigger create') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', help='The name of the share account.') + c.argument('share_subscription_name', help='The name of the share subscription.') + c.argument('trigger_name', options_list=['--name', '-n'], help='The name of the trigger.') # modified + c.argument('recurrence_interval', arg_type=get_enum_type(RecurrenceInterval), arg_group='Synchronization Setting', help='Synchronization Recurrence Interval.') + c.argument('synchronization_time', arg_group='Synchronization Setting', arg_type=get_datetime_type(help='Synchronization time.')) + c.argument('kind', arg_type=get_enum_type(SynchronizationKind), arg_group='Synchronization Setting', default='ScheduleBased', help='Kind of synchronization.') + + with self.argument_context('datashare consumer trigger delete') as c: + c.argument('resource_group_name', resource_group_name_type) # modified + c.argument('account_name', id_part='name', help='The name of the share account.') # modified + c.argument('share_subscription_name', id_part='child_name_1', help='The name of the share subscription.') # modified + c.argument('trigger_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the trigger.') # modified + + with self.argument_context('datashare consumer trigger wait') as c: + c.argument('trigger_name', options_list=['--name', '-n'], id_part='child_name_2', help='The name of the trigger.') # modified diff --git a/src/datashare/azext_datashare/manual/_validators.py b/src/datashare/azext_datashare/manual/_validators.py new file mode 100644 index 00000000000..26b40d74163 --- /dev/null +++ b/src/datashare/azext_datashare/manual/_validators.py @@ -0,0 +1,11 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=unused-argument + + +def invitation_id_validator(cmd, namespace): + if namespace.invitation_id: + if namespace.invitation_id.startswith("/providers"): + namespace.invitation_id = namespace.invitation_id.split("/")[-1] diff --git a/src/datashare/azext_datashare/manual/commands.py b/src/datashare/azext_datashare/manual/commands.py new file mode 100644 index 00000000000..7caeb1df48f --- /dev/null +++ b/src/datashare/azext_datashare/manual/commands.py @@ -0,0 +1,137 @@ +# -------------------------------------------------------------------------------------------- +# 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 + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_datashare.generated._client_factory import cf_account + datashare_account = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._account_operations#AccountOperations.{}', + client_factory=cf_account) + with self.command_group('datashare account', datashare_account, client_factory=cf_account) as g: + g.custom_command('list', 'datashare_account_list') + g.custom_show_command('show', 'datashare_account_show') + g.custom_command('create', 'datashare_account_create', supports_no_wait=True) + g.custom_command('update', 'datashare_account_update') + g.custom_command('delete', 'datashare_account_delete', supports_no_wait=True, confirmation=True) + g.wait_command('wait') + + from azext_datashare.generated._client_factory import cf_consumer_invitation + datashare_consumer_invitation = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._consumer_invitation_operations#ConsumerInvitationOperations.{}', + client_factory=cf_consumer_invitation) + with self.command_group('datashare consumer invitation', datashare_consumer_invitation, client_factory=cf_consumer_invitation) as g: + g.custom_command('list', 'datashare_consumer_invitation_list') + g.custom_show_command('show', 'datashare_consumer_invitation_show') + g.custom_command('reject', 'datashare_consumer_invitation_reject_invitation') + + from azext_datashare.generated._client_factory import cf_data_set + datashare_data_set = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._data_set_operations#DataSetOperations.{}', + client_factory=cf_data_set) + with self.command_group('datashare dataset', datashare_data_set, client_factory=cf_data_set) as g: # modified + g.custom_command('list', 'datashare_data_set_list') + g.custom_show_command('show', 'datashare_data_set_show') + g.custom_command('create', 'datashare_data_set_create') + g.custom_command('delete', 'datashare_data_set_delete', supports_no_wait=True, confirmation=True) + g.wait_command('wait') + + from azext_datashare.generated._client_factory import cf_data_set_mapping + datashare_data_set_mapping = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._data_set_mapping_operations#DataSetMappingOperations.{}', + client_factory=cf_data_set_mapping) + with self.command_group('datashare consumer dataset-mapping', datashare_data_set_mapping, client_factory=cf_data_set_mapping) as g: # modified + g.custom_command('list', 'datashare_data_set_mapping_list') + g.custom_show_command('show', 'datashare_data_set_mapping_show') + g.custom_command('create', 'datashare_data_set_mapping_create') + g.custom_command('delete', 'datashare_data_set_mapping_delete', confirmation=True) + + from azext_datashare.generated._client_factory import cf_invitation + datashare_invitation = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._invitation_operations#InvitationOperations.{}', + client_factory=cf_invitation) + with self.command_group('datashare invitation', datashare_invitation, client_factory=cf_invitation) as g: + g.custom_command('list', 'datashare_invitation_list') + g.custom_show_command('show', 'datashare_invitation_show') + g.custom_command('create', 'datashare_invitation_create') + g.custom_command('delete', 'datashare_invitation_delete', confirmation=True) + + from azext_datashare.generated._client_factory import cf_share + datashare_share = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._share_operations#ShareOperations.{}', + client_factory=cf_share) + with self.command_group('datashare', datashare_share, client_factory=cf_share, is_experimental=True) as g: # modified + g.custom_command('list', 'datashare_share_list') + g.custom_show_command('show', 'datashare_share_show') + g.custom_command('create', 'datashare_share_create') + g.custom_command('delete', 'datashare_share_delete', supports_no_wait=True, confirmation=True) + g.wait_command('wait') + + with self.command_group('datashare synchronization', datashare_share, client_factory=cf_share, is_experimental=True) as g: + g.custom_command('list-detail', 'datashare_share_list_synchronization_detail') + g.custom_command('list', 'datashare_share_list_synchronization') + + from azext_datashare.generated._client_factory import cf_provider_share_subscription + datashare_provider_share_subscription = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._provider_share_subscription_operations#ProviderShareSubscriptionOperations.{}', + client_factory=cf_provider_share_subscription) + with self.command_group('datashare provider-share-subscription', datashare_provider_share_subscription, client_factory=cf_provider_share_subscription) as g: + g.custom_command('list', 'datashare_provider_share_subscription_list') + g.custom_show_command('show', 'datashare_provider_share_subscription_show') + g.custom_command('revoke', 'datashare_provider_share_subscription_revoke', supports_no_wait=True) + g.custom_command('reinstate', 'datashare_provider_share_subscription_reinstate') + g.wait_command('wait', getter_name='get_by_share') + + from azext_datashare.generated._client_factory import cf_share_subscription + datashare_share_subscription = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._share_subscription_operations#ShareSubscriptionOperations.{}', + client_factory=cf_share_subscription) + with self.command_group('datashare consumer share-subscription', datashare_share_subscription, client_factory=cf_share_subscription) as g: + g.custom_command('list', 'datashare_share_subscription_list') + g.custom_show_command('show', 'datashare_share_subscription_show') + g.custom_command('create', 'datashare_share_subscription_create') + g.custom_command('delete', 'datashare_share_subscription_delete', supports_no_wait=True, confirmation=True) + g.custom_command('list-source-share-synchronization-setting', 'datashare_share_subscription_list_source_share_synchronization_setting') + g.wait_command('wait') + + with self.command_group('datashare consumer share-subscription synchronization', datashare_share_subscription, client_factory=cf_share_subscription) as g: + g.custom_command('list', 'datashare_share_subscription_list_synchronization') + g.custom_command('list-detail', 'datashare_share_subscription_list_synchronization_detail') + g.custom_command('start', 'datashare_share_subscription_synchronize', supports_no_wait=True) + g.custom_command('cancel', 'datashare_share_subscription_cancel_synchronization', supports_no_wait=True) + g.custom_wait_command('wait', '_datashare_share_subscription_get_synchronization') + + from azext_datashare.generated._client_factory import cf_consumer_source_data_set + datashare_consumer_source_data_set = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._consumer_source_data_set_operations#ConsumerSourceDataSetOperations.{}', + client_factory=cf_consumer_source_data_set) + with self.command_group('datashare consumer share-subscription', datashare_consumer_source_data_set, client_factory=cf_consumer_source_data_set) as g: + g.custom_command('list-source-dataset', 'datashare_consumer_source_data_set_list') + + from azext_datashare.generated._client_factory import cf_synchronization_setting + datashare_synchronization_setting = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._synchronization_setting_operations#SynchronizationSettingOperations.{}', + client_factory=cf_synchronization_setting) + with self.command_group('datashare synchronization-setting', datashare_synchronization_setting, client_factory=cf_synchronization_setting) as g: + g.custom_command('list', 'datashare_synchronization_setting_list') + g.custom_show_command('show', 'datashare_synchronization_setting_show') + g.custom_command('create', 'datashare_synchronization_setting_create') + g.custom_command('delete', 'datashare_synchronization_setting_delete', supports_no_wait=True, confirmation=True) + g.wait_command('wait') + + from azext_datashare.generated._client_factory import cf_trigger + datashare_trigger = CliCommandType( + operations_tmpl='azext_datashare.vendored_sdks.datashare.operations._trigger_operations#TriggerOperations.{}', + client_factory=cf_trigger) + with self.command_group('datashare consumer trigger', datashare_trigger, client_factory=cf_trigger) as g: + g.custom_command('list', 'datashare_trigger_list') + g.custom_show_command('show', 'datashare_trigger_show') + g.custom_command('create', 'datashare_trigger_create', supports_no_wait=True) + g.custom_command('delete', 'datashare_trigger_delete', supports_no_wait=True, confirmation=True) + g.wait_command('wait') diff --git a/src/datashare/azext_datashare/manual/custom.py b/src/datashare/azext_datashare/manual/custom.py new file mode 100644 index 00000000000..c75327b1b3f --- /dev/null +++ b/src/datashare/azext_datashare/manual/custom.py @@ -0,0 +1,520 @@ +# -------------------------------------------------------------------------------------------- +# 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=unused-argument +from azure.cli.core.util import sdk_no_wait + + +def datashare_account_list(cmd, client, + resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def datashare_account_show(cmd, client, + resource_group_name, + account_name): + return client.get(resource_group_name=resource_group_name, account_name=account_name) + + +def datashare_account_create(cmd, client, + resource_group_name, + account_name, + identity=None, + location=None, + tags=None, + no_wait=False): + if identity is None: + identity = {'type': 'SystemAssigned'} + return sdk_no_wait(no_wait, + client.begin_create, + resource_group_name=resource_group_name, + account_name=account_name, + location=location, + tags=tags, + identity=identity) + + +def datashare_account_update(cmd, client, + resource_group_name, + account_name, + tags=None): + return client.update(resource_group_name=resource_group_name, account_name=account_name, tags=tags) + + +def datashare_account_delete(cmd, client, + resource_group_name, + account_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + account_name=account_name) + + +def datashare_consumer_invitation_list(cmd, client): + return client.list_invitation() + + +def datashare_consumer_invitation_show(cmd, client, + location, + invitation_id): + return client.get(location=location, invitation_id=invitation_id) + + +def datashare_consumer_invitation_reject_invitation(cmd, client, + location, + invitation_id): + return client.reject_invitation(location=location, invitation_id=invitation_id) + + +def datashare_data_set_list(cmd, client, + resource_group_name, + account_name, + share_name): + return client.list_by_share(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name) + + +def datashare_data_set_show(cmd, client, + resource_group_name, + account_name, + share_name, + data_set_name): + return client.get(resource_group_name=resource_group_name, account_name=account_name, share_name=share_name, data_set_name=data_set_name) + + +def datashare_data_set_create(cmd, client, + resource_group_name, + account_name, + share_name, + data_set_name, + data_set): + from azure.cli.core.commands.client_factory import get_subscription_id + if 'resource_group' not in data_set: + data_set['resource_group'] = resource_group_name + if 'subscription_id' not in data_set: + data_set['subscription_id'] = get_subscription_id(cmd.cli_ctx) + return client.create(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + data_set_name=data_set_name, + data_set=data_set) + + +def datashare_data_set_delete(cmd, client, + resource_group_name, + account_name, + share_name, + data_set_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + data_set_name=data_set_name) + + +def datashare_data_set_mapping_list(cmd, client, + resource_group_name, + account_name, + share_subscription_name): + return client.list_by_share_subscription(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name) + + +def datashare_data_set_mapping_show(cmd, client, + resource_group_name, + account_name, + share_subscription_name, + data_set_mapping_name): + return client.get(resource_group_name=resource_group_name, account_name=account_name, share_subscription_name=share_subscription_name, data_set_mapping_name=data_set_mapping_name) + + +def datashare_data_set_mapping_create(cmd, client, + resource_group_name, + account_name, + share_subscription_name, + data_set_mapping_name, + data_set_mapping): + from azure.cli.core.commands.client_factory import get_subscription_id + if 'resource_group' not in data_set_mapping: + data_set_mapping['resource_group'] = resource_group_name + if 'subscription_id' not in data_set_mapping: + data_set_mapping['subscription_id'] = get_subscription_id(cmd.cli_ctx) + return client.create(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + data_set_mapping_name=data_set_mapping_name, + data_set_mapping=data_set_mapping) + + +def datashare_data_set_mapping_delete(cmd, client, + resource_group_name, + account_name, + share_subscription_name, + data_set_mapping_name): + return client.delete(resource_group_name=resource_group_name, account_name=account_name, share_subscription_name=share_subscription_name, data_set_mapping_name=data_set_mapping_name) + + +def datashare_invitation_list(cmd, client, + resource_group_name, + account_name, + share_name): + return client.list_by_share(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name) + + +def datashare_invitation_show(cmd, client, + resource_group_name, + account_name, + share_name, + invitation_name): + return client.get(resource_group_name=resource_group_name, account_name=account_name, share_name=share_name, invitation_name=invitation_name) + + +def datashare_invitation_create(cmd, client, + resource_group_name, + account_name, + share_name, + invitation_name, + target_active_directory_id=None, + target_email=None, + target_object_id=None): + return client.create(resource_group_name=resource_group_name, account_name=account_name, share_name=share_name, invitation_name=invitation_name, target_active_directory_id=target_active_directory_id, target_email=target_email, target_object_id=target_object_id) + + +def datashare_invitation_delete(cmd, client, + resource_group_name, + account_name, + share_name, + invitation_name): + return client.delete(resource_group_name=resource_group_name, account_name=account_name, share_name=share_name, invitation_name=invitation_name) + + +def datashare_share_list(cmd, client, + resource_group_name, + account_name): + return client.list_by_account(resource_group_name=resource_group_name, account_name=account_name) + + +def datashare_share_show(cmd, client, + resource_group_name, + account_name, + share_name): + return client.get(resource_group_name=resource_group_name, account_name=account_name, share_name=share_name) + + +def datashare_share_create(cmd, client, + resource_group_name, + account_name, + share_name, + description=None, + share_kind=None, + terms=None): + return client.create(resource_group_name=resource_group_name, account_name=account_name, share_name=share_name, description=description, share_kind=share_kind, terms=terms) + + +def datashare_share_delete(cmd, client, + resource_group_name, + account_name, + share_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name) + + +def datashare_share_list_synchronization_detail(cmd, client, + resource_group_name, + account_name, + share_name, + synchronization_id=None): + return client.list_synchronization_detail(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + synchronization_id=synchronization_id) + + +def datashare_share_list_synchronization(cmd, client, + resource_group_name, + account_name, + share_name): + return client.list_synchronization(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name) + + +def datashare_provider_share_subscription_list(cmd, client, + resource_group_name, + account_name, + share_name): + return client.list_by_share(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name) + + +def datashare_provider_share_subscription_show(cmd, client, + resource_group_name, + account_name, + share_name, + provider_share_subscription_id): + return client.get_by_share(resource_group_name=resource_group_name, account_name=account_name, share_name=share_name, provider_share_subscription_id=provider_share_subscription_id) + + +def datashare_provider_share_subscription_revoke(cmd, client, + resource_group_name, + account_name, + share_name, + provider_share_subscription_id, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_revoke, + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + provider_share_subscription_id=provider_share_subscription_id) + + +def datashare_provider_share_subscription_reinstate(cmd, client, + resource_group_name, + account_name, + share_name, + provider_share_subscription_id): + return client.reinstate(resource_group_name=resource_group_name, account_name=account_name, share_name=share_name, provider_share_subscription_id=provider_share_subscription_id) + + +def datashare_share_subscription_list(cmd, client, + resource_group_name, + account_name): + return client.list_by_account(resource_group_name=resource_group_name, account_name=account_name) + + +def datashare_share_subscription_show(cmd, client, + resource_group_name, + account_name, + share_subscription_name): + return client.get(resource_group_name=resource_group_name, account_name=account_name, share_subscription_name=share_subscription_name) + + +def datashare_share_subscription_create(cmd, client, + resource_group_name, + account_name, + share_subscription_name, + invitation_id, + source_share_location): + return client.create(resource_group_name=resource_group_name, account_name=account_name, share_subscription_name=share_subscription_name, invitation_id=invitation_id, source_share_location=source_share_location) + + +def datashare_share_subscription_delete(cmd, client, + resource_group_name, + account_name, + share_subscription_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name) + + +def datashare_share_subscription_list_synchronization_detail(cmd, client, + resource_group_name, + account_name, + share_subscription_name, + synchronization_id): + return client.list_synchronization_detail(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + synchronization_id=synchronization_id) + + +def datashare_share_subscription_synchronize(cmd, client, + resource_group_name, + account_name, + share_subscription_name, + synchronization_mode=None, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_synchronize, + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + synchronization_mode=synchronization_mode) + + +def datashare_share_subscription_cancel_synchronization(cmd, client, + resource_group_name, + account_name, + share_subscription_name, + synchronization_id, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_cancel_synchronization, + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + synchronization_id=synchronization_id) + + +def datashare_share_subscription_list_source_share_synchronization_setting(cmd, client, + resource_group_name, + account_name, + share_subscription_name): + return client.list_source_share_synchronization_setting(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name) + + +def datashare_share_subscription_list_synchronization(cmd, client, + resource_group_name, + account_name, + share_subscription_name): + return client.list_synchronization(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name) + + +def _datashare_share_subscription_get_synchronization(cmd, client, + resource_group_name, + account_name, + share_subscription_name, + synchronization_id): + from knack.util import todict + from azure.cli.core.commands import AzCliCommandInvoker + result = client.list_synchronization(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name) + result = todict(list(result), AzCliCommandInvoker.remove_additional_prop_layer) + return next((x for x in result if x['synchronizationId'] == synchronization_id), None) + + +def datashare_consumer_source_data_set_list(cmd, client, + resource_group_name, + account_name, + share_subscription_name): + return client.list_by_share_subscription(resource_group_name=resource_group_name, account_name=account_name, share_subscription_name=share_subscription_name) + + +def datashare_synchronization_setting_list(cmd, client, + resource_group_name, + account_name, + share_name): + return client.list_by_share(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name) + + +def datashare_synchronization_setting_show(cmd, client, + resource_group_name, + account_name, + share_name, + synchronization_setting_name): + return client.get(resource_group_name=resource_group_name, account_name=account_name, share_name=share_name, synchronization_setting_name=synchronization_setting_name) + + +# def _format_datetime(date_string): +# from dateutil.parser import parse +# try: +# return parse(date_string).strftime("%Y-%m-%dT%H:%M:%SZ") +# except ValueError: +# # logger.debug("Unable to parse date_string '%s'", date_string) +# return date_string or ' ' + + +def datashare_synchronization_setting_create(cmd, client, + resource_group_name, + account_name, + share_name, + synchronization_setting_name, + recurrence_interval, + synchronization_time, + kind=None): + synchronization_setting = { + 'synchronizationTime': synchronization_time, + 'recurrenceInterval': recurrence_interval, + 'kind': kind + } + return client.create(resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + synchronization_setting_name=synchronization_setting_name, + synchronization_setting=synchronization_setting) + + +def datashare_synchronization_setting_delete(cmd, client, + resource_group_name, + account_name, + share_name, + synchronization_setting_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + synchronization_setting_name=synchronization_setting_name) + + +def datashare_trigger_list(cmd, client, + resource_group_name, + account_name, + share_subscription_name): + return client.list_by_share_subscription(resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name) + + +def datashare_trigger_show(cmd, client, + resource_group_name, + account_name, + share_subscription_name, + trigger_name): + return client.get(resource_group_name=resource_group_name, account_name=account_name, share_subscription_name=share_subscription_name, trigger_name=trigger_name) + + +def datashare_trigger_create(cmd, client, + resource_group_name, + account_name, + share_subscription_name, + trigger_name, + recurrence_interval, + synchronization_time, + kind=None, + no_wait=False): + synchronization_setting = { + 'synchronizationTime': synchronization_time, + 'recurrenceInterval': recurrence_interval, + 'kind': kind + } + return sdk_no_wait(no_wait, + client.begin_create, + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + trigger_name=trigger_name, + trigger=synchronization_setting) + + +def datashare_trigger_delete(cmd, client, + resource_group_name, + account_name, + share_subscription_name, + trigger_name, + no_wait=False): + return sdk_no_wait(no_wait, + client.begin_delete, + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + trigger_name=trigger_name) diff --git a/src/datashare/azext_datashare/tests/__init__.py b/src/datashare/azext_datashare/tests/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/datashare/azext_datashare/tests/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/datashare/azext_datashare/tests/latest/__init__.py b/src/datashare/azext_datashare/tests/latest/__init__.py new file mode 100644 index 00000000000..ee0c4f36bd0 --- /dev/null +++ b/src/datashare/azext_datashare/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/datashare/azext_datashare/tests/latest/recordings/test_datashare.yaml b/src/datashare/azext_datashare/tests/latest/recordings/test_datashare.yaml new file mode 100644 index 00000000000..5896d5f4841 --- /dev/null +++ b/src/datashare/azext_datashare/tests/latest/recordings/test_datashare.yaml @@ -0,0 +1,3351 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - unknown + Connection: + - keep-alive + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/8.0.1 Azure-SDK-For-Python AZURECLI/2.4.0 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/locations?api-version=2019-06-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia","name":"eastasia","displayName":"East + Asia","longitude":"114.188","latitude":"22.267"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia","name":"southeastasia","displayName":"Southeast + Asia","longitude":"103.833","latitude":"1.283"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus","name":"centralus","displayName":"Central + US","longitude":"-93.6208","latitude":"41.5908"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus","name":"eastus","displayName":"East + US","longitude":"-79.8164","latitude":"37.3719"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2","name":"eastus2","displayName":"East + US 2","longitude":"-78.3889","latitude":"36.6681"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus","name":"westus","displayName":"West + US","longitude":"-122.417","latitude":"37.783"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus","name":"northcentralus","displayName":"North + Central US","longitude":"-87.6278","latitude":"41.8819"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus","name":"southcentralus","displayName":"South + Central US","longitude":"-98.5","latitude":"29.4167"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope","name":"northeurope","displayName":"North + Europe","longitude":"-6.2597","latitude":"53.3478"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope","name":"westeurope","displayName":"West + Europe","longitude":"4.9","latitude":"52.3667"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest","name":"japanwest","displayName":"Japan + West","longitude":"135.5022","latitude":"34.6939"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast","name":"japaneast","displayName":"Japan + East","longitude":"139.77","latitude":"35.68"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth","name":"brazilsouth","displayName":"Brazil + South","longitude":"-46.633","latitude":"-23.55"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast","name":"australiaeast","displayName":"Australia + East","longitude":"151.2094","latitude":"-33.86"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast","name":"australiasoutheast","displayName":"Australia + Southeast","longitude":"144.9631","latitude":"-37.8136"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia","name":"southindia","displayName":"South + India","longitude":"80.1636","latitude":"12.9822"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia","name":"centralindia","displayName":"Central + India","longitude":"73.9197","latitude":"18.5822"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westindia","name":"westindia","displayName":"West + India","longitude":"72.868","latitude":"19.088"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral","name":"canadacentral","displayName":"Canada + Central","longitude":"-79.383","latitude":"43.653"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast","name":"canadaeast","displayName":"Canada + East","longitude":"-71.217","latitude":"46.817"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth","name":"uksouth","displayName":"UK + South","longitude":"-0.799","latitude":"50.941"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest","name":"ukwest","displayName":"UK + West","longitude":"-3.084","latitude":"53.427"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus","name":"westcentralus","displayName":"West + Central US","longitude":"-110.234","latitude":"40.890"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2","name":"westus2","displayName":"West + US 2","longitude":"-119.852","latitude":"47.233"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral","name":"koreacentral","displayName":"Korea + Central","longitude":"126.9780","latitude":"37.5665"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth","name":"koreasouth","displayName":"Korea + South","longitude":"129.0756","latitude":"35.1796"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral","name":"francecentral","displayName":"France + Central","longitude":"2.3730","latitude":"46.3772"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth","name":"francesouth","displayName":"France + South","longitude":"2.1972","latitude":"43.8345"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral","name":"australiacentral","displayName":"Australia + Central","longitude":"149.1244","latitude":"-35.3075"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2","name":"australiacentral2","displayName":"Australia + Central 2","longitude":"149.1244","latitude":"-35.3075"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral","name":"uaecentral","displayName":"UAE + Central","longitude":"54.366669","latitude":"24.466667"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth","name":"uaenorth","displayName":"UAE + North","longitude":"55.316666","latitude":"25.266666"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth","name":"southafricanorth","displayName":"South + Africa North","longitude":"28.218370","latitude":"-25.731340"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest","name":"southafricawest","displayName":"South + Africa West","longitude":"18.843266","latitude":"-34.075691"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth","name":"switzerlandnorth","displayName":"Switzerland + North","longitude":"8.564572","latitude":"47.451542"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest","name":"switzerlandwest","displayName":"Switzerland + West","longitude":"6.143158","latitude":"46.204391"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth","name":"germanynorth","displayName":"Germany + North","longitude":"8.806422","latitude":"53.073635"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral","name":"germanywestcentral","displayName":"Germany + West Central","longitude":"8.682127","latitude":"50.110924"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest","name":"norwaywest","displayName":"Norway + West","longitude":"5.733107","latitude":"58.969975"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast","name":"norwayeast","displayName":"Norway + East","longitude":"10.752245","latitude":"59.913868"}]}' + headers: + cache-control: + - no-cache + content-length: + - '7129' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:42:15 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus2", "tags": {"tag1": "Red", "tag2": "White"}, "identity": + {"type": "SystemAssigned"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account create + Connection: + - keep-alive + Content-Length: + - '105' + Content-Type: + - application/json + ParameterSetName: + - --location --tags --name --resource-group + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account?api-version=2019-11-01 + response: + body: + string: '{"identity":{"type":"SystemAssigned","principalId":"b5246a1a-9dff-43b3-bef8-4e1ae69234aa","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"properties":{"createdAt":"2020-04-23T13:42:23.9427652Z","provisioningState":"Creating","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account","name":"cli_test_account","type":"Microsoft.DataShare/accounts","location":"westus2","tags":{"tag1":"Red","tag2":"White"}}' + headers: + cache-control: + - no-cache + content-length: + - '619' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:42:26 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account?api-version=2019-11-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-quota: + - '[{"currentUsed":4,"limit":50,"name":{"localizedValue":"Account resource quota","value":"Account + resource quota"},"target":"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli_test_datrywkgqr6mfnic2batum7zhzzekrutyfed7ajmopnqmg7bfkqdq2mavcabi7fdxo/providers/Microsoft.DataShare/accounts/cli_test_account"}]' + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account wait + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --created + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account?api-version=2019-11-01 + response: + body: + string: '{"identity":{"type":"SystemAssigned","principalId":"b5246a1a-9dff-43b3-bef8-4e1ae69234aa","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"properties":{"createdAt":"2020-04-23T13:42:23.9427652Z","provisioningState":"Creating","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account","name":"cli_test_account","type":"Microsoft.DataShare/accounts","location":"westus2","tags":{"tag1":"Red","tag2":"White"}}' + headers: + cache-control: + - no-cache + content-length: + - '619' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:42:27 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account wait + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --created + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account?api-version=2019-11-01 + response: + body: + string: '{"identity":{"type":"SystemAssigned","principalId":"b5246a1a-9dff-43b3-bef8-4e1ae69234aa","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"properties":{"createdAt":"2020-04-23T13:42:23.9427652Z","provisioningState":"Creating","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account","name":"cli_test_account","type":"Microsoft.DataShare/accounts","location":"westus2","tags":{"tag1":"Red","tag2":"White"}}' + headers: + cache-control: + - no-cache + content-length: + - '619' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:42:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account wait + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --created + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account?api-version=2019-11-01 + response: + body: + string: '{"identity":{"type":"SystemAssigned","principalId":"b5246a1a-9dff-43b3-bef8-4e1ae69234aa","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"properties":{"createdAt":"2020-04-23T13:42:23.9427652Z","provisioningState":"Creating","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account","name":"cli_test_account","type":"Microsoft.DataShare/accounts","location":"westus2","tags":{"tag1":"Red","tag2":"White"}}' + headers: + cache-control: + - no-cache + content-length: + - '619' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:43:29 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account wait + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --created + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account?api-version=2019-11-01 + response: + body: + string: '{"identity":{"type":"SystemAssigned","principalId":"b5246a1a-9dff-43b3-bef8-4e1ae69234aa","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"properties":{"createdAt":"2020-04-23T13:42:23.9427652Z","provisioningState":"Creating","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account","name":"cli_test_account","type":"Microsoft.DataShare/accounts","location":"westus2","tags":{"tag1":"Red","tag2":"White"}}' + headers: + cache-control: + - no-cache + content-length: + - '619' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:43:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account wait + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --created + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account?api-version=2019-11-01 + response: + body: + string: '{"identity":{"type":"SystemAssigned","principalId":"b5246a1a-9dff-43b3-bef8-4e1ae69234aa","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"properties":{"createdAt":"2020-04-23T13:42:23.9427652Z","provisioningState":"Succeeded","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account","name":"cli_test_account","type":"Microsoft.DataShare/accounts","location":"westus2","tags":{"tag1":"Red","tag2":"White"}}' + headers: + cache-control: + - no-cache + content-length: + - '620' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:44:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account show + Connection: + - keep-alive + ParameterSetName: + - -n --resource-group + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account?api-version=2019-11-01 + response: + body: + string: '{"identity":{"type":"SystemAssigned","principalId":"b5246a1a-9dff-43b3-bef8-4e1ae69234aa","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"properties":{"createdAt":"2020-04-23T13:42:23.9427652Z","provisioningState":"Succeeded","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account","name":"cli_test_account","type":"Microsoft.DataShare/accounts","location":"westus2","tags":{"tag1":"Red","tag2":"White"}}' + headers: + cache-control: + - no-cache + content-length: + - '620' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:44:32 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account show + Connection: + - keep-alive + ParameterSetName: + - --ids + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account?api-version=2019-11-01 + response: + body: + string: '{"identity":{"type":"SystemAssigned","principalId":"b5246a1a-9dff-43b3-bef8-4e1ae69234aa","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"properties":{"createdAt":"2020-04-23T13:42:23.9427652Z","provisioningState":"Succeeded","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account","name":"cli_test_account","type":"Microsoft.DataShare/accounts","location":"westus2","tags":{"tag1":"Red","tag2":"White"}}' + headers: + cache-control: + - no-cache + content-length: + - '620' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:44:33 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts?api-version=2019-11-01 + response: + body: + string: '{"value":[{"identity":{"type":"SystemAssigned","principalId":"b5246a1a-9dff-43b3-bef8-4e1ae69234aa","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"properties":{"createdAt":"2020-04-23T13:42:23.9427652Z","provisioningState":"Succeeded","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account","name":"cli_test_account","type":"Microsoft.DataShare/accounts","location":"westus2","tags":{"tag1":"Red","tag2":"White"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '632' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:44:35 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"tags": {"tag1": "Green"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account update + Connection: + - keep-alive + Content-Length: + - '27' + Content-Type: + - application/json + ParameterSetName: + - --name --tags --resource-group + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account?api-version=2019-11-01 + response: + body: + string: '{"identity":{"type":"SystemAssigned","principalId":"b5246a1a-9dff-43b3-bef8-4e1ae69234aa","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"},"properties":{"createdAt":"2020-04-23T13:42:23.9427652Z","provisioningState":"Succeeded","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account","name":"cli_test_account","type":"Microsoft.DataShare/accounts","location":"westus2","tags":{"tag1":"Green"}}' + headers: + cache-control: + - no-cache + content-length: + - '607' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:44:40 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"description": "share description", "shareKind": "CopyBased", + "terms": "Confidential"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare create + Connection: + - keep-alive + Content-Length: + - '103' + Content-Type: + - application/json + ParameterSetName: + - --account-name --resource-group --description --share-kind --terms --name + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share?api-version=2019-11-01 + response: + body: + string: '{"properties":{"description":"share description","terms":"Confidential","shareKind":"CopyBased","provisioningState":"Succeeded","createdAt":"2020-04-23T13:44:43.0008884Z","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share","name":"cli_test_share","type":"Microsoft.DataShare/shares"}' + headers: + cache-control: + - no-cache + content-length: + - '521' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:44:43 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/cli_test_share + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-quota: + - '[{"currentUsed":1,"limit":100,"name":{"localizedValue":"Share resource quota","value":"Share + resource quota"},"target":"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli_test_datrywkgqr6mfnic2batum7zhzzekrutyfed7ajmopnqmg7bfkqdq2mavcabi7fdxo/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share"}]' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare show + Connection: + - keep-alive + ParameterSetName: + - --account-name --resource-group --name + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share?api-version=2019-11-01 + response: + body: + string: '{"properties":{"description":"share description","terms":"Confidential","shareKind":"CopyBased","provisioningState":"Succeeded","createdAt":"2020-04-23T13:44:43.0008884Z","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share","name":"cli_test_share","type":"Microsoft.DataShare/shares"}' + headers: + cache-control: + - no-cache + content-length: + - '521' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:44:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare show + Connection: + - keep-alive + ParameterSetName: + - --ids + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share?api-version=2019-11-01 + response: + body: + string: '{"properties":{"description":"share description","terms":"Confidential","shareKind":"CopyBased","provisioningState":"Succeeded","createdAt":"2020-04-23T13:44:43.0008884Z","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share","name":"cli_test_share","type":"Microsoft.DataShare/shares"}' + headers: + cache-control: + - no-cache + content-length: + - '521' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:44:46 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare list + Connection: + - keep-alive + ParameterSetName: + - --account-name --resource-group + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares?api-version=2019-11-01 + response: + body: + string: '{"value":[{"properties":{"description":"share description","terms":"Confidential","shareKind":"CopyBased","provisioningState":"Succeeded","createdAt":"2020-04-23T13:44:43.0008884Z","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share","name":"cli_test_share","type":"Microsoft.DataShare/shares"}]}' + headers: + cache-control: + - no-cache + content-length: + - '533' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:44:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account show + Connection: + - keep-alive + ParameterSetName: + - -n -g + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.Storage/storageAccounts/clitestdatas000002?api-version=2019-06-01 + response: + body: + string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.Storage/storageAccounts/clitestdatas000002","name":"clitestdatas000002","type":"Microsoft.Storage/storageAccounts","location":"westus2","tags":{},"properties":{"privateEndpointConnections":[],"isHnsEnabled":false,"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-23T13:41:53.6606746Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-23T13:41:53.6606746Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-04-23T13:41:53.5981225Z","primaryEndpoints":{"blob":"https://clitestdatas000002.blob.core.windows.net/","queue":"https://clitestdatas000002.queue.core.windows.net/","table":"https://clitestdatas000002.table.core.windows.net/","file":"https://clitestdatas000002.file.core.windows.net/"},"primaryLocation":"westus2","statusOfPrimary":"available"}}' + headers: + cache-control: + - no-cache + content-length: + - '1263' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 13:44:49 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"roleDefinitionId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/2a2b9908-6ea1-4ae2-8e65-a410df84e7d1", + "principalId": "b5246a1a-9dff-43b3-bef8-4e1ae69234aa", "principalType": "ServicePrincipal"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - role assignment create + Connection: + - keep-alive + Content-Length: + - '270' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --role --assignee-object-id --assignee-principal-type --scope + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-authorization/0.52.0 Azure-SDK-For-Python AZURECLI/2.4.0 (MSI) + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.Storage/storageAccounts/clitestdatas000002/providers/Microsoft.Authorization/roleAssignments/0276c401-3a81-4eb5-ac21-1d520c24c5e1?api-version=2018-09-01-preview + response: + body: + string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/2a2b9908-6ea1-4ae2-8e65-a410df84e7d1","principalId":"b5246a1a-9dff-43b3-bef8-4e1ae69234aa","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.Storage/storageAccounts/clitestdatas000002","createdOn":"2020-04-23T13:44:51.4815862Z","updatedOn":"2020-04-23T13:44:51.4815862Z","createdBy":null,"updatedBy":"31e600e0-d7ce-4e98-a927-19bb30042e44"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.Storage/storageAccounts/clitestdatas000002/providers/Microsoft.Authorization/roleAssignments/0276c401-3a81-4eb5-ac21-1d520c24c5e1","type":"Microsoft.Authorization/roleAssignments","name":"0276c401-3a81-4eb5-ac21-1d520c24c5e1"}' + headers: + cache-control: + - no-cache + content-length: + - '1041' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:44:58 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - x-ms-gateway-slice=Production; path=/; SameSite=None; secure; HttpOnly + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage container create + Connection: + - keep-alive + ParameterSetName: + - --account-name --name + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/storageAccounts?api-version=2019-06-01 + response: + body: + string: '{"value":[{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-core-poc/providers/Microsoft.Storage/storageAccounts/azurecorepoc","name":"azurecorepoc","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-12-26T02:38:58.8233588Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-12-26T02:38:58.8233588Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-12-26T02:38:58.7452329Z","primaryEndpoints":{"dfs":"https://azurecorepoc.dfs.core.windows.net/","web":"https://azurecorepoc.z13.web.core.windows.net/","blob":"https://azurecorepoc.blob.core.windows.net/","queue":"https://azurecorepoc.queue.core.windows.net/","table":"https://azurecorepoc.table.core.windows.net/","file":"https://azurecorepoc.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available","secondaryLocation":"westus","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://azurecorepoc-secondary.dfs.core.windows.net/","web":"https://azurecorepoc-secondary.z13.web.core.windows.net/","blob":"https://azurecorepoc-secondary.blob.core.windows.net/","queue":"https://azurecorepoc-secondary.queue.core.windows.net/","table":"https://azurecorepoc-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/fytest/providers/Microsoft.Storage/storageAccounts/fystac","name":"fystac","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-08T03:10:13.4426715Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-08T03:10:13.4426715Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-08T03:10:13.3645539Z","primaryEndpoints":{"dfs":"https://fystac.dfs.core.windows.net/","web":"https://fystac.z13.web.core.windows.net/","blob":"https://fystac.blob.core.windows.net/","queue":"https://fystac.queue.core.windows.net/","table":"https://fystac.table.core.windows.net/","file":"https://fystac.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available","secondaryLocation":"westus","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://fystac-secondary.dfs.core.windows.net/","web":"https://fystac-secondary.z13.web.core.windows.net/","blob":"https://fystac-secondary.blob.core.windows.net/","queue":"https://fystac-secondary.queue.core.windows.net/","table":"https://fystac-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/harold/providers/Microsoft.Storage/storageAccounts/harold","name":"harold","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-29T13:11:16.4123336Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-29T13:11:16.4123336Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-03-29T13:11:16.3342268Z","primaryEndpoints":{"dfs":"https://harold.dfs.core.windows.net/","web":"https://harold.z13.web.core.windows.net/","blob":"https://harold.blob.core.windows.net/","queue":"https://harold.queue.core.windows.net/","table":"https://harold.table.core.windows.net/","file":"https://harold.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available","secondaryLocation":"westus","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://harold-secondary.dfs.core.windows.net/","web":"https://harold-secondary.z13.web.core.windows.net/","blob":"https://harold-secondary.blob.core.windows.net/","queue":"https://harold-secondary.queue.core.windows.net/","table":"https://harold-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qianwens/providers/Microsoft.Storage/storageAccounts/qianwenadls","name":"qianwenadls","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"privateEndpointConnections":[],"isHnsEnabled":true,"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-01T10:11:06.0357634Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-01T10:11:06.0357634Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-01T10:11:05.9576622Z","primaryEndpoints":{"dfs":"https://qianwenadls.dfs.core.windows.net/","web":"https://qianwenadls.z13.web.core.windows.net/","blob":"https://qianwenadls.blob.core.windows.net/","queue":"https://qianwenadls.queue.core.windows.net/","table":"https://qianwenadls.table.core.windows.net/","file":"https://qianwenadls.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available","secondaryLocation":"westus","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://qianwenadls-secondary.dfs.core.windows.net/","web":"https://qianwenadls-secondary.z13.web.core.windows.net/","blob":"https://qianwenadls-secondary.blob.core.windows.net/","queue":"https://qianwenadls-secondary.queue.core.windows.net/","table":"https://qianwenadls-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qianwens/providers/Microsoft.Storage/storageAccounts/qianwendev","name":"qianwendev","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qianwens/providers/Microsoft.Network/virtualNetworks/QIAN/subnets/default","action":"Allow","state":"Succeeded"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qianwens/providers/Microsoft.Network/virtualNetworks/qianwendev/subnets/default","action":"Allow","state":"Succeeded"}],"ipRules":[{"value":"23.45.1.0/24","action":"Allow"},{"value":"23.45.1.1/24","action":"Allow"}],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-12T03:29:28.0084761Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-12T03:29:28.0084761Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-02-12T03:29:27.9459854Z","primaryEndpoints":{"dfs":"https://qianwendev.dfs.core.windows.net/","web":"https://qianwendev.z13.web.core.windows.net/","blob":"https://qianwendev.blob.core.windows.net/","queue":"https://qianwendev.queue.core.windows.net/","table":"https://qianwendev.table.core.windows.net/","file":"https://qianwendev.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available","secondaryLocation":"westus","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://qianwendev-secondary.dfs.core.windows.net/","web":"https://qianwendev-secondary.z13.web.core.windows.net/","blob":"https://qianwendev-secondary.blob.core.windows.net/","queue":"https://qianwendev-secondary.queue.core.windows.net/","table":"https://qianwendev-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qianwens/providers/Microsoft.Storage/storageAccounts/qianwenhpctarget","name":"qianwenhpctarget","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-06T07:09:20.3073299Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-06T07:09:20.3073299Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-03-06T07:09:20.2291899Z","primaryEndpoints":{"dfs":"https://qianwenhpctarget.dfs.core.windows.net/","web":"https://qianwenhpctarget.z13.web.core.windows.net/","blob":"https://qianwenhpctarget.blob.core.windows.net/","queue":"https://qianwenhpctarget.queue.core.windows.net/","table":"https://qianwenhpctarget.table.core.windows.net/","file":"https://qianwenhpctarget.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available","secondaryLocation":"westus","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://qianwenhpctarget-secondary.dfs.core.windows.net/","web":"https://qianwenhpctarget-secondary.z13.web.core.windows.net/","blob":"https://qianwenhpctarget-secondary.blob.core.windows.net/","queue":"https://qianwenhpctarget-secondary.queue.core.windows.net/","table":"https://qianwenhpctarget-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zhoxing-test/providers/Microsoft.Storage/storageAccounts/zhoxing","name":"zhoxing","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-15T08:53:45.4310180Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-15T08:53:45.4310180Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-15T08:53:45.3528671Z","primaryEndpoints":{"dfs":"https://zhoxing.dfs.core.windows.net/","web":"https://zhoxing.z13.web.core.windows.net/","blob":"https://zhoxing.blob.core.windows.net/","queue":"https://zhoxing.queue.core.windows.net/","table":"https://zhoxing.table.core.windows.net/","file":"https://zhoxing.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available","secondaryLocation":"westus","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://zhoxing-secondary.dfs.core.windows.net/","web":"https://zhoxing-secondary.z13.web.core.windows.net/","blob":"https://zhoxing-secondary.blob.core.windows.net/","queue":"https://zhoxing-secondary.queue.core.windows.net/","table":"https://zhoxing-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jlrg1/providers/Microsoft.Storage/storageAccounts/jlst","name":"jlst","type":"Microsoft.Storage/storageAccounts","location":"eastus2","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-14T12:05:01.5230050Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-14T12:05:01.5230050Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-14T12:05:01.4448881Z","primaryEndpoints":{"dfs":"https://jlst.dfs.core.windows.net/","web":"https://jlst.z20.web.core.windows.net/","blob":"https://jlst.blob.core.windows.net/","queue":"https://jlst.queue.core.windows.net/","table":"https://jlst.table.core.windows.net/","file":"https://jlst.file.core.windows.net/"},"primaryLocation":"eastus2","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jlrg1/providers/Microsoft.Storage/storageAccounts/tsiext","name":"tsiext","type":"Microsoft.Storage/storageAccounts","location":"eastus2","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-16T04:42:27.8695098Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-16T04:42:27.8695098Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-16T04:42:27.8070104Z","primaryEndpoints":{"dfs":"https://tsiext.dfs.core.windows.net/","web":"https://tsiext.z20.web.core.windows.net/","blob":"https://tsiext.blob.core.windows.net/","queue":"https://tsiext.queue.core.windows.net/","table":"https://tsiext.table.core.windows.net/","file":"https://tsiext.file.core.windows.net/"},"primaryLocation":"eastus2","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zhoxing-test/providers/Microsoft.Storage/storageAccounts/azhoxingtest9851","name":"azhoxingtest9851","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{"hidden-DevTestLabs-LabUId":"6e279161-d008-42b7-90a1-6801fc4bc4ca"},"properties":{"privateEndpointConnections":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zhoxing-test/providers/Microsoft.Storage/storageAccounts/azhoxingtest9851/privateEndpointConnections/azhoxingtest9851.6911cd49-cfc1-4bcf-887b-6941ff2b8756","name":"azhoxingtest9851.6911cd49-cfc1-4bcf-887b-6941ff2b8756","type":"Microsoft.Storage/storageAccounts/privateEndpointConnections","properties":{"provisioningState":"Succeeded","privateEndpoint":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zuhcentral/providers/Microsoft.Network/privateEndpoints/test"},"privateLinkServiceConnectionState":{"status":"Approved","description":"Auto-Approved","actionRequired":"None"}}}],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-21T05:43:15.2811036Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-21T05:43:15.2811036Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-02-21T05:43:15.2029670Z","primaryEndpoints":{"dfs":"https://azhoxingtest9851.dfs.core.windows.net/","web":"https://azhoxingtest9851.z22.web.core.windows.net/","blob":"https://azhoxingtest9851.blob.core.windows.net/","queue":"https://azhoxingtest9851.queue.core.windows.net/","table":"https://azhoxingtest9851.table.core.windows.net/","file":"https://azhoxingtest9851.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_databoxoe2qtcqlnxonqpub522jgmpzgeegwhowl2qo6xqgfwtqcd3jzicz5yraawi/providers/Microsoft.Storage/storageAccounts/clitest6yrafi3cntx2cngw3","name":"clitest6yrafi3cntx2cngw3","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-06T14:00:05.4412024Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-06T14:00:05.4412024Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-06T14:00:05.3786989Z","primaryEndpoints":{"blob":"https://clitest6yrafi3cntx2cngw3.blob.core.windows.net/","queue":"https://clitest6yrafi3cntx2cngw3.queue.core.windows.net/","table":"https://clitest6yrafi3cntx2cngw3.table.core.windows.net/","file":"https://clitest6yrafi3cntx2cngw3.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_databoxn5n2vkeyewiwob4e7e6nqiblkvvgc5qorevejhsntblvdlc2t373rrvy45p/providers/Microsoft.Storage/storageAccounts/clitest75g6r5uwkj7ker7wu","name":"clitest75g6r5uwkj7ker7wu","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T06:35:53.9029562Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T06:35:53.9029562Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-03T06:35:53.8248647Z","primaryEndpoints":{"blob":"https://clitest75g6r5uwkj7ker7wu.blob.core.windows.net/","queue":"https://clitest75g6r5uwkj7ker7wu.queue.core.windows.net/","table":"https://clitest75g6r5uwkj7ker7wu.table.core.windows.net/","file":"https://clitest75g6r5uwkj7ker7wu.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_databox5gpbe2knrizxsitmvje3fbdl44tf6cvpfqbpvsyicxmupsbyhmlcrg4wesk/providers/Microsoft.Storage/storageAccounts/clitest7b5n3o4aahl5rafju","name":"clitest7b5n3o4aahl5rafju","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T08:27:23.1140038Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T08:27:23.1140038Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-03T08:27:23.0514944Z","primaryEndpoints":{"blob":"https://clitest7b5n3o4aahl5rafju.blob.core.windows.net/","queue":"https://clitest7b5n3o4aahl5rafju.queue.core.windows.net/","table":"https://clitest7b5n3o4aahl5rafju.table.core.windows.net/","file":"https://clitest7b5n3o4aahl5rafju.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_databoxlekg7y4dtg2pnsaueisdkyqi5mnvmlwxto2cpu3kv7snll4uc37q2rm4wme/providers/Microsoft.Storage/storageAccounts/clitestcu3wv45lektdc3whs","name":"clitestcu3wv45lektdc3whs","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T08:35:04.7531702Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T08:35:04.7531702Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-03T08:35:04.6750427Z","primaryEndpoints":{"blob":"https://clitestcu3wv45lektdc3whs.blob.core.windows.net/","queue":"https://clitestcu3wv45lektdc3whs.queue.core.windows.net/","table":"https://clitestcu3wv45lektdc3whs.table.core.windows.net/","file":"https://clitestcu3wv45lektdc3whs.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_databoxeg3csudujzrh2zcvbjytg6gvlkp6sjfcozveffblaqhrzhsslvpr54lg7n2/providers/Microsoft.Storage/storageAccounts/clitestgdfhjpgc2wgbrddlq","name":"clitestgdfhjpgc2wgbrddlq","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T06:28:55.9105364Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T06:28:55.9105364Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-03T06:28:55.8480330Z","primaryEndpoints":{"blob":"https://clitestgdfhjpgc2wgbrddlq.blob.core.windows.net/","queue":"https://clitestgdfhjpgc2wgbrddlq.queue.core.windows.net/","table":"https://clitestgdfhjpgc2wgbrddlq.table.core.windows.net/","file":"https://clitestgdfhjpgc2wgbrddlq.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_databoxoe2qtcqlnxonqpub522jgmpzgeegwhowl2qo6xqgfwtqcd3jzicz5yraawi/providers/Microsoft.Storage/storageAccounts/clitestl6h6fa53d2gbmohn3","name":"clitestl6h6fa53d2gbmohn3","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-06T13:59:30.5816034Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-06T13:59:30.5816034Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-06T13:59:30.5034613Z","primaryEndpoints":{"blob":"https://clitestl6h6fa53d2gbmohn3.blob.core.windows.net/","queue":"https://clitestl6h6fa53d2gbmohn3.queue.core.windows.net/","table":"https://clitestl6h6fa53d2gbmohn3.table.core.windows.net/","file":"https://clitestl6h6fa53d2gbmohn3.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_databoxfgdxtb5b3moqarfyogd7fcognbrlsihjlj3acnscrixetycujoejzzalyi3/providers/Microsoft.Storage/storageAccounts/clitestldg5uo7ika27utek4","name":"clitestldg5uo7ika27utek4","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T08:59:48.7196866Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T08:59:48.7196866Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-03T08:59:48.6728325Z","primaryEndpoints":{"blob":"https://clitestldg5uo7ika27utek4.blob.core.windows.net/","queue":"https://clitestldg5uo7ika27utek4.queue.core.windows.net/","table":"https://clitestldg5uo7ika27utek4.table.core.windows.net/","file":"https://clitestldg5uo7ika27utek4.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_databox52yrfbe7molrqhwdubnr2jcijd22xsz3hgcg3btf3sza5boeklwgzzq5sfn/providers/Microsoft.Storage/storageAccounts/clitestm7nikx6sld4npo42d","name":"clitestm7nikx6sld4npo42d","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-06T14:20:54.5597796Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-06T14:20:54.5597796Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-06T14:20:54.4972558Z","primaryEndpoints":{"blob":"https://clitestm7nikx6sld4npo42d.blob.core.windows.net/","queue":"https://clitestm7nikx6sld4npo42d.queue.core.windows.net/","table":"https://clitestm7nikx6sld4npo42d.table.core.windows.net/","file":"https://clitestm7nikx6sld4npo42d.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_databoxrg2slunrj5vx5aydveu66wkj6rh3ildamkumi4zojpcf6f4vastgfp4v3rw/providers/Microsoft.Storage/storageAccounts/clitestmap7c2xyjf3gsd7yg","name":"clitestmap7c2xyjf3gsd7yg","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T09:10:56.7318732Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T09:10:56.7318732Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-03T09:10:56.6381622Z","primaryEndpoints":{"blob":"https://clitestmap7c2xyjf3gsd7yg.blob.core.windows.net/","queue":"https://clitestmap7c2xyjf3gsd7yg.queue.core.windows.net/","table":"https://clitestmap7c2xyjf3gsd7yg.table.core.windows.net/","file":"https://clitestmap7c2xyjf3gsd7yg.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_databoxu7woflo47pjem4rfw2djuvafywtfnprfpduospdfotkqkudaylsua3ybqpa/providers/Microsoft.Storage/storageAccounts/clitestnxsheqf5s5rcht46h","name":"clitestnxsheqf5s5rcht46h","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T06:40:27.7931436Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T06:40:27.7931436Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-03T06:40:27.7305929Z","primaryEndpoints":{"blob":"https://clitestnxsheqf5s5rcht46h.blob.core.windows.net/","queue":"https://clitestnxsheqf5s5rcht46h.queue.core.windows.net/","table":"https://clitestnxsheqf5s5rcht46h.table.core.windows.net/","file":"https://clitestnxsheqf5s5rcht46h.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_databox52yrfbe7molrqhwdubnr2jcijd22xsz3hgcg3btf3sza5boeklwgzzq5sfn/providers/Microsoft.Storage/storageAccounts/clitestqsel4b35pkfyubvyx","name":"clitestqsel4b35pkfyubvyx","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-06T14:20:08.8041709Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-06T14:20:08.8041709Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-06T14:20:08.7417121Z","primaryEndpoints":{"blob":"https://clitestqsel4b35pkfyubvyx.blob.core.windows.net/","queue":"https://clitestqsel4b35pkfyubvyx.queue.core.windows.net/","table":"https://clitestqsel4b35pkfyubvyx.table.core.windows.net/","file":"https://clitestqsel4b35pkfyubvyx.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_databoxam64dpcskfsb23dkj6zbvxysimh24e3upfdsdmuxbdl2j25ckz2uz5lht5y/providers/Microsoft.Storage/storageAccounts/clitesty2xsxbbcego73beie","name":"clitesty2xsxbbcego73beie","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T05:23:45.1933083Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T05:23:45.1933083Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-03T05:23:45.1308322Z","primaryEndpoints":{"blob":"https://clitesty2xsxbbcego73beie.blob.core.windows.net/","queue":"https://clitesty2xsxbbcego73beie.queue.core.windows.net/","table":"https://clitesty2xsxbbcego73beie.table.core.windows.net/","file":"https://clitesty2xsxbbcego73beie.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_GRS","tier":"Standard"},"kind":"BlobStorage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/databricks-rg-test-ws-udvur1v2scpdh/providers/Microsoft.Storage/storageAccounts/dbstorageazqiaxnzp45c4","name":"dbstorageazqiaxnzp45c4","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{"application":"databricks","databricks-environment":"true"},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-13T03:47:02.5418099Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-13T03:47:02.5418099Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-13T03:47:02.4793343Z","primaryEndpoints":{"dfs":"https://dbstorageazqiaxnzp45c4.dfs.core.windows.net/","blob":"https://dbstorageazqiaxnzp45c4.blob.core.windows.net/","table":"https://dbstorageazqiaxnzp45c4.table.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available","secondaryLocation":"eastus","statusOfSecondary":"available"}},{"sku":{"name":"Standard_GRS","tier":"Standard"},"kind":"BlobStorage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/databricks-rg-test-ws-1-tkfkantu2y5cn/providers/Microsoft.Storage/storageAccounts/dbstorageucp43z6irid74","name":"dbstorageucp43z6irid74","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{"application":"databricks","databricks-environment":"true"},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-13T04:56:17.5656641Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-13T04:56:17.5656641Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-13T04:56:17.4874850Z","primaryEndpoints":{"dfs":"https://dbstorageucp43z6irid74.dfs.core.windows.net/","blob":"https://dbstorageucp43z6irid74.blob.core.windows.net/","table":"https://dbstorageucp43z6irid74.table.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available","secondaryLocation":"eastus","statusOfSecondary":"available"}},{"sku":{"name":"Standard_GRS","tier":"Standard"},"kind":"BlobStorage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/databricks-rg-test-ws-2-eh7zug4x1inzs/providers/Microsoft.Storage/storageAccounts/dbstoragezkqasazvxxgmu","name":"dbstoragezkqasazvxxgmu","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{"application":"databricks","databricks-environment":"true"},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-13T05:06:37.5070495Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-13T05:06:37.5070495Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-13T05:06:37.4288942Z","primaryEndpoints":{"dfs":"https://dbstoragezkqasazvxxgmu.dfs.core.windows.net/","blob":"https://dbstoragezkqasazvxxgmu.blob.core.windows.net/","table":"https://dbstoragezkqasazvxxgmu.table.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available","secondaryLocation":"eastus","statusOfSecondary":"available"}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yu-test-rg-westus/providers/Microsoft.Storage/storageAccounts/yutestdbsawestus","name":"yutestdbsawestus","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-25T11:11:24.7554090Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-25T11:11:24.7554090Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-02-25T11:11:24.6772540Z","primaryEndpoints":{"dfs":"https://yutestdbsawestus.dfs.core.windows.net/","web":"https://yutestdbsawestus.z22.web.core.windows.net/","blob":"https://yutestdbsawestus.blob.core.windows.net/","queue":"https://yutestdbsawestus.queue.core.windows.net/","table":"https://yutestdbsawestus.table.core.windows.net/","file":"https://yutestdbsawestus.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available","secondaryLocation":"eastus","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://yutestdbsawestus-secondary.dfs.core.windows.net/","web":"https://yutestdbsawestus-secondary.z22.web.core.windows.net/","blob":"https://yutestdbsawestus-secondary.blob.core.windows.net/","queue":"https://yutestdbsawestus-secondary.queue.core.windows.net/","table":"https://yutestdbsawestus-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yu-test-rg-westus/providers/Microsoft.Storage/storageAccounts/yutestlro","name":"yutestlro","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-28T07:50:15.1386919Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-28T07:50:15.1386919Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-02-28T07:50:15.0762161Z","primaryEndpoints":{"blob":"https://yutestlro.blob.core.windows.net/","queue":"https://yutestlro.queue.core.windows.net/","table":"https://yutestlro.table.core.windows.net/","file":"https://yutestlro.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available","secondaryLocation":"eastus","statusOfSecondary":"available","secondaryEndpoints":{"blob":"https://yutestlro-secondary.blob.core.windows.net/","queue":"https://yutestlro-secondary.queue.core.windows.net/","table":"https://yutestlro-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_GRS","tier":"Standard"},"kind":"BlobStorage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/databricks-rg-my-standard-space-fez3hbt1bsvmr/providers/Microsoft.Storage/storageAccounts/dbstoragefez3hbt1bsvmr","name":"dbstoragefez3hbt1bsvmr","type":"Microsoft.Storage/storageAccounts","location":"eastasia","tags":{"application":"databricks","databricks-environment":"true"},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-16T03:14:00.7822307Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-16T03:14:00.7822307Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-03-16T03:14:00.7197710Z","primaryEndpoints":{"dfs":"https://dbstoragefez3hbt1bsvmr.dfs.core.windows.net/","blob":"https://dbstoragefez3hbt1bsvmr.blob.core.windows.net/","table":"https://dbstoragefez3hbt1bsvmr.table.core.windows.net/"},"primaryLocation":"eastasia","statusOfPrimary":"available","secondaryLocation":"southeastasia","statusOfSecondary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/feng-cli-rg/providers/Microsoft.Storage/storageAccounts/fengws1storage296335f3c7","name":"fengws1storage296335f3c7","type":"Microsoft.Storage/storageAccounts","location":"eastasia","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-14T14:41:02.2224956Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-14T14:41:02.2224956Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-02-14T14:41:02.1600089Z","primaryEndpoints":{"dfs":"https://fengws1storage296335f3c7.dfs.core.windows.net/","web":"https://fengws1storage296335f3c7.z7.web.core.windows.net/","blob":"https://fengws1storage296335f3c7.blob.core.windows.net/","queue":"https://fengws1storage296335f3c7.queue.core.windows.net/","table":"https://fengws1storage296335f3c7.table.core.windows.net/","file":"https://fengws1storage296335f3c7.file.core.windows.net/"},"primaryLocation":"eastasia","statusOfPrimary":"available"}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/xiaojianxu/providers/Microsoft.Storage/storageAccounts/xxjtest1","name":"xxjtest1","type":"Microsoft.Storage/storageAccounts","location":"eastasia","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-20T08:36:23.6918366Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-20T08:36:23.6918366Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-20T08:36:23.6293420Z","primaryEndpoints":{"dfs":"https://xxjtest1.dfs.core.windows.net/","web":"https://xxjtest1.z7.web.core.windows.net/","blob":"https://xxjtest1.blob.core.windows.net/","queue":"https://xxjtest1.queue.core.windows.net/","table":"https://xxjtest1.table.core.windows.net/","file":"https://xxjtest1.file.core.windows.net/"},"primaryLocation":"eastasia","statusOfPrimary":"available","secondaryLocation":"southeastasia","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://xxjtest1-secondary.dfs.core.windows.net/","web":"https://xxjtest1-secondary.z7.web.core.windows.net/","blob":"https://xxjtest1-secondary.blob.core.windows.net/","queue":"https://xxjtest1-secondary.queue.core.windows.net/","table":"https://xxjtest1-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg6i4hl6iakg/providers/Microsoft.Storage/storageAccounts/clitestu3p7a7ib4n4y7gt4m","name":"clitestu3p7a7ib4n4y7gt4m","type":"Microsoft.Storage/storageAccounts","location":"southeastasia","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-12-30T01:51:53.0814418Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-12-30T01:51:53.0814418Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2019-12-30T01:51:53.0189478Z","primaryEndpoints":{"blob":"https://clitestu3p7a7ib4n4y7gt4m.blob.core.windows.net/","queue":"https://clitestu3p7a7ib4n4y7gt4m.queue.core.windows.net/","table":"https://clitestu3p7a7ib4n4y7gt4m.table.core.windows.net/","file":"https://clitestu3p7a7ib4n4y7gt4m.file.core.windows.net/"},"primaryLocation":"southeastasia","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jlrg1/providers/Microsoft.Storage/storageAccounts/jlcsst","name":"jlcsst","type":"Microsoft.Storage/storageAccounts","location":"southeastasia","tags":{"ms-resource-usage":"azure-cloud-shell"},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-02T07:15:45.8047726Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-02T07:15:45.8047726Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-03-02T07:15:45.7422455Z","primaryEndpoints":{"dfs":"https://jlcsst.dfs.core.windows.net/","web":"https://jlcsst.z23.web.core.windows.net/","blob":"https://jlcsst.blob.core.windows.net/","queue":"https://jlcsst.queue.core.windows.net/","table":"https://jlcsst.table.core.windows.net/","file":"https://jlcsst.file.core.windows.net/"},"primaryLocation":"southeastasia","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/jlvm2rg/providers/Microsoft.Storage/storageAccounts/jlvm2rgdiag","name":"jlvm2rgdiag","type":"Microsoft.Storage/storageAccounts","location":"southeastasia","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T04:41:48.6974827Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T04:41:48.6974827Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-03T04:41:48.6505931Z","primaryEndpoints":{"blob":"https://jlvm2rgdiag.blob.core.windows.net/","queue":"https://jlvm2rgdiag.queue.core.windows.net/","table":"https://jlvm2rgdiag.table.core.windows.net/","file":"https://jlvm2rgdiag.file.core.windows.net/"},"primaryLocation":"southeastasia","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qianwens/providers/Microsoft.Storage/storageAccounts/qianwensdiag","name":"qianwensdiag","type":"Microsoft.Storage/storageAccounts","location":"southeastasia","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-04T07:17:09.1138103Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-04T07:17:09.1138103Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-02-04T07:17:09.0514178Z","primaryEndpoints":{"blob":"https://qianwensdiag.blob.core.windows.net/","queue":"https://qianwensdiag.queue.core.windows.net/","table":"https://qianwensdiag.table.core.windows.net/","file":"https://qianwensdiag.file.core.windows.net/"},"primaryLocation":"southeastasia","statusOfPrimary":"available"}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yeming/providers/Microsoft.Storage/storageAccounts/yeming","name":"yeming","type":"Microsoft.Storage/storageAccounts","location":"southeastasia","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-12-04T06:41:07.4012554Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-12-04T06:41:07.4012554Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-12-04T06:41:07.3699884Z","primaryEndpoints":{"dfs":"https://yeming.dfs.core.windows.net/","web":"https://yeming.z23.web.core.windows.net/","blob":"https://yeming.blob.core.windows.net/","queue":"https://yeming.queue.core.windows.net/","table":"https://yeming.table.core.windows.net/","file":"https://yeming.file.core.windows.net/"},"primaryLocation":"southeastasia","statusOfPrimary":"available","secondaryLocation":"eastasia","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://yeming-secondary.dfs.core.windows.net/","web":"https://yeming-secondary.z23.web.core.windows.net/","blob":"https://yeming-secondary.blob.core.windows.net/","queue":"https://yeming-secondary.queue.core.windows.net/","table":"https://yeming-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/bim-rg/providers/Microsoft.Storage/storageAccounts/bimrgdiag","name":"bimrgdiag","type":"Microsoft.Storage/storageAccounts","location":"japaneast","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-12T15:04:32.1018377Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-12T15:04:32.1018377Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-02-12T15:04:32.0706109Z","primaryEndpoints":{"blob":"https://bimrgdiag.blob.core.windows.net/","queue":"https://bimrgdiag.queue.core.windows.net/","table":"https://bimrgdiag.table.core.windows.net/","file":"https://bimrgdiag.file.core.windows.net/"},"primaryLocation":"japaneast","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/feng-cli-rg/providers/Microsoft.Storage/storageAccounts/fengclirgdiag","name":"fengclirgdiag","type":"Microsoft.Storage/storageAccounts","location":"japaneast","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-01T07:10:20.0599535Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-01T07:10:20.0599535Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-01T07:10:19.9974827Z","primaryEndpoints":{"blob":"https://fengclirgdiag.blob.core.windows.net/","queue":"https://fengclirgdiag.queue.core.windows.net/","table":"https://fengclirgdiag.table.core.windows.net/","file":"https://fengclirgdiag.file.core.windows.net/"},"primaryLocation":"japaneast","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zhoxing-test/providers/Microsoft.Storage/storageAccounts/store6472qnxl3vv5o","name":"store6472qnxl3vv5o","type":"Microsoft.Storage/storageAccounts","location":"southcentralus","tags":{"project":"Digital + Platform","env":"CI"},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-27T08:24:34.7235260Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-27T08:24:34.7235260Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-02-27T08:24:34.6453999Z","primaryEndpoints":{"blob":"https://store6472qnxl3vv5o.blob.core.windows.net/","queue":"https://store6472qnxl3vv5o.queue.core.windows.net/","table":"https://store6472qnxl3vv5o.table.core.windows.net/","file":"https://store6472qnxl3vv5o.file.core.windows.net/"},"primaryLocation":"southcentralus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/feng-cli-rg/providers/Microsoft.Storage/storageAccounts/extmigrate","name":"extmigrate","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-16T08:26:10.6796218Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-16T08:26:10.6796218Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-16T08:26:10.5858998Z","primaryEndpoints":{"blob":"https://extmigrate.blob.core.windows.net/","queue":"https://extmigrate.queue.core.windows.net/","table":"https://extmigrate.table.core.windows.net/","file":"https://extmigrate.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"blob":"https://extmigrate-secondary.blob.core.windows.net/","queue":"https://extmigrate-secondary.queue.core.windows.net/","table":"https://extmigrate-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/feng-cli-rg/providers/Microsoft.Storage/storageAccounts/fengsa","name":"fengsa","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-01-06T04:33:22.9379802Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-01-06T04:33:22.9379802Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-01-06T04:33:22.8754625Z","primaryEndpoints":{"dfs":"https://fengsa.dfs.core.windows.net/","web":"https://fengsa.z19.web.core.windows.net/","blob":"https://fengsa.blob.core.windows.net/","queue":"https://fengsa.queue.core.windows.net/","table":"https://fengsa.table.core.windows.net/","file":"https://fengsa.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://fengsa-secondary.dfs.core.windows.net/","web":"https://fengsa-secondary.z19.web.core.windows.net/","blob":"https://fengsa-secondary.blob.core.windows.net/","queue":"https://fengsa-secondary.queue.core.windows.net/","table":"https://fengsa-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zhoxing-test/providers/Microsoft.Storage/storageAccounts/idgdiag6472qnxl3vv5o","name":"idgdiag6472qnxl3vv5o","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-03T08:53:11.2645207Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-03T08:53:11.2645207Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-03T08:53:11.1707355Z","primaryEndpoints":{"dfs":"https://idgdiag6472qnxl3vv5o.dfs.core.windows.net/","web":"https://idgdiag6472qnxl3vv5o.z19.web.core.windows.net/","blob":"https://idgdiag6472qnxl3vv5o.blob.core.windows.net/","queue":"https://idgdiag6472qnxl3vv5o.queue.core.windows.net/","table":"https://idgdiag6472qnxl3vv5o.table.core.windows.net/","file":"https://idgdiag6472qnxl3vv5o.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zhoxing-test/providers/Microsoft.Storage/storageAccounts/storageaccountzhoxib2a8","name":"storageaccountzhoxib2a8","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-25T06:54:03.9825980Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-25T06:54:03.9825980Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-02-25T06:54:03.9044955Z","primaryEndpoints":{"blob":"https://storageaccountzhoxib2a8.blob.core.windows.net/","queue":"https://storageaccountzhoxib2a8.queue.core.windows.net/","table":"https://storageaccountzhoxib2a8.table.core.windows.net/","file":"https://storageaccountzhoxib2a8.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro1","name":"storagesfrepro1","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:07:42.2058942Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:07:42.2058942Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:07:42.1277444Z","primaryEndpoints":{"dfs":"https://storagesfrepro1.dfs.core.windows.net/","web":"https://storagesfrepro1.z19.web.core.windows.net/","blob":"https://storagesfrepro1.blob.core.windows.net/","queue":"https://storagesfrepro1.queue.core.windows.net/","table":"https://storagesfrepro1.table.core.windows.net/","file":"https://storagesfrepro1.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro1-secondary.dfs.core.windows.net/","web":"https://storagesfrepro1-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro1-secondary.blob.core.windows.net/","queue":"https://storagesfrepro1-secondary.queue.core.windows.net/","table":"https://storagesfrepro1-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro10","name":"storagesfrepro10","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:14:00.8753334Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:14:00.8753334Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:14:00.7815921Z","primaryEndpoints":{"dfs":"https://storagesfrepro10.dfs.core.windows.net/","web":"https://storagesfrepro10.z19.web.core.windows.net/","blob":"https://storagesfrepro10.blob.core.windows.net/","queue":"https://storagesfrepro10.queue.core.windows.net/","table":"https://storagesfrepro10.table.core.windows.net/","file":"https://storagesfrepro10.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro10-secondary.dfs.core.windows.net/","web":"https://storagesfrepro10-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro10-secondary.blob.core.windows.net/","queue":"https://storagesfrepro10-secondary.queue.core.windows.net/","table":"https://storagesfrepro10-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro11","name":"storagesfrepro11","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:14:28.9859417Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:14:28.9859417Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:14:28.8609347Z","primaryEndpoints":{"dfs":"https://storagesfrepro11.dfs.core.windows.net/","web":"https://storagesfrepro11.z19.web.core.windows.net/","blob":"https://storagesfrepro11.blob.core.windows.net/","queue":"https://storagesfrepro11.queue.core.windows.net/","table":"https://storagesfrepro11.table.core.windows.net/","file":"https://storagesfrepro11.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro11-secondary.dfs.core.windows.net/","web":"https://storagesfrepro11-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro11-secondary.blob.core.windows.net/","queue":"https://storagesfrepro11-secondary.queue.core.windows.net/","table":"https://storagesfrepro11-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro12","name":"storagesfrepro12","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:15:15.6785362Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:15:15.6785362Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:15:15.5848345Z","primaryEndpoints":{"dfs":"https://storagesfrepro12.dfs.core.windows.net/","web":"https://storagesfrepro12.z19.web.core.windows.net/","blob":"https://storagesfrepro12.blob.core.windows.net/","queue":"https://storagesfrepro12.queue.core.windows.net/","table":"https://storagesfrepro12.table.core.windows.net/","file":"https://storagesfrepro12.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro12-secondary.dfs.core.windows.net/","web":"https://storagesfrepro12-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro12-secondary.blob.core.windows.net/","queue":"https://storagesfrepro12-secondary.queue.core.windows.net/","table":"https://storagesfrepro12-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro13","name":"storagesfrepro13","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:16:55.7609361Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:16:55.7609361Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:16:55.6671828Z","primaryEndpoints":{"dfs":"https://storagesfrepro13.dfs.core.windows.net/","web":"https://storagesfrepro13.z19.web.core.windows.net/","blob":"https://storagesfrepro13.blob.core.windows.net/","queue":"https://storagesfrepro13.queue.core.windows.net/","table":"https://storagesfrepro13.table.core.windows.net/","file":"https://storagesfrepro13.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro13-secondary.dfs.core.windows.net/","web":"https://storagesfrepro13-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro13-secondary.blob.core.windows.net/","queue":"https://storagesfrepro13-secondary.queue.core.windows.net/","table":"https://storagesfrepro13-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro14","name":"storagesfrepro14","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:17:40.7661469Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:17:40.7661469Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:17:40.6880204Z","primaryEndpoints":{"dfs":"https://storagesfrepro14.dfs.core.windows.net/","web":"https://storagesfrepro14.z19.web.core.windows.net/","blob":"https://storagesfrepro14.blob.core.windows.net/","queue":"https://storagesfrepro14.queue.core.windows.net/","table":"https://storagesfrepro14.table.core.windows.net/","file":"https://storagesfrepro14.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro14-secondary.dfs.core.windows.net/","web":"https://storagesfrepro14-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro14-secondary.blob.core.windows.net/","queue":"https://storagesfrepro14-secondary.queue.core.windows.net/","table":"https://storagesfrepro14-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro15","name":"storagesfrepro15","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:18:52.1812445Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:18:52.1812445Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:18:52.0718543Z","primaryEndpoints":{"dfs":"https://storagesfrepro15.dfs.core.windows.net/","web":"https://storagesfrepro15.z19.web.core.windows.net/","blob":"https://storagesfrepro15.blob.core.windows.net/","queue":"https://storagesfrepro15.queue.core.windows.net/","table":"https://storagesfrepro15.table.core.windows.net/","file":"https://storagesfrepro15.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro15-secondary.dfs.core.windows.net/","web":"https://storagesfrepro15-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro15-secondary.blob.core.windows.net/","queue":"https://storagesfrepro15-secondary.queue.core.windows.net/","table":"https://storagesfrepro15-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro16","name":"storagesfrepro16","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:19:33.1863807Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:19:33.1863807Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:19:33.0770034Z","primaryEndpoints":{"dfs":"https://storagesfrepro16.dfs.core.windows.net/","web":"https://storagesfrepro16.z19.web.core.windows.net/","blob":"https://storagesfrepro16.blob.core.windows.net/","queue":"https://storagesfrepro16.queue.core.windows.net/","table":"https://storagesfrepro16.table.core.windows.net/","file":"https://storagesfrepro16.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro16-secondary.dfs.core.windows.net/","web":"https://storagesfrepro16-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro16-secondary.blob.core.windows.net/","queue":"https://storagesfrepro16-secondary.queue.core.windows.net/","table":"https://storagesfrepro16-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro17","name":"storagesfrepro17","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:04:23.5553513Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:04:23.5553513Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T05:04:23.4771469Z","primaryEndpoints":{"dfs":"https://storagesfrepro17.dfs.core.windows.net/","web":"https://storagesfrepro17.z19.web.core.windows.net/","blob":"https://storagesfrepro17.blob.core.windows.net/","queue":"https://storagesfrepro17.queue.core.windows.net/","table":"https://storagesfrepro17.table.core.windows.net/","file":"https://storagesfrepro17.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro17-secondary.dfs.core.windows.net/","web":"https://storagesfrepro17-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro17-secondary.blob.core.windows.net/","queue":"https://storagesfrepro17-secondary.queue.core.windows.net/","table":"https://storagesfrepro17-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro18","name":"storagesfrepro18","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:04:53.8320772Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:04:53.8320772Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T05:04:53.7383176Z","primaryEndpoints":{"dfs":"https://storagesfrepro18.dfs.core.windows.net/","web":"https://storagesfrepro18.z19.web.core.windows.net/","blob":"https://storagesfrepro18.blob.core.windows.net/","queue":"https://storagesfrepro18.queue.core.windows.net/","table":"https://storagesfrepro18.table.core.windows.net/","file":"https://storagesfrepro18.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro18-secondary.dfs.core.windows.net/","web":"https://storagesfrepro18-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro18-secondary.blob.core.windows.net/","queue":"https://storagesfrepro18-secondary.queue.core.windows.net/","table":"https://storagesfrepro18-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro19","name":"storagesfrepro19","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:05:26.3650238Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:05:26.3650238Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T05:05:26.2556326Z","primaryEndpoints":{"dfs":"https://storagesfrepro19.dfs.core.windows.net/","web":"https://storagesfrepro19.z19.web.core.windows.net/","blob":"https://storagesfrepro19.blob.core.windows.net/","queue":"https://storagesfrepro19.queue.core.windows.net/","table":"https://storagesfrepro19.table.core.windows.net/","file":"https://storagesfrepro19.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro19-secondary.dfs.core.windows.net/","web":"https://storagesfrepro19-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro19-secondary.blob.core.windows.net/","queue":"https://storagesfrepro19-secondary.queue.core.windows.net/","table":"https://storagesfrepro19-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro2","name":"storagesfrepro2","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:08:45.8498203Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:08:45.8498203Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:08:45.7717196Z","primaryEndpoints":{"dfs":"https://storagesfrepro2.dfs.core.windows.net/","web":"https://storagesfrepro2.z19.web.core.windows.net/","blob":"https://storagesfrepro2.blob.core.windows.net/","queue":"https://storagesfrepro2.queue.core.windows.net/","table":"https://storagesfrepro2.table.core.windows.net/","file":"https://storagesfrepro2.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro2-secondary.dfs.core.windows.net/","web":"https://storagesfrepro2-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro2-secondary.blob.core.windows.net/","queue":"https://storagesfrepro2-secondary.queue.core.windows.net/","table":"https://storagesfrepro2-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro20","name":"storagesfrepro20","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:06:07.4295934Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:06:07.4295934Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T05:06:07.3358422Z","primaryEndpoints":{"dfs":"https://storagesfrepro20.dfs.core.windows.net/","web":"https://storagesfrepro20.z19.web.core.windows.net/","blob":"https://storagesfrepro20.blob.core.windows.net/","queue":"https://storagesfrepro20.queue.core.windows.net/","table":"https://storagesfrepro20.table.core.windows.net/","file":"https://storagesfrepro20.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro20-secondary.dfs.core.windows.net/","web":"https://storagesfrepro20-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro20-secondary.blob.core.windows.net/","queue":"https://storagesfrepro20-secondary.queue.core.windows.net/","table":"https://storagesfrepro20-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro21","name":"storagesfrepro21","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:06:37.4780251Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:06:37.4780251Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T05:06:37.3686460Z","primaryEndpoints":{"dfs":"https://storagesfrepro21.dfs.core.windows.net/","web":"https://storagesfrepro21.z19.web.core.windows.net/","blob":"https://storagesfrepro21.blob.core.windows.net/","queue":"https://storagesfrepro21.queue.core.windows.net/","table":"https://storagesfrepro21.table.core.windows.net/","file":"https://storagesfrepro21.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro21-secondary.dfs.core.windows.net/","web":"https://storagesfrepro21-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro21-secondary.blob.core.windows.net/","queue":"https://storagesfrepro21-secondary.queue.core.windows.net/","table":"https://storagesfrepro21-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro22","name":"storagesfrepro22","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:06:59.8295391Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:06:59.8295391Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T05:06:59.7201581Z","primaryEndpoints":{"dfs":"https://storagesfrepro22.dfs.core.windows.net/","web":"https://storagesfrepro22.z19.web.core.windows.net/","blob":"https://storagesfrepro22.blob.core.windows.net/","queue":"https://storagesfrepro22.queue.core.windows.net/","table":"https://storagesfrepro22.table.core.windows.net/","file":"https://storagesfrepro22.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro22-secondary.dfs.core.windows.net/","web":"https://storagesfrepro22-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro22-secondary.blob.core.windows.net/","queue":"https://storagesfrepro22-secondary.queue.core.windows.net/","table":"https://storagesfrepro22-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro23","name":"storagesfrepro23","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:07:29.0846619Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:07:29.0846619Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T05:07:29.0065050Z","primaryEndpoints":{"dfs":"https://storagesfrepro23.dfs.core.windows.net/","web":"https://storagesfrepro23.z19.web.core.windows.net/","blob":"https://storagesfrepro23.blob.core.windows.net/","queue":"https://storagesfrepro23.queue.core.windows.net/","table":"https://storagesfrepro23.table.core.windows.net/","file":"https://storagesfrepro23.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro23-secondary.dfs.core.windows.net/","web":"https://storagesfrepro23-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro23-secondary.blob.core.windows.net/","queue":"https://storagesfrepro23-secondary.queue.core.windows.net/","table":"https://storagesfrepro23-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro24","name":"storagesfrepro24","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:07:53.2658712Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:07:53.2658712Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T05:07:53.1565651Z","primaryEndpoints":{"dfs":"https://storagesfrepro24.dfs.core.windows.net/","web":"https://storagesfrepro24.z19.web.core.windows.net/","blob":"https://storagesfrepro24.blob.core.windows.net/","queue":"https://storagesfrepro24.queue.core.windows.net/","table":"https://storagesfrepro24.table.core.windows.net/","file":"https://storagesfrepro24.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro24-secondary.dfs.core.windows.net/","web":"https://storagesfrepro24-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro24-secondary.blob.core.windows.net/","queue":"https://storagesfrepro24-secondary.queue.core.windows.net/","table":"https://storagesfrepro24-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro25","name":"storagesfrepro25","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:08:18.7432319Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T05:08:18.7432319Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T05:08:18.6338258Z","primaryEndpoints":{"dfs":"https://storagesfrepro25.dfs.core.windows.net/","web":"https://storagesfrepro25.z19.web.core.windows.net/","blob":"https://storagesfrepro25.blob.core.windows.net/","queue":"https://storagesfrepro25.queue.core.windows.net/","table":"https://storagesfrepro25.table.core.windows.net/","file":"https://storagesfrepro25.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro25-secondary.dfs.core.windows.net/","web":"https://storagesfrepro25-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro25-secondary.blob.core.windows.net/","queue":"https://storagesfrepro25-secondary.queue.core.windows.net/","table":"https://storagesfrepro25-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro3","name":"storagesfrepro3","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:09:19.5698333Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:09:19.5698333Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:09:19.3510997Z","primaryEndpoints":{"dfs":"https://storagesfrepro3.dfs.core.windows.net/","web":"https://storagesfrepro3.z19.web.core.windows.net/","blob":"https://storagesfrepro3.blob.core.windows.net/","queue":"https://storagesfrepro3.queue.core.windows.net/","table":"https://storagesfrepro3.table.core.windows.net/","file":"https://storagesfrepro3.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro3-secondary.dfs.core.windows.net/","web":"https://storagesfrepro3-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro3-secondary.blob.core.windows.net/","queue":"https://storagesfrepro3-secondary.queue.core.windows.net/","table":"https://storagesfrepro3-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro4","name":"storagesfrepro4","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:09:54.9930953Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:09:54.9930953Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:09:54.8993063Z","primaryEndpoints":{"dfs":"https://storagesfrepro4.dfs.core.windows.net/","web":"https://storagesfrepro4.z19.web.core.windows.net/","blob":"https://storagesfrepro4.blob.core.windows.net/","queue":"https://storagesfrepro4.queue.core.windows.net/","table":"https://storagesfrepro4.table.core.windows.net/","file":"https://storagesfrepro4.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro4-secondary.dfs.core.windows.net/","web":"https://storagesfrepro4-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro4-secondary.blob.core.windows.net/","queue":"https://storagesfrepro4-secondary.queue.core.windows.net/","table":"https://storagesfrepro4-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro5","name":"storagesfrepro5","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:10:48.1114395Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:10:48.1114395Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:10:48.0177273Z","primaryEndpoints":{"dfs":"https://storagesfrepro5.dfs.core.windows.net/","web":"https://storagesfrepro5.z19.web.core.windows.net/","blob":"https://storagesfrepro5.blob.core.windows.net/","queue":"https://storagesfrepro5.queue.core.windows.net/","table":"https://storagesfrepro5.table.core.windows.net/","file":"https://storagesfrepro5.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro5-secondary.dfs.core.windows.net/","web":"https://storagesfrepro5-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro5-secondary.blob.core.windows.net/","queue":"https://storagesfrepro5-secondary.queue.core.windows.net/","table":"https://storagesfrepro5-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro6","name":"storagesfrepro6","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:11:28.0269117Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:11:28.0269117Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:11:27.9331594Z","primaryEndpoints":{"dfs":"https://storagesfrepro6.dfs.core.windows.net/","web":"https://storagesfrepro6.z19.web.core.windows.net/","blob":"https://storagesfrepro6.blob.core.windows.net/","queue":"https://storagesfrepro6.queue.core.windows.net/","table":"https://storagesfrepro6.table.core.windows.net/","file":"https://storagesfrepro6.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro6-secondary.dfs.core.windows.net/","web":"https://storagesfrepro6-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro6-secondary.blob.core.windows.net/","queue":"https://storagesfrepro6-secondary.queue.core.windows.net/","table":"https://storagesfrepro6-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro7","name":"storagesfrepro7","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:12:08.7761892Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:12:08.7761892Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:12:08.6824637Z","primaryEndpoints":{"dfs":"https://storagesfrepro7.dfs.core.windows.net/","web":"https://storagesfrepro7.z19.web.core.windows.net/","blob":"https://storagesfrepro7.blob.core.windows.net/","queue":"https://storagesfrepro7.queue.core.windows.net/","table":"https://storagesfrepro7.table.core.windows.net/","file":"https://storagesfrepro7.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro7-secondary.dfs.core.windows.net/","web":"https://storagesfrepro7-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro7-secondary.blob.core.windows.net/","queue":"https://storagesfrepro7-secondary.queue.core.windows.net/","table":"https://storagesfrepro7-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro8","name":"storagesfrepro8","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:12:39.5221164Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:12:39.5221164Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:12:39.4283923Z","primaryEndpoints":{"dfs":"https://storagesfrepro8.dfs.core.windows.net/","web":"https://storagesfrepro8.z19.web.core.windows.net/","blob":"https://storagesfrepro8.blob.core.windows.net/","queue":"https://storagesfrepro8.queue.core.windows.net/","table":"https://storagesfrepro8.table.core.windows.net/","file":"https://storagesfrepro8.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro8-secondary.dfs.core.windows.net/","web":"https://storagesfrepro8-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro8-secondary.blob.core.windows.net/","queue":"https://storagesfrepro8-secondary.queue.core.windows.net/","table":"https://storagesfrepro8-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/storage-v2rt-repro/providers/Microsoft.Storage/storageAccounts/storagesfrepro9","name":"storagesfrepro9","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:13:18.1628430Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2019-02-26T04:13:18.1628430Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2019-02-26T04:13:18.0691096Z","primaryEndpoints":{"dfs":"https://storagesfrepro9.dfs.core.windows.net/","web":"https://storagesfrepro9.z19.web.core.windows.net/","blob":"https://storagesfrepro9.blob.core.windows.net/","queue":"https://storagesfrepro9.queue.core.windows.net/","table":"https://storagesfrepro9.table.core.windows.net/","file":"https://storagesfrepro9.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagesfrepro9-secondary.dfs.core.windows.net/","web":"https://storagesfrepro9-secondary.z19.web.core.windows.net/","blob":"https://storagesfrepro9-secondary.blob.core.windows.net/","queue":"https://storagesfrepro9-secondary.queue.core.windows.net/","table":"https://storagesfrepro9-secondary.table.core.windows.net/"}}},{"sku":{"name":"Premium_LRS","tier":"Premium"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zhoxing-test/providers/Microsoft.Storage/storageAccounts/zhoxing2","name":"zhoxing2","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-21T06:54:17.8037418Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-21T06:54:17.8037418Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-21T06:54:17.7099423Z","primaryEndpoints":{"dfs":"https://zhoxing2.dfs.core.windows.net/","web":"https://zhoxing2.z19.web.core.windows.net/","blob":"https://zhoxing2.blob.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zhoxing-test/providers/Microsoft.Storage/storageAccounts/zhoxingtest","name":"zhoxingtest","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"isHnsEnabled":true,"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-20T09:01:14.2087269Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-20T09:01:14.2087269Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-20T09:01:14.1462280Z","primaryEndpoints":{"dfs":"https://zhoxingtest.dfs.core.windows.net/","web":"https://zhoxingtest.z19.web.core.windows.net/","blob":"https://zhoxingtest.blob.core.windows.net/","queue":"https://zhoxingtest.queue.core.windows.net/","table":"https://zhoxingtest.table.core.windows.net/","file":"https://zhoxingtest.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://zhoxingtest-secondary.dfs.core.windows.net/","web":"https://zhoxingtest-secondary.z19.web.core.windows.net/","blob":"https://zhoxingtest-secondary.blob.core.windows.net/","queue":"https://zhoxingtest-secondary.queue.core.windows.net/","table":"https://zhoxingtest-secondary.table.core.windows.net/"}}},{"sku":{"name":"Premium_LRS","tier":"Premium"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zhoxing-test/providers/Microsoft.Storage/storageAccounts/zhoxingtest2","name":"zhoxingtest2","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-21T06:52:39.2007383Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-21T06:52:39.2007383Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-21T06:52:39.1039700Z","primaryEndpoints":{"dfs":"https://zhoxingtest2.dfs.core.windows.net/","web":"https://zhoxingtest2.z19.web.core.windows.net/","blob":"https://zhoxingtest2.blob.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zuhcentral/providers/Microsoft.Storage/storageAccounts/zuhstorage","name":"zuhstorage","type":"Microsoft.Storage/storageAccounts","location":"centralus","tags":{"key":"val","key2":"val2"},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-02T06:04:55.7104787Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-02T06:04:55.7104787Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-03-02T06:04:55.6167450Z","primaryEndpoints":{"dfs":"https://zuhstorage.dfs.core.windows.net/","web":"https://zuhstorage.z19.web.core.windows.net/","blob":"https://zuhstorage.blob.core.windows.net/","queue":"https://zuhstorage.queue.core.windows.net/","table":"https://zuhstorage.table.core.windows.net/","file":"https://zuhstorage.file.core.windows.net/"},"primaryLocation":"centralus","statusOfPrimary":"available","secondaryLocation":"eastus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://zuhstorage-secondary.dfs.core.windows.net/","web":"https://zuhstorage-secondary.z19.web.core.windows.net/","blob":"https://zuhstorage-secondary.blob.core.windows.net/","queue":"https://zuhstorage-secondary.queue.core.windows.net/","table":"https://zuhstorage-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.Storage/storageAccounts/clitestdatas000002","name":"clitestdatas000002","type":"Microsoft.Storage/storageAccounts","location":"westus2","tags":{},"properties":{"privateEndpointConnections":[],"isHnsEnabled":false,"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-23T13:41:53.6606746Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-23T13:41:53.6606746Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-04-23T13:41:53.5981225Z","primaryEndpoints":{"blob":"https://clitestdatas000002.blob.core.windows.net/","queue":"https://clitestdatas000002.queue.core.windows.net/","table":"https://clitestdatas000002.table.core.windows.net/","file":"https://clitestdatas000002.file.core.windows.net/"},"primaryLocation":"westus2","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_datwup7nhvv2zbeog5cowmt74wcgwnrm6i5z2ss6dyqwfzen4jh3hjpyl2hwz5ynxy/providers/Microsoft.Storage/storageAccounts/clitestdatasmezc7dtd565a","name":"clitestdatasmezc7dtd565a","type":"Microsoft.Storage/storageAccounts","location":"westus2","tags":{},"properties":{"privateEndpointConnections":[],"isHnsEnabled":false,"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-23T13:14:14.9779346Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-23T13:14:14.9779346Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-04-23T13:14:14.8998336Z","primaryEndpoints":{"blob":"https://clitestdatasmezc7dtd565a.blob.core.windows.net/","queue":"https://clitestdatasmezc7dtd565a.queue.core.windows.net/","table":"https://clitestdatasmezc7dtd565a.table.core.windows.net/","file":"https://clitestdatasmezc7dtd565a.file.core.windows.net/"},"primaryLocation":"westus2","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/feng-cli-rg/providers/Microsoft.Storage/storageAccounts/fengwsstorage28dfde17cb1","name":"fengwsstorage28dfde17cb1","type":"Microsoft.Storage/storageAccounts","location":"westus2","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-07T04:11:42.2482670Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-07T04:11:42.2482670Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-02-07T04:11:42.1857797Z","primaryEndpoints":{"dfs":"https://fengwsstorage28dfde17cb1.dfs.core.windows.net/","web":"https://fengwsstorage28dfde17cb1.z5.web.core.windows.net/","blob":"https://fengwsstorage28dfde17cb1.blob.core.windows.net/","queue":"https://fengwsstorage28dfde17cb1.queue.core.windows.net/","table":"https://fengwsstorage28dfde17cb1.table.core.windows.net/","file":"https://fengwsstorage28dfde17cb1.file.core.windows.net/"},"primaryLocation":"westus2","statusOfPrimary":"available"}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/xiaojianxu/providers/Microsoft.Storage/storageAccounts/xxjwetus2storage","name":"xxjwetus2storage","type":"Microsoft.Storage/storageAccounts","location":"westus2","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-30T06:26:54.2163538Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-30T06:26:54.2163538Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-03-30T06:26:54.1538919Z","primaryEndpoints":{"dfs":"https://xxjwetus2storage.dfs.core.windows.net/","web":"https://xxjwetus2storage.z5.web.core.windows.net/","blob":"https://xxjwetus2storage.blob.core.windows.net/","queue":"https://xxjwetus2storage.queue.core.windows.net/","table":"https://xxjwetus2storage.table.core.windows.net/","file":"https://xxjwetus2storage.file.core.windows.net/"},"primaryLocation":"westus2","statusOfPrimary":"available","secondaryLocation":"westcentralus","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://xxjwetus2storage-secondary.dfs.core.windows.net/","web":"https://xxjwetus2storage-secondary.z5.web.core.windows.net/","blob":"https://xxjwetus2storage-secondary.blob.core.windows.net/","queue":"https://xxjwetus2storage-secondary.queue.core.windows.net/","table":"https://xxjwetus2storage-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/bim-rg/providers/Microsoft.Storage/storageAccounts/bimstorageacc","name":"bimstorageacc","type":"Microsoft.Storage/storageAccounts","location":"westcentralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T07:20:55.2327590Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-03T07:20:55.2327590Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-03-03T07:20:55.1858389Z","primaryEndpoints":{"dfs":"https://bimstorageacc.dfs.core.windows.net/","web":"https://bimstorageacc.z4.web.core.windows.net/","blob":"https://bimstorageacc.blob.core.windows.net/","queue":"https://bimstorageacc.queue.core.windows.net/","table":"https://bimstorageacc.table.core.windows.net/","file":"https://bimstorageacc.file.core.windows.net/"},"primaryLocation":"westcentralus","statusOfPrimary":"available","secondaryLocation":"westus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://bimstorageacc-secondary.dfs.core.windows.net/","web":"https://bimstorageacc-secondary.z4.web.core.windows.net/","blob":"https://bimstorageacc-secondary.blob.core.windows.net/","queue":"https://bimstorageacc-secondary.queue.core.windows.net/","table":"https://bimstorageacc-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yu-test-rg-westus/providers/Microsoft.Storage/storageAccounts/sfsfsfsssf","name":"sfsfsfsssf","type":"Microsoft.Storage/storageAccounts","location":"westcentralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-05T07:16:53.7141799Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-05T07:16:53.7141799Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-03-05T07:16:53.6829148Z","primaryEndpoints":{"blob":"https://sfsfsfsssf.blob.core.windows.net/","queue":"https://sfsfsfsssf.queue.core.windows.net/","table":"https://sfsfsfsssf.table.core.windows.net/","file":"https://sfsfsfsssf.file.core.windows.net/"},"primaryLocation":"westcentralus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yu-test-rg-westus/providers/Microsoft.Storage/storageAccounts/stststeset","name":"stststeset","type":"Microsoft.Storage/storageAccounts","location":"westcentralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-05T07:13:11.0482184Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-05T07:13:11.0482184Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-03-05T07:13:10.9856962Z","primaryEndpoints":{"dfs":"https://stststeset.dfs.core.windows.net/","web":"https://stststeset.z4.web.core.windows.net/","blob":"https://stststeset.blob.core.windows.net/","queue":"https://stststeset.queue.core.windows.net/","table":"https://stststeset.table.core.windows.net/","file":"https://stststeset.file.core.windows.net/"},"primaryLocation":"westcentralus","statusOfPrimary":"available"}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yu-test-rg-westus/providers/Microsoft.Storage/storageAccounts/yusawcu","name":"yusawcu","type":"Microsoft.Storage/storageAccounts","location":"westcentralus","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-26T09:39:00.0292799Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-02-26T09:39:00.0292799Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-02-26T09:38:59.9667703Z","primaryEndpoints":{"dfs":"https://yusawcu.dfs.core.windows.net/","web":"https://yusawcu.z4.web.core.windows.net/","blob":"https://yusawcu.blob.core.windows.net/","queue":"https://yusawcu.queue.core.windows.net/","table":"https://yusawcu.table.core.windows.net/","file":"https://yusawcu.file.core.windows.net/"},"primaryLocation":"westcentralus","statusOfPrimary":"available","secondaryLocation":"westus2","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://yusawcu-secondary.dfs.core.windows.net/","web":"https://yusawcu-secondary.z4.web.core.windows.net/","blob":"https://yusawcu-secondary.blob.core.windows.net/","queue":"https://yusawcu-secondary.queue.core.windows.net/","table":"https://yusawcu-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zuh/providers/Microsoft.Storage/storageAccounts/storageextension","name":"storageextension","type":"Microsoft.Storage/storageAccounts","location":"eastus2euap","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-30T08:44:19.2476281Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-30T08:44:19.2476281Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-03-30T08:44:19.2007782Z","primaryEndpoints":{"dfs":"https://storageextension.dfs.core.windows.net/","web":"https://storageextension.z3.web.core.windows.net/","blob":"https://storageextension.blob.core.windows.net/","queue":"https://storageextension.queue.core.windows.net/","table":"https://storageextension.table.core.windows.net/","file":"https://storageextension.file.core.windows.net/"},"primaryLocation":"eastus2euap","statusOfPrimary":"available","secondaryLocation":"centraluseuap","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storageextension-secondary.dfs.core.windows.net/","web":"https://storageextension-secondary.z3.web.core.windows.net/","blob":"https://storageextension-secondary.blob.core.windows.net/","queue":"https://storageextension-secondary.queue.core.windows.net/","table":"https://storageextension-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zuh/providers/Microsoft.Storage/storageAccounts/storagetest22","name":"storagetest22","type":"Microsoft.Storage/storageAccounts","location":"eastus2euap","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-21T03:43:07.5284378Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-21T03:43:07.5284378Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-21T03:43:07.4503168Z","primaryEndpoints":{"dfs":"https://storagetest22.dfs.core.windows.net/","web":"https://storagetest22.z3.web.core.windows.net/","blob":"https://storagetest22.blob.core.windows.net/","queue":"https://storagetest22.queue.core.windows.net/","table":"https://storagetest22.table.core.windows.net/","file":"https://storagetest22.file.core.windows.net/"},"primaryLocation":"eastus2euap","statusOfPrimary":"available","secondaryLocation":"centraluseuap","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://storagetest22-secondary.dfs.core.windows.net/","web":"https://storagetest22-secondary.z3.web.core.windows.net/","blob":"https://storagetest22-secondary.blob.core.windows.net/","queue":"https://storagetest22-secondary.queue.core.windows.net/","table":"https://storagetest22-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zuh/providers/Microsoft.Storage/storageAccounts/zuhadls","name":"zuhadls","type":"Microsoft.Storage/storageAccounts","location":"eastus2euap","tags":{},"properties":{"privateEndpointConnections":[],"isHnsEnabled":true,"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-20T03:10:14.5178215Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-20T03:10:14.5178215Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-03-20T03:10:14.4709025Z","primaryEndpoints":{"dfs":"https://zuhadls.dfs.core.windows.net/","web":"https://zuhadls.z3.web.core.windows.net/","blob":"https://zuhadls.blob.core.windows.net/","queue":"https://zuhadls.queue.core.windows.net/","table":"https://zuhadls.table.core.windows.net/","file":"https://zuhadls.file.core.windows.net/"},"primaryLocation":"eastus2euap","statusOfPrimary":"available","secondaryLocation":"centraluseuap","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://zuhadls-secondary.dfs.core.windows.net/","web":"https://zuhadls-secondary.z3.web.core.windows.net/","blob":"https://zuhadls-secondary.blob.core.windows.net/","queue":"https://zuhadls-secondary.queue.core.windows.net/","table":"https://zuhadls-secondary.table.core.windows.net/"}}},{"identity":{"principalId":"d2e83740-1d90-4aa7-901c-97c510d4f7ec","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zuh/providers/Microsoft.Storage/storageAccounts/zuhdefault","name":"zuhdefault","type":"Microsoft.Storage/storageAccounts","location":"eastus2euap","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"keyvaultproperties":{"currentVersionedKeyIdentifier":"https://zuhkeyvault.vault.azure.net/keys/zuhkey/2780bea583714f33b8051ea24f90a246","lastKeyRotationTimestamp":"2020-04-09T06:46:21.5968704Z","currentVersionedKeyExpirationTimestamp":"1970-01-01T00:00:00.0000000Z","keyvaulturi":"https://zuhkeyvault.vault.azure.net/","keyname":"zuhkey","keyversion":"2780bea583714f33b8051ea24f90a246"},"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-30T03:16:26.4697374Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-30T03:16:26.4697374Z"}},"keySource":"Microsoft.Keyvault"},"provisioningState":"Succeeded","creationTime":"2020-03-30T03:16:26.4228869Z","primaryEndpoints":{"blob":"https://zuhdefault.blob.core.windows.net/","queue":"https://zuhdefault.queue.core.windows.net/","table":"https://zuhdefault.table.core.windows.net/","file":"https://zuhdefault.file.core.windows.net/"},"primaryLocation":"eastus2euap","statusOfPrimary":"available","secondaryLocation":"centraluseuap","statusOfSecondary":"available","secondaryEndpoints":{"blob":"https://zuhdefault-secondary.blob.core.windows.net/","queue":"https://zuhdefault-secondary.queue.core.windows.net/","table":"https://zuhdefault-secondary.table.core.windows.net/"}}},{"identity":{"principalId":"1b643393-f35b-408e-b50c-2fbef882d353","tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","type":"SystemAssigned"},"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zuh/providers/Microsoft.Storage/storageAccounts/zuhlrs","name":"zuhlrs","type":"Microsoft.Storage/storageAccounts","location":"eastus2euap","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"keyvaultproperties":{"currentVersionedKeyIdentifier":"https://zuhkeyvault.vault.azure.net/keys/storagekey/04704263f43241dca0ff99c3794fd8c7","lastKeyRotationTimestamp":"2020-04-15T08:06:44.8059437Z","currentVersionedKeyExpirationTimestamp":"1970-01-01T00:00:00.0000000Z","keyvaulturi":"https://zuhkeyvault.vault.azure.net/","keyname":"storagekey","keyversion":""},"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-18T01:57:52.8994530Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-18T01:57:52.8994530Z"}},"keySource":"Microsoft.Keyvault"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-03-18T01:57:52.8369202Z","primaryEndpoints":{"dfs":"https://zuhlrs.dfs.core.windows.net/","web":"https://zuhlrs.z3.web.core.windows.net/","blob":"https://zuhlrs.blob.core.windows.net/","queue":"https://zuhlrs.queue.core.windows.net/","table":"https://zuhlrs.table.core.windows.net/","file":"https://zuhlrs.file.core.windows.net/"},"primaryLocation":"eastus2euap","statusOfPrimary":"available"}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zuh/providers/Microsoft.Storage/storageAccounts/zuhors","name":"zuhors","type":"Microsoft.Storage/storageAccounts","location":"eastus2euap","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-30T05:15:21.5112485Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-03-30T05:15:21.5112485Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-03-30T05:15:21.4800200Z","primaryEndpoints":{"dfs":"https://zuhors.dfs.core.windows.net/","web":"https://zuhors.z3.web.core.windows.net/","blob":"https://zuhors.blob.core.windows.net/","queue":"https://zuhors.queue.core.windows.net/","table":"https://zuhors.table.core.windows.net/","file":"https://zuhors.file.core.windows.net/"},"primaryLocation":"eastus2euap","statusOfPrimary":"available","secondaryLocation":"centraluseuap","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://zuhors-secondary.dfs.core.windows.net/","web":"https://zuhors-secondary.z3.web.core.windows.net/","blob":"https://zuhors-secondary.blob.core.windows.net/","queue":"https://zuhors-secondary.queue.core.windows.net/","table":"https://zuhors-secondary.table.core.windows.net/"}}},{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/zuh/providers/Microsoft.Storage/storageAccounts/zuhstoragetest","name":"zuhstoragetest","type":"Microsoft.Storage/storageAccounts","location":"eastus2euap","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-20T07:16:48.8761196Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-20T07:16:48.8761196Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-20T07:16:48.8448300Z","primaryEndpoints":{"dfs":"https://zuhstoragetest.dfs.core.windows.net/","web":"https://zuhstoragetest.z3.web.core.windows.net/","blob":"https://zuhstoragetest.blob.core.windows.net/","queue":"https://zuhstoragetest.queue.core.windows.net/","table":"https://zuhstoragetest.table.core.windows.net/","file":"https://zuhstoragetest.file.core.windows.net/"},"primaryLocation":"eastus2euap","statusOfPrimary":"available","secondaryLocation":"centraluseuap","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://zuhstoragetest-secondary.dfs.core.windows.net/","web":"https://zuhstoragetest-secondary.z3.web.core.windows.net/","blob":"https://zuhstoragetest-secondary.blob.core.windows.net/","queue":"https://zuhstoragetest-secondary.queue.core.windows.net/","table":"https://zuhstoragetest-secondary.table.core.windows.net/"}}}]}' + headers: + cache-control: + - no-cache + content-length: + - '127895' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:04 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: + - 1d135e07-2e6e-40be-a2b3-3b916a6e0da2 + - dee3f2c8-4ebe-4540-8407-ca7713724a9a + - c104a4ca-15f7-470c-bacd-faa81e9b4517 + - 2dfc2132-c363-4994-94b4-7a92972f8324 + - 4f634dd3-9a28-4a79-96a4-c226b692416f + - 714ebaf4-62c9-4b87-b9fe-f8f7cd8f4ecf + - c2bc88dc-82f1-4bbb-9066-9e0266f19444 + - 4d9514e9-6d2a-4501-846d-7cbf1bbb9c5b + - cb89a6d6-335f-451a-a1f8-86799ab6f621 + - 62943f3d-91c5-4359-8a8e-f594544946e5 + - 0720666c-126e-42db-80dd-f720caa725e0 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage container create + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --account-name --name + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 (MSI) + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.Storage/storageAccounts/clitestdatas000002/listKeys?api-version=2019-06-01 + response: + body: + string: '{"keys":[{"keyName":"key1","value":"veryFakedStorageAccountKey==","permissions":"FULL"},{"keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 13:45:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11998' + status: + code: 200 + message: OK +- request: + body: null + headers: + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - Azure-Storage/2.0.0-2.0.1 (Python CPython 3.8.2; Windows 10) AZURECLI/2.4.0 + (MSI) + x-ms-date: + - Thu, 23 Apr 2020 13:45:06 GMT + x-ms-version: + - '2018-11-09' + method: PUT + uri: https://clitestdatas000002.blob.core.windows.net/clitestcontainer?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Thu, 23 Apr 2020 13:45:07 GMT + etag: + - '"0x8D7E78C89BF1209"' + last-modified: + - Thu, 23 Apr 2020 13:45:08 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2018-11-09' + status: + code: 201 + message: Created +- request: + body: 'b''b\''{"kind": "Container", "properties": {"containerName": "clitestcontainer", + "resourceGroup": "cli_test_dat000001", "storageAccountName": "clitestdatas000002", + "subscriptionId": "0b1f6471-1bf0-4dda-aec3-cb9272f09590"}}\''''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare dataset create + Connection: + - keep-alive + Content-Length: + - '278' + Content-Type: + - application/json + ParameterSetName: + - --account-name --dataset --name --resource-group --share-name + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/dataSets/cli_test_data_set?api-version=2019-11-01 + response: + body: + string: '{"properties":{"containerName":"clitestcontainer","subscriptionId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","resourceGroup":"cli_test_dat000001","storageAccountName":"clitestdatas000002","dataSetId":"031a78ef-0cfc-45b0-88a3-a20a58f3a87a"},"kind":"Container","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/dataSets/cli_test_data_set","name":"cli_test_data_set","type":"Microsoft.DataShare/DataSets"}' + headers: + cache-control: + - no-cache + content-length: + - '639' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:11 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/dataSets/cli_test_data_set?api-version=2019-11-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-quota: + - '[{"currentUsed":1,"limit":100,"name":{"localizedValue":"DataSet resource + quota","value":"DataSet resource quota"},"target":"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli_test_datrywkgqr6mfnic2batum7zhzzekrutyfed7ajmopnqmg7bfkqdq2mavcabi7fdxo/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/dataSets/cli_test_data_set"}]' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare dataset show + Connection: + - keep-alive + ParameterSetName: + - --account-name --name --resource-group --share-name + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/dataSets/cli_test_data_set?api-version=2019-11-01 + response: + body: + string: '{"properties":{"containerName":"clitestcontainer","subscriptionId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","resourceGroup":"cli_test_dat000001","storageAccountName":"clitestdatas000002","dataSetId":"031a78ef-0cfc-45b0-88a3-a20a58f3a87a"},"kind":"Container","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/dataSets/cli_test_data_set","name":"cli_test_data_set","type":"Microsoft.DataShare/DataSets"}' + headers: + cache-control: + - no-cache + content-length: + - '639' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare dataset list + Connection: + - keep-alive + ParameterSetName: + - --account-name --resource-group --share-name + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/dataSets?api-version=2019-11-01 + response: + body: + string: '{"value":[{"properties":{"containerName":"clitestcontainer","subscriptionId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","resourceGroup":"cli_test_dat000001","storageAccountName":"clitestdatas000002","dataSetId":"031a78ef-0cfc-45b0-88a3-a20a58f3a87a"},"kind":"Container","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/dataSets/cli_test_data_set","name":"cli_test_data_set","type":"Microsoft.DataShare/DataSets"}]}' + headers: + cache-control: + - no-cache + content-length: + - '651' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"kind": "ScheduleBased", "properties": {"recurrenceInterval": "Day", "synchronizationTime": + "2020-04-05T10:50:00.000Z"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare synchronization-setting create + Connection: + - keep-alive + Content-Length: + - '121' + Content-Type: + - application/json + ParameterSetName: + - --account-name --resource-group --share-name --name --recurrence-interval + --synchronization-time + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/synchronizationSettings/cli_test_synchronization_setting?api-version=2019-11-01 + response: + body: + string: '{"properties":{"recurrenceInterval":"Day","synchronizationTime":"2020-04-05T10:50:00Z","createdAt":"2020-04-23T13:45:18.9184873Z","userName":"Feng + Zhou","provisioningState":"Succeeded"},"kind":"ScheduleBased","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/synchronizationSettings/cli_test_synchronization_setting","name":"cli_test_synchronization_setting","type":"Microsoft.DataShare/SynchronizationSettings"}' + headers: + cache-control: + - no-cache + content-length: + - '589' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:18 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/synchronizationSettings/cli_test_synchronization_setting + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare synchronization-setting show + Connection: + - keep-alive + ParameterSetName: + - --account-name --resource-group --share-name --name + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/synchronizationSettings/cli_test_synchronization_setting?api-version=2019-11-01 + response: + body: + string: '{"properties":{"recurrenceInterval":"Day","synchronizationTime":"2020-04-05T10:50:00Z","createdAt":"2020-04-23T13:45:18.9184873Z","userName":"Feng + Zhou","provisioningState":"Succeeded"},"kind":"ScheduleBased","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/synchronizationSettings/cli_test_synchronization_setting","name":"cli_test_synchronization_setting","type":"Microsoft.DataShare/SynchronizationSettings"}' + headers: + cache-control: + - no-cache + content-length: + - '589' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare synchronization-setting list + Connection: + - keep-alive + ParameterSetName: + - --account-name --resource-group --share-name + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/synchronizationSettings?api-version=2019-11-01 + response: + body: + string: '{"value":[{"properties":{"recurrenceInterval":"Day","synchronizationTime":"2020-04-05T10:50:00Z","createdAt":"2020-04-23T13:45:18.9184873Z","userName":"Feng + Zhou","provisioningState":"Succeeded"},"kind":"ScheduleBased","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/synchronizationSettings/cli_test_synchronization_setting","name":"cli_test_synchronization_setting","type":"Microsoft.DataShare/SynchronizationSettings"}]}' + headers: + cache-control: + - no-cache + content-length: + - '601' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare synchronization list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --account-name --resource-group --share-name + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/listSynchronizations?api-version=2019-11-01 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"targetEmail": "consumer@microsoft.com"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare invitation create + Connection: + - keep-alive + Content-Length: + - '54' + Content-Type: + - application/json + ParameterSetName: + - --account-name --target-email --name --resource-group --share-name + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/invitations/cli_test_invitation?api-version=2019-11-01 + response: + body: + string: '{"properties":{"sentAt":"2020-04-23T13:45:26.3055269Z","targetEmail":"consumer@microsoft.com","invitationStatus":"Pending","invitationId":"8844a5ff-7016-4c96-9901-1a7d005fc0ec","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/invitations/cli_test_invitation","name":"cli_test_invitation","type":"Microsoft.DataShare/Invitations"}' + headers: + cache-control: + - no-cache + content-length: + - '566' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:26 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/invitations/cli_test_invitation/8844a5ff-7016-4c96-9901-1a7d005fc0ec + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare invitation list + Connection: + - keep-alive + ParameterSetName: + - --account-name --resource-group --share-name + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/invitations?api-version=2019-11-01 + response: + body: + string: '{"value":[{"properties":{"sentAt":"2020-04-23T13:45:26.3055269Z","targetEmail":"consumer@microsoft.com","invitationStatus":"Pending","invitationId":"8844a5ff-7016-4c96-9901-1a7d005fc0ec","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/invitations/cli_test_invitation","name":"cli_test_invitation","type":"Microsoft.DataShare/Invitations"}]}' + headers: + cache-control: + - no-cache + content-length: + - '578' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:27 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare invitation show + Connection: + - keep-alive + ParameterSetName: + - --account-name --name --resource-group --share-name + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/invitations/cli_test_invitation?api-version=2019-11-01 + response: + body: + string: '{"properties":{"sentAt":"2020-04-23T13:45:26.3055269Z","targetEmail":"consumer@microsoft.com","invitationStatus":"Pending","invitationId":"8844a5ff-7016-4c96-9901-1a7d005fc0ec","userName":"Feng + Zhou","userEmail":"provider@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/invitations/cli_test_invitation","name":"cli_test_invitation","type":"Microsoft.DataShare/Invitations"}' + headers: + cache-control: + - no-cache + content-length: + - '566' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:29 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare invitation show + Connection: + - keep-alive + ParameterSetName: + - --account-name --name --resource-group --share-name + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-resource/8.0.1 Azure-SDK-For-Python AZURECLI/2.4.0 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/locations?api-version=2019-06-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia","name":"eastasia","displayName":"East + Asia","longitude":"114.188","latitude":"22.267"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia","name":"southeastasia","displayName":"Southeast + Asia","longitude":"103.833","latitude":"1.283"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus","name":"centralus","displayName":"Central + US","longitude":"-93.6208","latitude":"41.5908"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus","name":"eastus","displayName":"East + US","longitude":"-79.8164","latitude":"37.3719"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2","name":"eastus2","displayName":"East + US 2","longitude":"-78.3889","latitude":"36.6681"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus","name":"westus","displayName":"West + US","longitude":"-122.417","latitude":"37.783"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus","name":"northcentralus","displayName":"North + Central US","longitude":"-87.6278","latitude":"41.8819"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus","name":"southcentralus","displayName":"South + Central US","longitude":"-98.5","latitude":"29.4167"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope","name":"northeurope","displayName":"North + Europe","longitude":"-6.2597","latitude":"53.3478"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope","name":"westeurope","displayName":"West + Europe","longitude":"4.9","latitude":"52.3667"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest","name":"japanwest","displayName":"Japan + West","longitude":"135.5022","latitude":"34.6939"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast","name":"japaneast","displayName":"Japan + East","longitude":"139.77","latitude":"35.68"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth","name":"brazilsouth","displayName":"Brazil + South","longitude":"-46.633","latitude":"-23.55"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast","name":"australiaeast","displayName":"Australia + East","longitude":"151.2094","latitude":"-33.86"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast","name":"australiasoutheast","displayName":"Australia + Southeast","longitude":"144.9631","latitude":"-37.8136"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia","name":"southindia","displayName":"South + India","longitude":"80.1636","latitude":"12.9822"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia","name":"centralindia","displayName":"Central + India","longitude":"73.9197","latitude":"18.5822"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westindia","name":"westindia","displayName":"West + India","longitude":"72.868","latitude":"19.088"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral","name":"canadacentral","displayName":"Canada + Central","longitude":"-79.383","latitude":"43.653"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast","name":"canadaeast","displayName":"Canada + East","longitude":"-71.217","latitude":"46.817"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth","name":"uksouth","displayName":"UK + South","longitude":"-0.799","latitude":"50.941"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest","name":"ukwest","displayName":"UK + West","longitude":"-3.084","latitude":"53.427"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus","name":"westcentralus","displayName":"West + Central US","longitude":"-110.234","latitude":"40.890"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2","name":"westus2","displayName":"West + US 2","longitude":"-119.852","latitude":"47.233"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral","name":"koreacentral","displayName":"Korea + Central","longitude":"126.9780","latitude":"37.5665"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth","name":"koreasouth","displayName":"Korea + South","longitude":"129.0756","latitude":"35.1796"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral","name":"francecentral","displayName":"France + Central","longitude":"2.3730","latitude":"46.3772"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth","name":"francesouth","displayName":"France + South","longitude":"2.1972","latitude":"43.8345"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral","name":"australiacentral","displayName":"Australia + Central","longitude":"149.1244","latitude":"-35.3075"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2","name":"australiacentral2","displayName":"Australia + Central 2","longitude":"149.1244","latitude":"-35.3075"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral","name":"uaecentral","displayName":"UAE + Central","longitude":"54.366669","latitude":"24.466667"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth","name":"uaenorth","displayName":"UAE + North","longitude":"55.316666","latitude":"25.266666"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth","name":"southafricanorth","displayName":"South + Africa North","longitude":"28.218370","latitude":"-25.731340"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest","name":"southafricawest","displayName":"South + Africa West","longitude":"18.843266","latitude":"-34.075691"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth","name":"switzerlandnorth","displayName":"Switzerland + North","longitude":"8.564572","latitude":"47.451542"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest","name":"switzerlandwest","displayName":"Switzerland + West","longitude":"6.143158","latitude":"46.204391"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth","name":"germanynorth","displayName":"Germany + North","longitude":"8.806422","latitude":"53.073635"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral","name":"germanywestcentral","displayName":"Germany + West Central","longitude":"8.682127","latitude":"50.110924"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest","name":"norwaywest","displayName":"Norway + West","longitude":"5.733107","latitude":"58.969975"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast","name":"norwayeast","displayName":"Norway + East","longitude":"10.752245","latitude":"59.913868"}]}' + headers: + cache-control: + - no-cache + content-length: + - '7129' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:30 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": "westus2", "identity": {"type": "SystemAssigned"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account create + Connection: + - keep-alive + Content-Length: + - '63' + Content-Type: + - application/json + ParameterSetName: + - --location --name --resource-group --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account?api-version=2019-11-01 + response: + body: + string: '{"identity":{"type":"SystemAssigned","principalId":"b6e0a818-ff37-4b75-95bd-1b2526538ea7","tenantId":"66d4b7e9-35f0-4be4-993b-31770b23fbae"},"properties":{"createdAt":"2020-04-23T13:45:41.6651537Z","provisioningState":"Creating","userName":"Allen + Zhou","userEmail":"consumer@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account","name":"cli_test_consumer_account","type":"Microsoft.DataShare/accounts","location":"westus2"}' + headers: + cache-control: + - no-cache + content-length: + - '543' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:42 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account?api-version=2019-11-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-quota: + - '[{"currentUsed":1,"limit":50,"name":{"localizedValue":"Account resource quota","value":"Account + resource quota"},"target":"/subscriptions/9abff005-2afc-4de1-b39c-344b9de2cc9c/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account"}]' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer invitation list + Connection: + - keep-alive + ParameterSetName: + - --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.DataShare/ListInvitations?api-version=2019-11-01 + response: + body: + string: '{"value":[{"properties":{"description":"share description","dataSetCount":1,"invitationId":"8844a5ff-7016-4c96-9901-1a7d005fc0ec","invitationStatus":"Pending","location":"westus2","shareName":"cli_test_share","sentAt":"2020-04-23T13:45:26.3055269Z","termsOfUse":"Confidential","providerName":"Feng + Zhou","providerEmail":"provider@microsoft.com","providerTenantName":"AzureSDKTeam","userName":null,"userEmail":null},"id":"/providers/Microsoft.DataShare/consumerInvitations/8844a5ff-7016-4c96-9901-1a7d005fc0ec","name":"cli_test_invitation","type":"Microsoft.DataShare/consumerInvitations"}]}' + headers: + cache-control: + - no-cache + content-length: + - '591' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:45 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: + - '' + - '' + - '' + - '' + - '' + - '' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer invitation show + Connection: + - keep-alive + ParameterSetName: + - --invitation-id --subscription --location + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/providers/Microsoft.DataShare/locations/westus2/consumerInvitations/8844a5ff-7016-4c96-9901-1a7d005fc0ec?api-version=2019-11-01 + response: + body: + string: '{"properties":{"description":"share description","dataSetCount":1,"invitationId":"8844a5ff-7016-4c96-9901-1a7d005fc0ec","invitationStatus":"Pending","location":"westus2","shareName":"cli_test_share","sentAt":"2020-04-23T13:45:26.3055269Z","termsOfUse":"Confidential","providerName":"Feng + Zhou","providerEmail":"provider@microsoft.com","providerTenantName":"AzureSDKTeam","userName":null,"userEmail":null},"id":"/providers/Microsoft.DataShare/consumerInvitations/8844a5ff-7016-4c96-9901-1a7d005fc0ec","name":"cli_test_invitation","type":"Microsoft.DataShare/consumerInvitations"}' + headers: + cache-control: + - no-cache + content-length: + - '579' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account wait + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --created --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account?api-version=2019-11-01 + response: + body: + string: '{"identity":{"type":"SystemAssigned","principalId":"b6e0a818-ff37-4b75-95bd-1b2526538ea7","tenantId":"66d4b7e9-35f0-4be4-993b-31770b23fbae"},"properties":{"createdAt":"2020-04-23T13:45:41.6651537Z","provisioningState":"Creating","userName":"Allen + Zhou","userEmail":"consumer@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account","name":"cli_test_consumer_account","type":"Microsoft.DataShare/accounts","location":"westus2"}' + headers: + cache-control: + - no-cache + content-length: + - '543' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:45:49 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account wait + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --created --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account?api-version=2019-11-01 + response: + body: + string: '{"identity":{"type":"SystemAssigned","principalId":"b6e0a818-ff37-4b75-95bd-1b2526538ea7","tenantId":"66d4b7e9-35f0-4be4-993b-31770b23fbae"},"properties":{"createdAt":"2020-04-23T13:45:41.6651537Z","provisioningState":"Creating","userName":"Allen + Zhou","userEmail":"consumer@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account","name":"cli_test_consumer_account","type":"Microsoft.DataShare/accounts","location":"westus2"}' + headers: + cache-control: + - no-cache + content-length: + - '543' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:46:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account wait + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --created --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account?api-version=2019-11-01 + response: + body: + string: '{"identity":{"type":"SystemAssigned","principalId":"b6e0a818-ff37-4b75-95bd-1b2526538ea7","tenantId":"66d4b7e9-35f0-4be4-993b-31770b23fbae"},"properties":{"createdAt":"2020-04-23T13:45:41.6651537Z","provisioningState":"Creating","userName":"Allen + Zhou","userEmail":"consumer@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account","name":"cli_test_consumer_account","type":"Microsoft.DataShare/accounts","location":"westus2"}' + headers: + cache-control: + - no-cache + content-length: + - '543' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:46:49 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account wait + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --created --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account?api-version=2019-11-01 + response: + body: + string: '{"identity":{"type":"SystemAssigned","principalId":"b6e0a818-ff37-4b75-95bd-1b2526538ea7","tenantId":"66d4b7e9-35f0-4be4-993b-31770b23fbae"},"properties":{"createdAt":"2020-04-23T13:45:41.6651537Z","provisioningState":"Creating","userName":"Allen + Zhou","userEmail":"consumer@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account","name":"cli_test_consumer_account","type":"Microsoft.DataShare/accounts","location":"westus2"}' + headers: + cache-control: + - no-cache + content-length: + - '543' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:47:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account wait + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group --created --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account?api-version=2019-11-01 + response: + body: + string: '{"identity":{"type":"SystemAssigned","principalId":"b6e0a818-ff37-4b75-95bd-1b2526538ea7","tenantId":"66d4b7e9-35f0-4be4-993b-31770b23fbae"},"properties":{"createdAt":"2020-04-23T13:45:41.6651537Z","provisioningState":"Succeeded","userName":"Allen + Zhou","userEmail":"consumer@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account","name":"cli_test_consumer_account","type":"Microsoft.DataShare/accounts","location":"westus2"}' + headers: + cache-control: + - no-cache + content-length: + - '544' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:47:51 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"invitationId": "8844a5ff-7016-4c96-9901-1a7d005fc0ec", + "sourceShareLocation": "westus2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer share-subscription create + Connection: + - keep-alive + Content-Length: + - '106' + Content-Type: + - application/json + ParameterSetName: + - --account-name --resource-group --invitation-id --source-share-location --name + --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription?api-version=2019-11-01 + response: + body: + string: '{"properties":{"createdAt":"2020-04-23T13:47:55.3598425Z","invitationId":"8844a5ff-7016-4c96-9901-1a7d005fc0ec","sourceShareLocation":"westus2","provisioningState":"Succeeded","shareDescription":"share + description","shareKind":"CopyBased","shareName":"cli_test_share","shareSubscriptionStatus":"Active","shareTerms":"Confidential","providerName":"Feng + Zhou","providerEmail":"provider@microsoft.com","providerTenantName":"AzureSDKTeam","userName":"Allen + Zhou","userEmail":"consumer@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription","name":"cli_test_share_subscription","type":"Microsoft.DataShare/ShareSubscriptions"}' + headers: + cache-control: + - no-cache + content-length: + - '788' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:47:55 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/cli_test_share_subscription + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-quota: + - '[{"currentUsed":1,"limit":100,"name":{"localizedValue":"ShareSubscription + resource quota","value":"ShareSubscription resource quota"},"target":"/subscriptions/9abff005-2afc-4de1-b39c-344b9de2cc9c/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription"}]' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer share-subscription show + Connection: + - keep-alive + ParameterSetName: + - --account-name --resource-group --name --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription?api-version=2019-11-01 + response: + body: + string: '{"properties":{"createdAt":"2020-04-23T13:47:55.3598425Z","invitationId":"8844a5ff-7016-4c96-9901-1a7d005fc0ec","sourceShareLocation":"westus2","provisioningState":"Succeeded","shareDescription":"share + description","shareKind":"CopyBased","shareName":"cli_test_share","shareSubscriptionStatus":"Active","shareTerms":"Confidential","providerName":"Feng + Zhou","providerEmail":"provider@microsoft.com","providerTenantName":"AzureSDKTeam","userName":"Allen + Zhou","userEmail":"consumer@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription","name":"cli_test_share_subscription","type":"Microsoft.DataShare/ShareSubscriptions"}' + headers: + cache-control: + - no-cache + content-length: + - '788' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:47:56 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer share-subscription list + Connection: + - keep-alive + ParameterSetName: + - --account-name --resource-group --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions?api-version=2019-11-01 + response: + body: + string: '{"value":[{"properties":{"createdAt":"2020-04-23T13:47:55.3598425Z","invitationId":"8844a5ff-7016-4c96-9901-1a7d005fc0ec","sourceShareLocation":"westus2","provisioningState":"Succeeded","shareDescription":"share + description","shareKind":"CopyBased","shareName":"cli_test_share","shareSubscriptionStatus":"Active","shareTerms":"Confidential","providerName":"Feng + Zhou","providerEmail":"provider@microsoft.com","providerTenantName":"AzureSDKTeam","userName":"Allen + Zhou","userEmail":"consumer@microsoft.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription","name":"cli_test_share_subscription","type":"Microsoft.DataShare/ShareSubscriptions"}]}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:47:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer share-subscription list-source-dataset + Connection: + - keep-alive + ParameterSetName: + - --account-name --resource-group --share-subscription-name --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/ConsumerSourceDataSets?api-version=2019-11-01 + response: + body: + string: '{"value":[{"properties":{"dataSetName":"cli_test_data_set","dataSetPath":"clitestcontainer","dataSetId":"031a78ef-0cfc-45b0-88a3-a20a58f3a87a","dataSetLocation":null,"dataSetType":"Container"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/consumerSourceDataSets/cli_test_data_set","name":"cli_test_data_set","type":"Microsoft.DataShare/ConsumerSourceDataSet"}]}' + headers: + cache-control: + - no-cache + content-length: + - '522' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:48:00 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account show + Connection: + - keep-alive + ParameterSetName: + - -n -g --subscription + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 (MSI) + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.Storage/storageAccounts/datashareconsumersa?api-version=2019-06-01 + response: + body: + string: '{"sku":{"name":"Standard_RAGRS","tier":"Standard"},"kind":"StorageV2","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.Storage/storageAccounts/datashareconsumersa","name":"datashareconsumersa","type":"Microsoft.Storage/storageAccounts","location":"westus2","tags":{},"properties":{"privateEndpointConnections":[],"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-07T02:47:00.7207527Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-07T02:47:00.7207527Z"}},"keySource":"Microsoft.Storage"},"accessTier":"Hot","provisioningState":"Succeeded","creationTime":"2020-04-07T02:47:00.6426060Z","primaryEndpoints":{"dfs":"https://datashareconsumersa.dfs.core.windows.net/","web":"https://datashareconsumersa.z5.web.core.windows.net/","blob":"https://datashareconsumersa.blob.core.windows.net/","queue":"https://datashareconsumersa.queue.core.windows.net/","table":"https://datashareconsumersa.table.core.windows.net/","file":"https://datashareconsumersa.file.core.windows.net/"},"primaryLocation":"westus2","statusOfPrimary":"available","secondaryLocation":"westcentralus","statusOfSecondary":"available","secondaryEndpoints":{"dfs":"https://datashareconsumersa-secondary.dfs.core.windows.net/","web":"https://datashareconsumersa-secondary.z5.web.core.windows.net/","blob":"https://datashareconsumersa-secondary.blob.core.windows.net/","queue":"https://datashareconsumersa-secondary.queue.core.windows.net/","table":"https://datashareconsumersa-secondary.table.core.windows.net/"}}}' + headers: + cache-control: + - no-cache + content-length: + - '1744' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 13:48:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"roleDefinitionId": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/ba92f5b4-2d11-453d-a403-e96b0029c9fe", + "principalId": "b6e0a818-ff37-4b75-95bd-1b2526538ea7", "principalType": "ServicePrincipal"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - role assignment create + Connection: + - keep-alive + Content-Length: + - '270' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --role --assignee-object-id --assignee-principal-type --scope --subscription + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-authorization/0.52.0 Azure-SDK-For-Python AZURECLI/2.4.0 (MSI) + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.Storage/storageAccounts/datashareconsumersa/providers/Microsoft.Authorization/roleAssignments/3a1bf740-28a5-4a0d-bdb5-48fdb2c43922?api-version=2018-09-01-preview + response: + body: + string: '{"properties":{"roleDefinitionId":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleDefinitions/ba92f5b4-2d11-453d-a403-e96b0029c9fe","principalId":"b6e0a818-ff37-4b75-95bd-1b2526538ea7","principalType":"ServicePrincipal","scope":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.Storage/storageAccounts/datashareconsumersa","createdOn":"2020-04-23T13:48:04.0784140Z","updatedOn":"2020-04-23T13:48:04.0784140Z","createdBy":null,"updatedBy":"97bce510-8fdd-4a59-9f13-f32a6179931e"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.Storage/storageAccounts/datashareconsumersa/providers/Microsoft.Authorization/roleAssignments/3a1bf740-28a5-4a0d-bdb5-48fdb2c43922","type":"Microsoft.Authorization/roleAssignments","name":"3a1bf740-28a5-4a0d-bdb5-48fdb2c43922"}' + headers: + cache-control: + - no-cache + content-length: + - '923' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:48:10 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - x-ms-gateway-slice=Production; path=/; SameSite=None; secure; HttpOnly + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: '{"kind": "BlobFolder", "properties": {"containerName": "clitestconsumercontainer", + "dataSetId": "031a78ef-0cfc-45b0-88a3-a20a58f3a87a", "prefix": "cli_test_data_set", + "resourceGroup": "datashare_consumer_rg", "storageAccountName": "datashareconsumersa", + "subscriptionId": "9abff005-2afc-4de1-b39c-344b9de2cc9c"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer dataset-mapping create + Connection: + - keep-alive + Content-Length: + - '312' + Content-Type: + - application/json + ParameterSetName: + - --account-name --name --resource-group --share-subscription-name --mapping + --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/dataSetMappings/cli_test_data_set_mapping?api-version=2019-11-01 + response: + body: + string: '{"properties":{"containerName":"clitestconsumercontainer","prefix":"cli_test_data_set","subscriptionId":"9abff005-2afc-4de1-b39c-344b9de2cc9c","resourceGroup":"datashare_consumer_rg","storageAccountName":"datashareconsumersa","dataSetId":"031a78ef-0cfc-45b0-88a3-a20a58f3a87a","dataSetMappingStatus":"Ok","provisioningState":"Succeeded"},"kind":"BlobFolder","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/dataSetMappings/cli_test_data_set_mapping","name":"cli_test_data_set_mapping","type":"Microsoft.DataShare/DataSetMappings"}' + headers: + cache-control: + - no-cache + content-length: + - '688' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:48:25 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/dataSetMappings/cli_test_data_set_mapping?api-version=2019-11-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-quota: + - '[{"currentUsed":1,"limit":100,"name":{"localizedValue":"DataSetMapping resource + quota","value":"DataSetMapping resource quota"},"target":"/subscriptions/9abff005-2afc-4de1-b39c-344b9de2cc9c/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/dataSetMappings/cli_test_data_set_mapping"}]' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: '{"synchronizationMode": "Incremental"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer share-subscription synchronization start + Connection: + - keep-alive + Content-Length: + - '38' + Content-Type: + - application/json + ParameterSetName: + - --account-name --resource-group --share-subscription-name --synchronization-mode + --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/Synchronize?api-version=2019-11-01 + response: + body: + string: '{"status":"Queued","synchronizationId":"46da96f7-df55-4472-9d4a-90dabc0dc1c2","synchronizationMode":"Incremental"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/synchronizationOperationResults/46da96f7-df55-4472-9d4a-90dabc0dc1c2?api-version=2019-11-01 + cache-control: + - no-cache + content-length: + - '114' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:48:31 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/shareSubscriptionSynchronizations/46da96f7-df55-4472-9d4a-90dabc0dc1c2?api-version=2019-11-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer dataset-mapping show + Connection: + - keep-alive + ParameterSetName: + - --account-name --name --resource-group --share-subscription-name --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/dataSetMappings/cli_test_data_set_mapping?api-version=2019-11-01 + response: + body: + string: '{"properties":{"containerName":"clitestconsumercontainer","prefix":"cli_test_data_set","subscriptionId":"9abff005-2afc-4de1-b39c-344b9de2cc9c","resourceGroup":"datashare_consumer_rg","storageAccountName":"datashareconsumersa","dataSetId":"031a78ef-0cfc-45b0-88a3-a20a58f3a87a","dataSetMappingStatus":"Ok","provisioningState":"Succeeded"},"kind":"BlobFolder","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/dataSetMappings/cli_test_data_set_mapping","name":"cli_test_data_set_mapping","type":"Microsoft.DataShare/DataSetMappings"}' + headers: + cache-control: + - no-cache + content-length: + - '688' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:48:32 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer dataset-mapping list + Connection: + - keep-alive + ParameterSetName: + - --account-name --resource-group --share-subscription-name --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/dataSetMappings?api-version=2019-11-01 + response: + body: + string: '{"value":[{"properties":{"containerName":"clitestconsumercontainer","prefix":"cli_test_data_set","subscriptionId":"9abff005-2afc-4de1-b39c-344b9de2cc9c","resourceGroup":"datashare_consumer_rg","storageAccountName":"datashareconsumersa","dataSetId":"031a78ef-0cfc-45b0-88a3-a20a58f3a87a","dataSetMappingStatus":"Ok","provisioningState":"Succeeded"},"kind":"BlobFolder","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/dataSetMappings/cli_test_data_set_mapping","name":"cli_test_data_set_mapping","type":"Microsoft.DataShare/DataSetMappings"}]}' + headers: + cache-control: + - no-cache + content-length: + - '700' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:48:35 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer share-subscription synchronization list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --account-name --resource-group --share-subscription-name --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/listSynchronizations?api-version=2019-11-01 + response: + body: + string: '{"value":[{"startTime":"2020-04-23T13:48:32.353028Z","status":"Queued","synchronizationId":"46da96f7-df55-4472-9d4a-90dabc0dc1c2","synchronizationMode":"Incremental"}]}' + headers: + cache-control: + - no-cache + content-length: + - '168' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:48:37 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer share-subscription list-source-share-synchronization-setting + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --account-name --resource-group --share-subscription-name --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/listSourceShareSynchronizationSettings?api-version=2019-11-01 + response: + body: + string: '{"value":[{"properties":{"recurrenceInterval":"Day","synchronizationTime":"2020-04-05T10:50:00Z"},"kind":"ScheduleBased"}]}' + headers: + cache-control: + - no-cache + content-length: + - '123' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:48:39 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"kind": "ScheduleBased", "properties": {"recurrenceInterval": "Day", "synchronizationTime": + "2020-04-05T10:50:00.000Z"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer trigger create + Connection: + - keep-alive + Content-Length: + - '121' + Content-Type: + - application/json + ParameterSetName: + - --account-name --resource-group --share-subscription-name --name --recurrence-interval + --synchronization-time --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/triggers/cli_test_trigger?api-version=2019-11-01 + response: + body: + string: '{"properties":{"recurrenceInterval":"Day","synchronizationTime":"2020-04-05T10:50:00Z","createdAt":"2020-04-23T13:48:42.2978189Z","userName":"Allen + Zhou","provisioningState":"Creating","triggerStatus":"Inactive","synchronizationMode":"Incremental"},"kind":"ScheduleBased","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/triggers/cli_test_trigger","name":"cli_test_trigger","type":"Microsoft.DataShare/Triggers"}' + headers: + cache-control: + - no-cache + content-length: + - '570' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:48:42 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/triggers/cli_test_trigger?api-version=2019-11-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer trigger show + Connection: + - keep-alive + ParameterSetName: + - --account-name --resource-group --share-subscription-name --name --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/triggers/cli_test_trigger?api-version=2019-11-01 + response: + body: + string: '{"properties":{"recurrenceInterval":"Day","synchronizationTime":"2020-04-05T10:50:00Z","createdAt":"2020-04-23T13:48:42.2978189Z","userName":"Allen + Zhou","provisioningState":"Creating","triggerStatus":"Inactive","synchronizationMode":"Incremental"},"kind":"ScheduleBased","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/triggers/cli_test_trigger","name":"cli_test_trigger","type":"Microsoft.DataShare/Triggers"}' + headers: + cache-control: + - no-cache + content-length: + - '570' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:48:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer trigger list + Connection: + - keep-alive + ParameterSetName: + - --account-name --resource-group --share-subscription-name --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/triggers?api-version=2019-11-01 + response: + body: + string: '{"value":[{"properties":{"recurrenceInterval":"Day","synchronizationTime":"2020-04-05T10:50:00Z","createdAt":"2020-04-23T13:48:42.2978189Z","userName":"Allen + Zhou","provisioningState":"Creating","triggerStatus":"Inactive","synchronizationMode":"Incremental"},"kind":"ScheduleBased","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/triggers/cli_test_trigger","name":"cli_test_trigger","type":"Microsoft.DataShare/Triggers"}]}' + headers: + cache-control: + - no-cache + content-length: + - '582' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:48:45 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare provider-share-subscription list + Connection: + - keep-alive + ParameterSetName: + - --account-name --resource-group --share-name + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/providerShareSubscriptions?api-version=2019-11-01 + response: + body: + string: '{"value":[{"properties":{"shareSubscriptionObjectId":"cea4ae94-0b80-4306-9124-29e0f97e6604","consumerName":"Allen + Zhou","createdAt":"2020-04-23T13:47:55.3598425Z","sharedAt":"2020-04-23T13:45:26.3055269Z","consumerEmail":"consumer@microsoft.com","consumerTenantName":"Default + Directory","providerName":"Feng Zhou","providerEmail":"provider@microsoft.com","shareSubscriptionStatus":"Active"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/shareSubscriptions/cea4ae94-0b80-4306-9124-29e0f97e6604","name":"cli_test_share_subscription","type":"Microsoft.DataShare/ShareSubscriptions"}]}' + headers: + cache-control: + - no-cache + content-length: + - '760' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:48:47 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare provider-share-subscription show + Connection: + - keep-alive + ParameterSetName: + - --account-name --share-subscription --resource-group --share-name + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/providerShareSubscriptions/cea4ae94-0b80-4306-9124-29e0f97e6604?api-version=2019-11-01 + response: + body: + string: '{"properties":{"shareSubscriptionObjectId":"cea4ae94-0b80-4306-9124-29e0f97e6604","consumerName":"Allen + Zhou","createdAt":"2020-04-23T13:47:55.3598425Z","sharedAt":"2020-04-23T13:45:26.3055269Z","consumerEmail":"consumer@microsoft.com","consumerTenantName":"Default + Directory","providerName":"Feng Zhou","providerEmail":"provider@microsoft.com","shareSubscriptionStatus":"Active"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/shareSubscriptions/cea4ae94-0b80-4306-9124-29e0f97e6604","name":"cli_test_share_subscription","type":"Microsoft.DataShare/ShareSubscriptions"}' + headers: + cache-control: + - no-cache + content-length: + - '748' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:48:49 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare provider-share-subscription revoke + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --account-name --share-subscription --resource-group --share-name + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/providerShareSubscriptions/cea4ae94-0b80-4306-9124-29e0f97e6604/revoke?api-version=2019-11-01 + response: + body: + string: '{"properties":{"shareSubscriptionObjectId":"cea4ae94-0b80-4306-9124-29e0f97e6604","consumerName":"Allen + Zhou","createdAt":"2020-04-23T13:47:55.3598425Z","sharedAt":"2020-04-23T13:45:26.3055269Z","consumerEmail":"consumer@microsoft.com","consumerTenantName":"Default + Directory","providerName":"Feng Zhou","providerEmail":"provider@microsoft.com","shareSubscriptionStatus":"Revoking"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/shareSubscriptions/cea4ae94-0b80-4306-9124-29e0f97e6604","name":"cli_test_share_subscription","type":"Microsoft.DataShare/ShareSubscriptions"}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/operationResults/f9efc1e9-34af-4f77-87eb-5de189b8fe89?api-version=2019-11-01 + cache-control: + - no-cache + content-length: + - '750' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:48:52 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/providerShareSubscriptions/cea4ae94-0b80-4306-9124-29e0f97e6604?api-version=2019-11-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare provider-share-subscription reinstate + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --account-name --share-subscription --resource-group --share-name + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/providerShareSubscriptions/cea4ae94-0b80-4306-9124-29e0f97e6604/reinstate?api-version=2019-11-01 + response: + body: + string: '{"properties":{"shareSubscriptionObjectId":"cea4ae94-0b80-4306-9124-29e0f97e6604","consumerName":"Allen + Zhou","createdAt":"2020-04-23T13:47:55.3598425Z","sharedAt":"2020-04-23T13:45:26.3055269Z","consumerEmail":"consumer@microsoft.com","consumerTenantName":"Default + Directory","providerName":"Feng Zhou","providerEmail":"provider@microsoft.com","shareSubscriptionStatus":"Active"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/shareSubscriptions/cea4ae94-0b80-4306-9124-29e0f97e6604","name":"cli_test_share_subscription","type":"Microsoft.DataShare/ShareSubscriptions"}' + headers: + cache-control: + - no-cache + content-length: + - '748' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 13:48:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare synchronization-setting delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --account-name --resource-group --share-name --name --yes + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/synchronizationSettings/cli_test_synchronization_setting?api-version=2019-11-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 13:49:01 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DataShare/locations/westus2/operationResults/d7892df8-eccd-42a3-8de4-be8600d80a4d?api-version=2019-11-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare dataset delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --account-name --name --resource-group --share-name --yes + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/dataSets/cli_test_data_set?api-version=2019-11-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 13:49:03 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-quota: + - '[{"currentUsed":0,"limit":100,"name":{"localizedValue":"DataSet resource + quota","value":"DataSet resource quota"},"target":"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/cli_test_datrywkgqr6mfnic2batum7zhzzekrutyfed7ajmopnqmg7bfkqdq2mavcabi7fdxo/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share/dataSets/cli_test_data_set"}]' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --account-name --resource-group --name --yes + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account/shares/cli_test_share?api-version=2019-11-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 13:49:04 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DataShare/locations/westus2/operationResults/80548841-441e-4061-93b9-b6d0ce4c0249?api-version=2019-11-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name --resource-group --no-wait --yes + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dat000001/providers/Microsoft.DataShare/accounts/cli_test_account?api-version=2019-11-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 13:49:06 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DataShare/locations/westus2/operationResults/e331712b-17b0-48ba-8e62-592b4f5f284d?api-version=2019-11-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer trigger delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --account-name --resource-group --share-subscription-name --name --yes --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/triggers/cli_test_trigger?api-version=2019-11-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 13:49:08 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DataShare/locations/westus2/operationResults/e89ae980-17f5-4a9b-9e65-db922d490a7c?api-version=2019-11-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer dataset-mapping delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --account-name --name --resource-group --share-subscription-name --yes --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/dataSetMappings/cli_test_data_set_mapping?api-version=2019-11-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 13:49:09 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-quota: + - '[{"currentUsed":0,"limit":100,"name":{"localizedValue":"DataSetMapping resource + quota","value":"DataSetMapping resource quota"},"target":"/subscriptions/9abff005-2afc-4de1-b39c-344b9de2cc9c/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription/dataSetMappings/cli_test_data_set_mapping"}]' + x-ms-ratelimit-remaining-subscription-deletes: + - '14997' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare consumer share-subscription delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --account-name --resource-group --name --yes --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account/shareSubscriptions/cli_test_share_subscription?api-version=2019-11-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 13:49:11 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DataShare/locations/westus2/operationResults/bd7196da-c8a9-4b96-927e-000510684928?api-version=2019-11-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - datashare account delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name --resource-group --no-wait --yes --subscription + User-Agent: + - AZURECLI/2.4.0 (MSI) azsdk-python-datasharemanagementclient/unknown Python/3.8.2 + (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/datashare_consumer_rg/providers/Microsoft.DataShare/accounts/cli_test_consumer_account?api-version=2019-11-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 13:49:13 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DataShare/locations/westus2/operationResults/44b598b3-6268-4028-9d1f-3cdb8adb30c6?api-version=2019-11-01 + pragma: + - no-cache + server: + - Kestrel + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +version: 1 diff --git a/src/datashare/azext_datashare/tests/latest/test_datashare_scenario.py b/src/datashare/azext_datashare/tests/latest/test_datashare_scenario.py new file mode 100644 index 00000000000..43245c24f3e --- /dev/null +++ b/src/datashare/azext_datashare/tests/latest/test_datashare_scenario.py @@ -0,0 +1,599 @@ +# -------------------------------------------------------------------------------------------- +# 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, StorageAccountPreparer) + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class DataShareManagementClientScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_datashare_provider_rg'[:12], location='westus2', key='ProviderResourceGroup') + @StorageAccountPreparer(name_prefix='clitestdatashareprovidersa'[:12], location='westus2', key='ProviderStorageAccount') + @AllowLargeResponse() + def test_datashare(self, resource_group, storage_account): + + self.kwargs.update({ + 'ConsumerSubscription': '00000000-0000-0000-0000-000000000000', # change this value in live test + 'ConsumerResourceGroup': 'datashare_consumer_rg', # this is a pre-existing reosurce group in consumer subscription + 'ConsumerStorageAccount': 'datashareconsumersa', # this is a pre-existing storage account in consumer subscription + 'ProviderEmail': 'provider@microsoft.com', # change this value in live test + 'ConsumerEmail': 'consumer@microsoft.com', # change this value in live test + 'ProviderAccount': 'cli_test_account', + 'ConsumerAccount': 'cli_test_consumer_account', + 'ProviderDataset': 'cli_test_data_set', + 'ConsumerDatasetMapping': 'cli_test_data_set_mapping', + 'ProviderInvitation': 'cli_test_invitation', + 'ProviderShare': 'cli_test_share', + 'ConsumerShareSubscription': 'cli_test_share_subscription', + 'ProviderSynchronizationSetting': 'cli_test_synchronization_setting', + 'ConsumerTrigger': 'cli_test_trigger', + 'ProviderContainer': 'clitestcontainer', + 'ConsumerContainer': 'clitestconsumercontainer', + }) + + # Provider commands + datashareAccount = self.cmd('az datashare account create ' + '--location "West US 2" ' + '--tags tag1=Red tag2=White ' + '--name "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}"', + checks=[self.check('name', '{ProviderAccount}'), + self.check('location', 'westus2'), + self.check('resourceGroup', '{ProviderResourceGroup}'), + self.check('tags.tag1', 'Red'), + self.check('tags.tag2', 'White') + ]).get_output_in_json() + + self.cmd('az datashare account wait ' + '--name "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--created', + checks=[]) + + accountId = datashareAccount['id'] + self.cmd('az datashare account show ' + '-n "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}"', + checks=[self.check('name', '{ProviderAccount}'), + self.check('location', 'westus2'), + self.check('provisioningState', 'Succeeded'), + self.check('resourceGroup', '{ProviderResourceGroup}'), + self.check('tags.tag1', 'Red'), + self.check('tags.tag2', 'White') + ]) + + self.cmd('az datashare account show ' + '--ids {}'.format(accountId), + checks=[self.check('name', '{ProviderAccount}'), + self.check('location', 'westus2'), + self.check('provisioningState', 'Succeeded'), + self.check('resourceGroup', '{ProviderResourceGroup}'), + self.check('tags.tag1', 'Red'), + self.check('tags.tag2', 'White') + ]) + + self.cmd('az datashare account list ' + '--resource-group "{ProviderResourceGroup}"', + checks=[self.check("[?id=='{}'].name | [0]".format(accountId), '{ProviderAccount}'), + self.check("[?id=='{}'].location | [0]".format(accountId), 'westus2'), + self.check("[?id=='{}'].resourceGroup | [0]".format(accountId), '{ProviderResourceGroup}'), + self.check("[?id=='{}'].tags | [0].tag1".format(accountId), 'Red'), + self.check("[?id=='{}'].tags | [0].tag2".format(accountId), 'White')]) + + self.cmd('az datashare account update ' + '--name "{ProviderAccount}" ' + '--tags tag1=Green ' + '--resource-group "{ProviderResourceGroup}"', + checks=[self.check('name', '{ProviderAccount}'), + self.check('location', 'westus2'), + self.check('provisioningState', 'Succeeded'), + self.check('resourceGroup', '{ProviderResourceGroup}'), + self.check('tags.tag1', 'Green')]) + + datashare = self.cmd('az datashare create ' + '--account-name "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--description "share description" ' + '--share-kind "CopyBased" ' + '--terms "Confidential" ' + '--name "{ProviderShare}"', + checks=[self.check('name', '{ProviderShare}'), + self.check('description', 'share description'), + self.check('shareKind', 'CopyBased'), + self.check('terms', 'Confidential')]).get_output_in_json() + + self.cmd('az datashare show ' + '--account-name "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--name "{ProviderShare}"', + checks=[self.check('name', '{ProviderShare}'), + self.check('description', 'share description'), + self.check('shareKind', 'CopyBased'), + self.check('terms', 'Confidential')]) + + datashareId = datashare['id'] + self.cmd('az datashare show ' + '--ids {}'.format(datashareId), + checks=[self.check('name', '{ProviderShare}'), + self.check('description', 'share description'), + self.check('shareKind', 'CopyBased'), + self.check('terms', 'Confidential')]) + + self.cmd('az datashare list ' + '--account-name "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}"', + checks=[self.check("[?id=='{}'].name | [0]".format(datashareId), '{ProviderShare}'), + self.check("[?id=='{}'].description | [0]".format(datashareId), 'share description'), + self.check("[?id=='{}'].shareKind | [0]".format(datashareId), 'CopyBased'), + self.check("[?id=='{}'].terms | [0]".format(datashareId), 'Confidential')]) + + storage_account_json = self.cmd('az storage account show ' + '-n {ProviderStorageAccount} ' + '-g {ProviderResourceGroup}').get_output_in_json() + + accountPrincipalId = datashareAccount['identity']['principalId'] + if self.is_live or self.in_recording: + import time + self.cmd('az role assignment create ' + '--role "2a2b9908-6ea1-4ae2-8e65-a410df84e7d1" ' # Storage Blob Data Reader + '--assignee-object-id {} ' + '--assignee-principal-type ServicePrincipal ' + '--scope {}'.format(accountPrincipalId, storage_account_json['id'])) + time.sleep(5) + + self.cmd('az storage container create ' + '--account-name {ProviderStorageAccount} ' + '--name {ProviderContainer}') + + datasetContent = {"container_name": "{}".format(self.kwargs.get('ProviderContainer', '')), "storage_account_name": "{}".format(storage_account), "kind": "Container"} + self.kwargs.update({ + 'ProviderDatasetContent': datasetContent + }) + self.cmd('az datashare dataset create ' + '--account-name "{ProviderAccount}" ' + '--dataset "{ProviderDatasetContent}" ' + '--name "{ProviderDataset}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}"', + checks=[self.check('containerName', '{ProviderContainer}'), + self.check('storageAccountName', '{ProviderStorageAccount}'), + self.check('kind', 'Container'), + self.check('name', '{ProviderDataset}')]) + + self.cmd('az datashare dataset show ' + '--account-name "{ProviderAccount}" ' + '--name "{ProviderDataset}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}"', + checks=[self.check('containerName', '{ProviderContainer}'), + self.check('storageAccountName', '{ProviderStorageAccount}'), + self.check('kind', 'Container'), + self.check('name', '{ProviderDataset}')]) + + self.cmd('az datashare dataset list ' + '--account-name "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}"', + checks=[self.check('[0].containerName', '{ProviderContainer}'), + self.check('[0].storageAccountName', '{ProviderStorageAccount}'), + self.check('[0].kind', 'Container'), + self.check('[0].name', '{ProviderDataset}')]) + + self.cmd('az datashare synchronization-setting create ' + '--account-name "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}" ' + '--name "{ProviderSynchronizationSetting}" ' + '--recurrence-interval "Day" ' + '--synchronization-time "2020-04-05 10:50:00 +00:00"', + checks=[self.check('kind', 'ScheduleBased'), + self.check('name', '{ProviderSynchronizationSetting}'), + self.check('recurrenceInterval', 'Day'), + self.check('resourceGroup', '{ProviderResourceGroup}'), + self.check('synchronizationTime', '2020-04-05T10:50:00+00:00')]) + + self.cmd('az datashare synchronization-setting show ' + '--account-name "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}" ' + '--name "{ProviderSynchronizationSetting}"', + checks=[self.check('kind', 'ScheduleBased'), + self.check('name', '{ProviderSynchronizationSetting}'), + self.check('recurrenceInterval', 'Day'), + self.check('resourceGroup', '{ProviderResourceGroup}'), + self.check('synchronizationTime', '2020-04-05T10:50:00+00:00')]) + + self.cmd('az datashare synchronization-setting list ' + '--account-name "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}"', + checks=[self.check('[0].kind', 'ScheduleBased'), + self.check('[0].name', '{ProviderSynchronizationSetting}'), + self.check('[0].recurrenceInterval', 'Day'), + self.check('[0].resourceGroup', '{ProviderResourceGroup}'), + self.check('[0].synchronizationTime', '2020-04-05T10:50:00+00:00')]) + + self.cmd('az datashare synchronization list ' + '--account-name "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}"', + checks=[]) + + # self.cmd('az datashare synchronization list-detail ' + # '--account-name "{ProviderAccount}" ' + # '--resource-group "{ProviderResourceGroup}" ' + # '--share-name "{ProviderShare}" ' + # '--synchronization-id "7d0536a6-3fa5-43de-b152-3d07c4f6b2bb"', + # checks=[]) + + self.cmd('az datashare invitation create ' + '--account-name "{ProviderAccount}" ' + '--target-email "{ConsumerEmail}" ' + '--name "{ProviderInvitation}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}"', + checks=[self.check('invitationStatus', 'Pending'), + self.check('name', '{ProviderInvitation}'), + self.check('resourceGroup', '{ProviderResourceGroup}'), + self.check('targetEmail', '{ConsumerEmail}')]) + + self.cmd('az datashare invitation list ' + '--account-name "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}"', + checks=[self.check('[0].invitationStatus', 'Pending'), + self.check('[0].name', '{ProviderInvitation}'), + self.check('[0].resourceGroup', '{ProviderResourceGroup}'), + self.check('[0].targetEmail', '{ConsumerEmail}')]) + + self.cmd('az datashare invitation show ' + '--account-name "{ProviderAccount}" ' + '--name "{ProviderInvitation}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}"', + checks=[self.check('invitationStatus', 'Pending'), + self.check('name', '{ProviderInvitation}'), + self.check('resourceGroup', '{ProviderResourceGroup}'), + self.check('targetEmail', '{ConsumerEmail}')]) + + # Consumer commands + datashareConsumerAccount = self.cmd('az datashare account create ' + '--location "West US 2" ' + '--name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--subscription "{ConsumerSubscription}"', + checks=[self.check('name', '{ConsumerAccount}'), + self.check('location', 'westus2'), + self.check('resourceGroup', '{ConsumerResourceGroup}')]).get_output_in_json() + + invitations = self.cmd('az datashare consumer invitation list ' + '--subscription "{ConsumerSubscription}"', + checks=[self.check('[0].invitationStatus', 'Pending'), + self.check('[0].name', '{ProviderInvitation}'), + self.check('[0].shareName', '{ProviderShare}'), + self.check('[0].providerEmail', '{ProviderEmail}')]).get_output_in_json() + + invitationId = invitations[0]['invitationId'] + sourceShareLocation = invitations[0]['location'] + self.kwargs.update({'InvitationId1': invitationId, + 'Location1': sourceShareLocation}) + + self.cmd('az datashare consumer invitation show ' + '--invitation-id "{InvitationId1}" ' + '--subscription "{ConsumerSubscription}" ' + '--location "{Location1}"', + checks=[self.check('invitationStatus', 'Pending'), + self.check('name', '{ProviderInvitation}'), + self.check('shareName', '{ProviderShare}'), + self.check('providerEmail', '{ProviderEmail}')]) + +# self.cmd('az datashare consumer invitation reject ' +# '--invitation-id 00000000-0000-0000-0000-000000000000 ' +# checks=[]) + + self.cmd('az datashare account wait ' + '--name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--created ' + '--subscription "{ConsumerSubscription}"', + checks=[]) + + self.cmd('az datashare consumer share-subscription create ' + '--account-name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--invitation-id "{InvitationId1}" ' + '--source-share-location "{Location1}" ' + '--name "{ConsumerShareSubscription}" ' + '--subscription "{ConsumerSubscription}"', + checks=[self.check('invitationId', '{InvitationId1}'), + self.check('name', '{ConsumerShareSubscription}'), + self.check('resourceGroup', '{ConsumerResourceGroup}'), + self.check('shareName', '{ProviderShare}'), + self.check('shareKind', 'CopyBased'), + self.check('sourceShareLocation', '{Location1}')]) + + self.cmd('az datashare consumer share-subscription show ' + '--account-name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--name "{ConsumerShareSubscription}" ' + '--subscription "{ConsumerSubscription}"', + checks=[self.check('invitationId', '{InvitationId1}'), + self.check('name', '{ConsumerShareSubscription}'), + self.check('resourceGroup', '{ConsumerResourceGroup}'), + self.check('shareName', '{ProviderShare}'), + self.check('shareKind', 'CopyBased'), + self.check('sourceShareLocation', '{Location1}')]) + + self.cmd('az datashare consumer share-subscription list ' + '--account-name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--subscription "{ConsumerSubscription}"', + checks=[self.check('[0].invitationId', '{InvitationId1}'), + self.check('[0].name', '{ConsumerShareSubscription}'), + self.check('[0].resourceGroup', '{ConsumerResourceGroup}'), + self.check('[0].shareName', '{ProviderShare}'), + self.check('[0].shareKind', 'CopyBased'), + self.check('[0].sourceShareLocation', '{Location1}')]) + + sourceDatasets = self.cmd('az datashare consumer share-subscription list-source-dataset ' + '--account-name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--share-subscription-name "{ConsumerShareSubscription}" ' + '--subscription "{ConsumerSubscription}"', + checks=[self.check('[0].dataSetName', '{ProviderDataset}'), + self.check('[0].dataSetType', 'Container')]).get_output_in_json() + sourceDatasetId = sourceDatasets[0]['dataSetId'] + + storage_account2_json = self.cmd('az storage account show ' + '-n {ConsumerStorageAccount} ' + '-g {ConsumerResourceGroup} ' + '--subscription "{ConsumerSubscription}"').get_output_in_json() + + accountPrincipalId2 = datashareConsumerAccount['identity']['principalId'] + self.kwargs.update({ + "AccountPrincipalId2": accountPrincipalId2, + "StorageAccountId2": storage_account2_json['id']}) + + if self.is_live or self.in_recording: + import time + self.cmd('az role assignment create ' + '--role "ba92f5b4-2d11-453d-a403-e96b0029c9fe" ' # Storage Blob Data Contributor + '--assignee-object-id "{AccountPrincipalId2}" ' + '--assignee-principal-type ServicePrincipal ' + '--scope "{StorageAccountId2}" ' + '--subscription "{ConsumerSubscription}"') + time.sleep(5) + + datasetMappingContent = {"data_set_id": "{}".format(sourceDatasetId), + "container_name": "{}".format(self.kwargs.get('ConsumerContainer', '')), + "storage_account_name": "{}".format(self.kwargs.get('ConsumerStorageAccount', '')), + "kind": "BlobFolder", + "prefix": "{}".format(self.kwargs.get('ProviderDataset', ''))} + self.kwargs.update({ + 'ConsumerDatasetMappingContent': datasetMappingContent + }) + self.cmd('az datashare consumer dataset-mapping create ' + '--account-name "{ConsumerAccount}" ' + '--name "{ConsumerDatasetMapping}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--share-subscription-name "{ConsumerShareSubscription}" ' + '--mapping "{ConsumerDatasetMappingContent}" ' + '--subscription "{ConsumerSubscription}"', + checks=[self.check('kind', 'BlobFolder'), + self.check('name', '{ConsumerDatasetMapping}'), + self.check('prefix', '{ProviderDataset}'), + self.check('storageAccountName', '{ConsumerStorageAccount}')]) + + self.cmd('az datashare consumer share-subscription synchronization start ' + '--account-name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--share-subscription-name "{ConsumerShareSubscription}" ' + '--synchronization-mode "Incremental" ' + '--subscription "{ConsumerSubscription}"', + checks=[self.check('status', 'Queued'), + self.check('synchronizationMode', 'Incremental')]) + + self.cmd('az datashare consumer dataset-mapping show ' + '--account-name "{ConsumerAccount}" ' + '--name "{ConsumerDatasetMapping}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--share-subscription-name "{ConsumerShareSubscription}" ' + '--subscription "{ConsumerSubscription}"', + checks=[self.check('kind', 'BlobFolder'), + self.check('name', '{ConsumerDatasetMapping}'), + self.check('prefix', '{ProviderDataset}'), + self.check('storageAccountName', '{ConsumerStorageAccount}')]) + + self.cmd('az datashare consumer dataset-mapping list ' + '--account-name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--share-subscription-name "{ConsumerShareSubscription}" ' + '--subscription "{ConsumerSubscription}"', + checks=[self.check('[0].kind', 'BlobFolder'), + self.check('[0].name', '{ConsumerDatasetMapping}'), + self.check('[0].prefix', '{ProviderDataset}'), + self.check('[0].storageAccountName', '{ConsumerStorageAccount}')]) + + self.cmd('az datashare consumer share-subscription synchronization list ' + '--account-name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--share-subscription-name "{ConsumerShareSubscription}" ' + '--subscription "{ConsumerSubscription}"', + checks=[self.check('[0].synchronizationMode', 'Incremental')]) + +# self.cmd('az datashare consumer share-subscription synchronization list-detail ' +# '--account-name "{ConsumerAccount}" ' +# '--resource-group "{ConsumerResourceGroup}" ' +# '--share-subscription-name "{ConsumerShareSubscription}" ' +# '--synchronization-id "7d0536a6-3fa5-43de-b152-3d07c4f6b2bb" ' +# '--subscription "{ConsumerSubscription}"', +# checks=[]) + +# self.cmd('az datashare consumer share-subscription synchronization cancel ' +# '--account-name "{ConsumerAccount}" ' +# '--resource-group "{ConsumerResourceGroup}" ' +# '--share-subscription-name "{ConsumerShareSubscription}" ' +# '--synchronization-id "7d0536a6-3fa5-43de-b152-3d07c4f6b2bb" ' +# '--subscription "{ConsumerSubscription}"', +# checks=[]) + + self.cmd('az datashare consumer share-subscription list-source-share-synchronization-setting ' + '--account-name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--share-subscription-name "{ConsumerShareSubscription}" ' + '--subscription "{ConsumerSubscription}"', + checks=[self.check('[0].recurrenceInterval', 'Day'), + self.check('[0].kind', 'ScheduleBased')]) + + self.cmd('az datashare consumer trigger create ' + '--account-name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--share-subscription-name "{ConsumerShareSubscription}" ' + '--name "{ConsumerTrigger}" ' + '--recurrence-interval "Day" ' + '--synchronization-time "2020-04-05 10:50:00 +00:00" ' + '--subscription "{ConsumerSubscription}"', + checks=[self.check('properties.recurrenceInterval', 'Day'), # TODO properties is not removed in the response structure + self.check('properties.synchronizationMode', 'Incremental')]) + + self.cmd('az datashare consumer trigger show ' + '--account-name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--share-subscription-name "{ConsumerShareSubscription}" ' + '--name "{ConsumerTrigger}" ' + '--subscription "{ConsumerSubscription}"', + checks=[self.check('recurrenceInterval', 'Day'), + self.check('synchronizationMode', 'Incremental')]) + + self.cmd('az datashare consumer trigger list ' + '--account-name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--share-subscription-name "{ConsumerShareSubscription}" ' + '--subscription "{ConsumerSubscription}"', + checks=[self.check('[0].recurrenceInterval', 'Day'), + self.check('[0].synchronizationMode', 'Incremental')]) + + # Provider commands + providerShareSubscriptions = self.cmd('az datashare provider-share-subscription list ' + '--account-name "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}"', + checks=[self.check('[0].consumerEmail', '{ConsumerEmail}'), + self.check('[0].providerEmail', '{ProviderEmail}'), + self.check('[0].shareSubscriptionStatus', 'Active'), + self.check('[0].name', '{ConsumerShareSubscription}')]).get_output_in_json() + shareSubscriptionObjectId = providerShareSubscriptions[0]['shareSubscriptionObjectId'] + self.kwargs.update({'ProviderShareSubscriptionObjectId': shareSubscriptionObjectId}) + + self.cmd('az datashare provider-share-subscription show ' + '--account-name "{ProviderAccount}" ' + '--share-subscription "{ProviderShareSubscriptionObjectId}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}"', + checks=[self.check('consumerEmail', '{ConsumerEmail}'), + self.check('providerEmail', '{ProviderEmail}'), + self.check('shareSubscriptionStatus', 'Active'), + self.check('name', '{ConsumerShareSubscription}'), + self.check('shareSubscriptionObjectId', '{ProviderShareSubscriptionObjectId}')]) + + self.cmd('az datashare provider-share-subscription revoke ' + '--account-name "{ProviderAccount}" ' + '--share-subscription "{ProviderShareSubscriptionObjectId}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}"', + checks=[self.check('consumerEmail', '{ConsumerEmail}'), + self.check('providerEmail', '{ProviderEmail}'), + self.check('shareSubscriptionStatus', 'Revoking'), + self.check('name', '{ConsumerShareSubscription}'), + self.check('shareSubscriptionObjectId', '{ProviderShareSubscriptionObjectId}')]) + + if self.is_live or self.in_recording: + import time + time.sleep(5) + + self.cmd('az datashare provider-share-subscription reinstate ' + '--account-name "{ProviderAccount}" ' + '--share-subscription "{ProviderShareSubscriptionObjectId}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}"', + checks=[self.check('consumerEmail', '{ConsumerEmail}'), + self.check('providerEmail', '{ProviderEmail}'), + self.check('shareSubscriptionStatus', 'Active'), + self.check('name', '{ConsumerShareSubscription}'), + self.check('shareSubscriptionObjectId', '{ProviderShareSubscriptionObjectId}')]) + + # Provider Clean up + self.cmd('az datashare synchronization-setting delete ' + '--account-name "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}" ' + '--name "{ProviderSynchronizationSetting}" ' + '--yes', + checks=[]) + + # self.cmd('az datashare invitation delete ' + # '--account-name "{ProviderAccount}" ' + # '--name "{ProviderInvitation}" ' + # '--resource-group "{ProviderResourceGroup}" ' + # '--share-name "{ProviderShare}"', + # checks=[]) + + self.cmd('az datashare dataset delete ' + '--account-name "{ProviderAccount}" ' + '--name "{ProviderDataset}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--share-name "{ProviderShare}" ' + '--yes', + checks=[]) + + self.cmd('az datashare delete ' + '--account-name "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--name "{ProviderShare}" ' + '--yes', + checks=[]) + + self.cmd('az datashare account delete ' + '--name "{ProviderAccount}" ' + '--resource-group "{ProviderResourceGroup}" ' + '--no-wait ' + '--yes', + checks=[]) + + self.cmd('az datashare consumer trigger delete ' + '--account-name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--share-subscription-name "{ConsumerShareSubscription}" ' + '--name "{ConsumerTrigger}" ' + '--yes ' + '--subscription "{ConsumerSubscription}"', + checks=[]) + self.cmd('az datashare consumer dataset-mapping delete ' + '--account-name "{ConsumerAccount}" ' + '--name "{ConsumerDatasetMapping}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--share-subscription-name "{ConsumerShareSubscription}" ' + '--yes ' + '--subscription "{ConsumerSubscription}"', + checks=[]) + self.cmd('az datashare consumer share-subscription delete ' + '--account-name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--name "{ConsumerShareSubscription}" ' + '--yes ' + '--subscription "{ConsumerSubscription}"', + checks=[]) + self.cmd('az datashare account delete ' + '--name "{ConsumerAccount}" ' + '--resource-group "{ConsumerResourceGroup}" ' + '--no-wait ' + '--yes ' + '--subscription "{ConsumerSubscription}"', + checks=[]) diff --git a/src/datashare/azext_datashare/vendored_sdks/__init__.py b/src/datashare/azext_datashare/vendored_sdks/__init__.py new file mode 100644 index 00000000000..8d86d5a6be1 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/__init__.py b/src/datashare/azext_datashare/vendored_sdks/datashare/__init__.py new file mode 100644 index 00000000000..eb57d0ef34e --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._data_share_management_client import DataShareManagementClient +__all__ = ['DataShareManagementClient'] diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/_configuration.py b/src/datashare/azext_datashare/vendored_sdks/datashare/_configuration.py new file mode 100644 index 00000000000..88932a1125e --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/_configuration.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +VERSION = "unknown" + +class DataShareManagementClientConfiguration(Configuration): + """Configuration for DataShareManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The subscription identifier. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(DataShareManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2019-11-01" + kwargs.setdefault('sdk_moniker', 'datasharemanagementclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, **kwargs) diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/_data_share_management_client.py b/src/datashare/azext_datashare/vendored_sdks/datashare/_data_share_management_client.py new file mode 100644 index 00000000000..c36cabec848 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/_data_share_management_client.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.core import PipelineClient +from msrest import Deserializer, Serializer + +from ._configuration import DataShareManagementClientConfiguration +from .operations import AccountOperations +from .operations import ConsumerInvitationOperations +from .operations import DataSetOperations +from .operations import DataSetMappingOperations +from .operations import InvitationOperations +from .operations import OperationOperations +from .operations import ShareOperations +from .operations import ProviderShareSubscriptionOperations +from .operations import ShareSubscriptionOperations +from .operations import ConsumerSourceDataSetOperations +from .operations import SynchronizationSettingOperations +from .operations import TriggerOperations +from . import models + + +class DataShareManagementClient(object): + """Creates a Microsoft.DataShare management client. + + :ivar account: AccountOperations operations + :vartype account: data_share_management_client.operations.AccountOperations + :ivar consumer_invitation: ConsumerInvitationOperations operations + :vartype consumer_invitation: data_share_management_client.operations.ConsumerInvitationOperations + :ivar data_set: DataSetOperations operations + :vartype data_set: data_share_management_client.operations.DataSetOperations + :ivar data_set_mapping: DataSetMappingOperations operations + :vartype data_set_mapping: data_share_management_client.operations.DataSetMappingOperations + :ivar invitation: InvitationOperations operations + :vartype invitation: data_share_management_client.operations.InvitationOperations + :ivar operation: OperationOperations operations + :vartype operation: data_share_management_client.operations.OperationOperations + :ivar share: ShareOperations operations + :vartype share: data_share_management_client.operations.ShareOperations + :ivar provider_share_subscription: ProviderShareSubscriptionOperations operations + :vartype provider_share_subscription: data_share_management_client.operations.ProviderShareSubscriptionOperations + :ivar share_subscription: ShareSubscriptionOperations operations + :vartype share_subscription: data_share_management_client.operations.ShareSubscriptionOperations + :ivar consumer_source_data_set: ConsumerSourceDataSetOperations operations + :vartype consumer_source_data_set: data_share_management_client.operations.ConsumerSourceDataSetOperations + :ivar synchronization_setting: SynchronizationSettingOperations operations + :vartype synchronization_setting: data_share_management_client.operations.SynchronizationSettingOperations + :ivar trigger: TriggerOperations operations + :vartype trigger: data_share_management_client.operations.TriggerOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The subscription identifier. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataShareManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.account = AccountOperations( + self._client, self._config, self._serialize, self._deserialize) + self.consumer_invitation = ConsumerInvitationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.data_set = DataSetOperations( + self._client, self._config, self._serialize, self._deserialize) + self.data_set_mapping = DataSetMappingOperations( + self._client, self._config, self._serialize, self._deserialize) + self.invitation = InvitationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.share = ShareOperations( + self._client, self._config, self._serialize, self._deserialize) + self.provider_share_subscription = ProviderShareSubscriptionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.share_subscription = ShareSubscriptionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.consumer_source_data_set = ConsumerSourceDataSetOperations( + self._client, self._config, self._serialize, self._deserialize) + self.synchronization_setting = SynchronizationSettingOperations( + self._client, self._config, self._serialize, self._deserialize) + self.trigger = TriggerOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> DataShareManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/__init__.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/__init__.py new file mode 100644 index 00000000000..e14f4db6b79 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._data_share_management_client_async import DataShareManagementClient +__all__ = ['DataShareManagementClient'] diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/_configuration_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/_configuration_async.py new file mode 100644 index 00000000000..a5c30f8ec3f --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/_configuration_async.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +VERSION = "unknown" + +class DataShareManagementClientConfiguration(Configuration): + """Configuration for DataShareManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The subscription identifier. + :type subscription_id: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(DataShareManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2019-11-01" + kwargs.setdefault('sdk_moniker', 'datasharemanagementclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, **kwargs) diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/_data_share_management_client_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/_data_share_management_client_async.py new file mode 100644 index 00000000000..0609b8e2594 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/_data_share_management_client_async.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.core import AsyncPipelineClient +from msrest import Deserializer, Serializer + +from ._configuration_async import DataShareManagementClientConfiguration +from .operations_async import AccountOperations +from .operations_async import ConsumerInvitationOperations +from .operations_async import DataSetOperations +from .operations_async import DataSetMappingOperations +from .operations_async import InvitationOperations +from .operations_async import OperationOperations +from .operations_async import ShareOperations +from .operations_async import ProviderShareSubscriptionOperations +from .operations_async import ShareSubscriptionOperations +from .operations_async import ConsumerSourceDataSetOperations +from .operations_async import SynchronizationSettingOperations +from .operations_async import TriggerOperations +from .. import models + + +class DataShareManagementClient(object): + """Creates a Microsoft.DataShare management client. + + :ivar account: AccountOperations operations + :vartype account: data_share_management_client.aio.operations_async.AccountOperations + :ivar consumer_invitation: ConsumerInvitationOperations operations + :vartype consumer_invitation: data_share_management_client.aio.operations_async.ConsumerInvitationOperations + :ivar data_set: DataSetOperations operations + :vartype data_set: data_share_management_client.aio.operations_async.DataSetOperations + :ivar data_set_mapping: DataSetMappingOperations operations + :vartype data_set_mapping: data_share_management_client.aio.operations_async.DataSetMappingOperations + :ivar invitation: InvitationOperations operations + :vartype invitation: data_share_management_client.aio.operations_async.InvitationOperations + :ivar operation: OperationOperations operations + :vartype operation: data_share_management_client.aio.operations_async.OperationOperations + :ivar share: ShareOperations operations + :vartype share: data_share_management_client.aio.operations_async.ShareOperations + :ivar provider_share_subscription: ProviderShareSubscriptionOperations operations + :vartype provider_share_subscription: data_share_management_client.aio.operations_async.ProviderShareSubscriptionOperations + :ivar share_subscription: ShareSubscriptionOperations operations + :vartype share_subscription: data_share_management_client.aio.operations_async.ShareSubscriptionOperations + :ivar consumer_source_data_set: ConsumerSourceDataSetOperations operations + :vartype consumer_source_data_set: data_share_management_client.aio.operations_async.ConsumerSourceDataSetOperations + :ivar synchronization_setting: SynchronizationSettingOperations operations + :vartype synchronization_setting: data_share_management_client.aio.operations_async.SynchronizationSettingOperations + :ivar trigger: TriggerOperations operations + :vartype trigger: data_share_management_client.aio.operations_async.TriggerOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The subscription identifier. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = DataShareManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.account = AccountOperations( + self._client, self._config, self._serialize, self._deserialize) + self.consumer_invitation = ConsumerInvitationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.data_set = DataSetOperations( + self._client, self._config, self._serialize, self._deserialize) + self.data_set_mapping = DataSetMappingOperations( + self._client, self._config, self._serialize, self._deserialize) + self.invitation = InvitationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.share = ShareOperations( + self._client, self._config, self._serialize, self._deserialize) + self.provider_share_subscription = ProviderShareSubscriptionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.share_subscription = ShareSubscriptionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.consumer_source_data_set = ConsumerSourceDataSetOperations( + self._client, self._config, self._serialize, self._deserialize) + self.synchronization_setting = SynchronizationSettingOperations( + self._client, self._config, self._serialize, self._deserialize) + self.trigger = TriggerOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "DataShareManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/__init__.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/__init__.py new file mode 100644 index 00000000000..c50fe5e6a33 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/__init__.py @@ -0,0 +1,35 @@ +# 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 ._account_operations_async import AccountOperations +from ._consumer_invitation_operations_async import ConsumerInvitationOperations +from ._data_set_operations_async import DataSetOperations +from ._data_set_mapping_operations_async import DataSetMappingOperations +from ._invitation_operations_async import InvitationOperations +from ._operation_operations_async import OperationOperations +from ._share_operations_async import ShareOperations +from ._provider_share_subscription_operations_async import ProviderShareSubscriptionOperations +from ._share_subscription_operations_async import ShareSubscriptionOperations +from ._consumer_source_data_set_operations_async import ConsumerSourceDataSetOperations +from ._synchronization_setting_operations_async import SynchronizationSettingOperations +from ._trigger_operations_async import TriggerOperations + +__all__ = [ + 'AccountOperations', + 'ConsumerInvitationOperations', + 'DataSetOperations', + 'DataSetMappingOperations', + 'InvitationOperations', + 'OperationOperations', + 'ShareOperations', + 'ProviderShareSubscriptionOperations', + 'ShareSubscriptionOperations', + 'ConsumerSourceDataSetOperations', + 'SynchronizationSettingOperations', + 'TriggerOperations', +] diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_account_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_account_operations_async.py new file mode 100644 index 00000000000..5c293630594 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_account_operations_async.py @@ -0,0 +1,531 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AccountOperations: + """AccountOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "models.Account": + """Get an account. + + Get an account under a resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Account or the result of cls(response) + :rtype: ~data_share_management_client.models.Account + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + + async def _create_initial( + self, + resource_group_name: str, + account_name: str, + identity: "models.Identity", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ) -> "models.Account": + cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _account = models.Account(location=location, tags=tags, identity=identity) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_account, 'Account') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Account', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + + async def create( + self, + resource_group_name: str, + account_name: str, + identity: "models.Identity", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ) -> "models.Account": + """Create an account. + + Create an account in the given resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param identity: Identity Info on the Account. + :type identity: ~data_share_management_client.models.Identity + :param location: Location of the azure resource. + :type location: str + :param tags: Tags on the azure resource. + :type tags: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns Account + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.Account] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + identity=identity, + location=location, + tags=tags, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + + async def _delete_initial( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "models.OperationResponse": + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self._delete_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + + async def delete( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "models.OperationResponse": + """DeleteAccount. + + Delete an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns OperationResponse + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + + async def update( + self, + resource_group_name: str, + account_name: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ) -> "models.Account": + """Patch an account. + + Patch a given account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param tags: Tags on the azure resource. + :type tags: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Account or the result of cls(response) + :rtype: ~data_share_management_client.models.Account + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _account_update_parameters = models.AccountUpdateParameters(tags=tags) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_account_update_parameters, 'AccountUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + + def list_by_subscription( + self, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.AccountList": + """List Accounts in Subscription. + + List Accounts in a subscription. + + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccountList or the result of cls(response) + :rtype: ~data_share_management_client.models.AccountList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccountList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # 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) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AccountList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataShare/accounts'} + + def list_by_resource_group( + self, + resource_group_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.AccountList": + """List Accounts in ResourceGroup. + + List Accounts in a resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccountList or the result of cls(response) + :rtype: ~data_share_management_client.models.AccountList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccountList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # 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'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AccountList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_consumer_invitation_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_consumer_invitation_operations_async.py new file mode 100644 index 00000000000..97d9f26ea32 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_consumer_invitation_operations_async.py @@ -0,0 +1,228 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ConsumerInvitationOperations: + """ConsumerInvitationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def reject_invitation( + self, + location: str, + invitation_id: str, + **kwargs + ) -> "models.ConsumerInvitation": + """Reject an invitation. + + Rejects the invitation identified by invitationId. + + :param location: Location of the invitation. + :type location: str + :param invitation_id: Unique id of the invitation. + :type invitation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConsumerInvitation or the result of cls(response) + :rtype: ~data_share_management_client.models.ConsumerInvitation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerInvitation"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _invitation = models.ConsumerInvitation(invitation_id=invitation_id) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.reject_invitation.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_invitation, 'ConsumerInvitation') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('ConsumerInvitation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + reject_invitation.metadata = {'url': '/providers/Microsoft.DataShare/locations/{location}/RejectInvitation'} + + async def get( + self, + location: str, + invitation_id: str, + **kwargs + ) -> "models.ConsumerInvitation": + """Get an invitation. + + Gets the invitation identified by invitationId. + + :param location: Location of the invitation. + :type location: str + :param invitation_id: An invitation id. + :type invitation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConsumerInvitation or the result of cls(response) + :rtype: ~data_share_management_client.models.ConsumerInvitation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerInvitation"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'invitationId': self._serialize.url("invitation_id", invitation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('ConsumerInvitation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/providers/Microsoft.DataShare/locations/{location}/consumerInvitations/{invitationId}'} + + def list_invitation( + self, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.ConsumerInvitationList": + """Lists invitations. + + List the invitations. + + :param skip_token: The continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConsumerInvitationList or the result of cls(response) + :rtype: ~data_share_management_client.models.ConsumerInvitationList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerInvitationList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_invitation.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ConsumerInvitationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_invitation.metadata = {'url': '/providers/Microsoft.DataShare/ListInvitations'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_consumer_source_data_set_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_consumer_source_data_set_operations_async.py new file mode 100644 index 00000000000..65443ffd30b --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_consumer_source_data_set_operations_async.py @@ -0,0 +1,123 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ConsumerSourceDataSetOperations: + """ConsumerSourceDataSetOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_share_subscription( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.ConsumerSourceDataSetList": + """Get source dataSets of a shareSubscription. + + Get source dataSets of a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConsumerSourceDataSetList or the result of cls(response) + :rtype: ~data_share_management_client.models.ConsumerSourceDataSetList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerSourceDataSetList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share_subscription.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ConsumerSourceDataSetList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/ConsumerSourceDataSets'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_data_set_mapping_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_data_set_mapping_operations_async.py new file mode 100644 index 00000000000..acf0170149b --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_data_set_mapping_operations_async.py @@ -0,0 +1,333 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DataSetMappingOperations: + """DataSetMappingOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + data_set_mapping_name: str, + **kwargs + ) -> "models.DataSetMapping": + """Get a DataSetMapping in a shareSubscription. + + Get DataSetMapping in a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param data_set_mapping_name: The name of the dataSetMapping. + :type data_set_mapping_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataSetMapping or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSetMapping + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetMapping"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'dataSetMappingName': self._serialize.url("data_set_mapping_name", data_set_mapping_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('DataSetMapping', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} + + async def create( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + data_set_mapping_name: str, + data_set_mapping: "models.DataSetMapping", + **kwargs + ) -> "models.DataSetMapping": + """Create a DataSetMapping. + + Maps a source data set in the source share to a sink data set in the share subscription. + Enables copying the data set from source to destination. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription which will hold the data set + sink. + :type share_subscription_name: str + :param data_set_mapping_name: The name of the data set mapping to be created. + :type data_set_mapping_name: str + :param data_set_mapping: Destination data set configuration details. + :type data_set_mapping: ~data_share_management_client.models.DataSetMapping + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataSetMapping or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSetMapping or ~data_share_management_client.models.DataSetMapping + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetMapping"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'dataSetMappingName': self._serialize.url("data_set_mapping_name", data_set_mapping_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(data_set_mapping, 'DataSetMapping') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DataSetMapping', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataSetMapping', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} + + async def delete( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + data_set_mapping_name: str, + **kwargs + ) -> None: + """Delete a DataSetMapping in a shareSubscription. + + Delete DataSetMapping in a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param data_set_mapping_name: The name of the dataSetMapping. + :type data_set_mapping_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'dataSetMappingName': self._serialize.url("data_set_mapping_name", data_set_mapping_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} + + def list_by_share_subscription( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.DataSetMappingList": + """List DataSetMappings in a share subscription. + + List DataSetMappings in a share subscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription. + :type share_subscription_name: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataSetMappingList or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSetMappingList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetMappingList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share_subscription.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DataSetMappingList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_data_set_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_data_set_operations_async.py new file mode 100644 index 00000000000..077f29e0407 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_data_set_operations_async.py @@ -0,0 +1,369 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DataSetOperations: + """DataSetOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + account_name: str, + share_name: str, + data_set_name: str, + **kwargs + ) -> "models.DataSet": + """Get a DataSet in a share. + + Get DataSet in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param data_set_name: The name of the dataSet. + :type data_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataSet or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataSet"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'dataSetName': self._serialize.url("data_set_name", data_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('DataSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + + async def create( + self, + resource_group_name: str, + account_name: str, + share_name: str, + data_set_name: str, + data_set: "models.DataSet", + **kwargs + ) -> "models.DataSet": + """Create a DataSet. + + Adds a new data set to an existing share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share to add the data set to. + :type share_name: str + :param data_set_name: The name of the dataSet. + :type data_set_name: str + :param data_set: The new data set information. + :type data_set: ~data_share_management_client.models.DataSet + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataSet or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSet or ~data_share_management_client.models.DataSet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataSet"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'dataSetName': self._serialize.url("data_set_name", data_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(data_set, 'DataSet') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DataSet', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + + async def _delete_initial( + self, + resource_group_name: str, + account_name: str, + share_name: str, + data_set_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self._delete_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'dataSetName': self._serialize.url("data_set_name", data_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + + async def delete( + self, + resource_group_name: str, + account_name: str, + share_name: str, + data_set_name: str, + **kwargs + ) -> None: + """Delete a DataSet in a share. + + Delete DataSet in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param data_set_name: The name of the dataSet. + :type data_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + data_set_name=data_set_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + + def list_by_share( + self, + resource_group_name: str, + account_name: str, + share_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.DataSetList": + """List DataSets in a share. + + List DataSets in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataSetList or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSetList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DataSetList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_invitation_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_invitation_operations_async.py new file mode 100644 index 00000000000..c53ea9c8e86 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_invitation_operations_async.py @@ -0,0 +1,341 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class InvitationOperations: + """InvitationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + account_name: str, + share_name: str, + invitation_name: str, + **kwargs + ) -> "models.Invitation": + """Get an invitation in a share. + + Get Invitation in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param invitation_name: The name of the invitation. + :type invitation_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Invitation or the result of cls(response) + :rtype: ~data_share_management_client.models.Invitation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Invitation"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'invitationName': self._serialize.url("invitation_name", invitation_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Invitation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} + + async def create( + self, + resource_group_name: str, + account_name: str, + share_name: str, + invitation_name: str, + target_active_directory_id: Optional[str] = None, + target_email: Optional[str] = None, + target_object_id: Optional[str] = None, + **kwargs + ) -> "models.Invitation": + """Create an invitation. + + Sends a new invitation to a recipient to access a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share to send the invitation for. + :type share_name: str + :param invitation_name: The name of the invitation. + :type invitation_name: str + :param target_active_directory_id: The target Azure AD Id. Can't be combined with email. + :type target_active_directory_id: str + :param target_email: The email the invitation is directed to. + :type target_email: str + :param target_object_id: The target user or application Id that invitation is being sent to. + Must be specified along TargetActiveDirectoryId. This enables sending + invitations to specific users or applications in an AD tenant. + :type target_object_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Invitation or the result of cls(response) + :rtype: ~data_share_management_client.models.Invitation or ~data_share_management_client.models.Invitation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Invitation"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _invitation = models.Invitation(target_active_directory_id=target_active_directory_id, target_email=target_email, target_object_id=target_object_id) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'invitationName': self._serialize.url("invitation_name", invitation_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_invitation, 'Invitation') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Invitation', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Invitation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} + + async def delete( + self, + resource_group_name: str, + account_name: str, + share_name: str, + invitation_name: str, + **kwargs + ) -> None: + """Delete an invitation in a share. + + Delete Invitation in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param invitation_name: The name of the invitation. + :type invitation_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'invitationName': self._serialize.url("invitation_name", invitation_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} + + def list_by_share( + self, + resource_group_name: str, + account_name: str, + share_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.InvitationList": + """List invitations in a share. + + List all Invitations in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: The continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: InvitationList or the result of cls(response) + :rtype: ~data_share_management_client.models.InvitationList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.InvitationList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('InvitationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_operation_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_operation_operations_async.py new file mode 100644 index 00000000000..397c94d67b8 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_operation_operations_async.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. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations: + """OperationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> "models.OperationList": + """List of available operations. + + Lists the available operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationList or the result of cls(response) + :rtype: ~data_share_management_client.models.OperationList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.DataShare/operations'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_provider_share_subscription_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_provider_share_subscription_operations_async.py new file mode 100644 index 00000000000..e516dc2824a --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_provider_share_subscription_operations_async.py @@ -0,0 +1,367 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProviderShareSubscriptionOperations: + """ProviderShareSubscriptionOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get_by_share( + self, + resource_group_name: str, + account_name: str, + share_name: str, + provider_share_subscription_id: str, + **kwargs + ) -> "models.ProviderShareSubscription": + """Get share subscription in a provider share. + + Get share subscription in a provider share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param provider_share_subscription_id: To locate shareSubscription. + :type provider_share_subscription_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProviderShareSubscription or the result of cls(response) + :rtype: ~data_share_management_client.models.ProviderShareSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self.get_by_share.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'providerShareSubscriptionId': self._serialize.url("provider_share_subscription_id", provider_share_subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}'} + + def list_by_share( + self, + resource_group_name: str, + account_name: str, + share_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.ProviderShareSubscriptionList": + """List share subscriptions in a provider share. + + List of available share subscriptions to a provider share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: Continuation Token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProviderShareSubscriptionList or the result of cls(response) + :rtype: ~data_share_management_client.models.ProviderShareSubscriptionList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscriptionList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProviderShareSubscriptionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions'} + + async def _revoke_initial( + self, + resource_group_name: str, + account_name: str, + share_name: str, + provider_share_subscription_id: str, + **kwargs + ) -> "models.ProviderShareSubscription": + cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self._revoke_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'providerShareSubscriptionId': self._serialize.url("provider_share_subscription_id", provider_share_subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _revoke_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/revoke'} + + async def revoke( + self, + resource_group_name: str, + account_name: str, + share_name: str, + provider_share_subscription_id: str, + **kwargs + ) -> "models.ProviderShareSubscription": + """Revoke share subscription in a provider share. + + Revoke share subscription in a provider share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param provider_share_subscription_id: To locate shareSubscription. + :type provider_share_subscription_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns ProviderShareSubscription + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.ProviderShareSubscription] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] + raw_result = await self._revoke_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + provider_share_subscription_id=provider_share_subscription_id, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + revoke.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/revoke'} + + async def reinstate( + self, + resource_group_name: str, + account_name: str, + share_name: str, + provider_share_subscription_id: str, + **kwargs + ) -> "models.ProviderShareSubscription": + """Reinstate share subscription in a provider share. + + Reinstate share subscription in a provider share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param provider_share_subscription_id: To locate shareSubscription. + :type provider_share_subscription_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProviderShareSubscription or the result of cls(response) + :rtype: ~data_share_management_client.models.ProviderShareSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self.reinstate.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'providerShareSubscriptionId': self._serialize.url("provider_share_subscription_id", provider_share_subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + reinstate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/reinstate'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_share_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_share_operations_async.py new file mode 100644 index 00000000000..0c7c5ef51f1 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_share_operations_async.py @@ -0,0 +1,567 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ShareOperations: + """ShareOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + account_name: str, + share_name: str, + **kwargs + ) -> "models.Share": + """Get a share. + + Get a specified share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share to retrieve. + :type share_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Share or the result of cls(response) + :rtype: ~data_share_management_client.models.Share + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Share"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + + async def create( + self, + resource_group_name: str, + account_name: str, + share_name: str, + description: Optional[str] = None, + share_kind: Optional[Union[str, "models.ShareKind"]] = None, + terms: Optional[str] = None, + **kwargs + ) -> "models.Share": + """Create a share. + + Create a share in the given account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param description: Share description. + :type description: str + :param share_kind: Share kind. + :type share_kind: str or ~data_share_management_client.models.ShareKind + :param terms: Share terms. + :type terms: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Share or the result of cls(response) + :rtype: ~data_share_management_client.models.Share or ~data_share_management_client.models.Share + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Share"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _share = models.Share(description=description, share_kind=share_kind, terms=terms) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_share, 'Share') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Share', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + + async def _delete_initial( + self, + resource_group_name: str, + account_name: str, + share_name: str, + **kwargs + ) -> "models.OperationResponse": + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self._delete_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + + async def delete( + self, + resource_group_name: str, + account_name: str, + share_name: str, + **kwargs + ) -> "models.OperationResponse": + """Delete a share. + + Deletes a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns OperationResponse + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + + def list_by_account( + self, + resource_group_name: str, + account_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.ShareList": + """List shares in an account. + + List of available shares under an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param skip_token: Continuation Token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareList or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_account.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ShareList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares'} + + def list_synchronization( + self, + resource_group_name: str, + account_name: str, + share_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.ShareSynchronizationList": + """List synchronizations of a share. + + List Synchronizations in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareSynchronizationList or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSynchronizationList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSynchronizationList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronization.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ShareSynchronizationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizations'} + + def list_synchronization_detail( + self, + resource_group_name: str, + account_name: str, + share_name: str, + skip_token: Optional[str] = None, + consumer_email: Optional[str] = None, + consumer_name: Optional[str] = None, + consumer_tenant_name: Optional[str] = None, + duration_ms: Optional[int] = None, + end_time: Optional[datetime.datetime] = None, + message: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + status: Optional[str] = None, + synchronization_id: Optional[str] = None, + **kwargs + ) -> "models.SynchronizationDetailsList": + """List synchronization details. + + List data set level details for a share synchronization. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: Continuation token. + :type skip_token: str + :param consumer_email: Email of the user who created the synchronization. + :type consumer_email: str + :param consumer_name: Name of the user who created the synchronization. + :type consumer_name: str + :param consumer_tenant_name: Tenant name of the consumer who created the synchronization. + :type consumer_tenant_name: str + :param duration_ms: synchronization duration. + :type duration_ms: int + :param end_time: End time of synchronization. + :type end_time: ~datetime.datetime + :param message: message of synchronization. + :type message: str + :param start_time: start time of synchronization. + :type start_time: ~datetime.datetime + :param status: Raw Status. + :type status: str + :param synchronization_id: Synchronization id. + :type synchronization_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SynchronizationDetailsList or the result of cls(response) + :rtype: ~data_share_management_client.models.SynchronizationDetailsList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationDetailsList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + _share_synchronization = models.ShareSynchronization(consumer_email=consumer_email, consumer_name=consumer_name, consumer_tenant_name=consumer_tenant_name, duration_ms=duration_ms, end_time=end_time, message=message, start_time=start_time, status=status, synchronization_id=synchronization_id) + api_version = "2019-11-01" + content_type = "application/json" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronization_detail.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_share_synchronization, 'ShareSynchronization') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SynchronizationDetailsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_synchronization_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizationDetails'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_share_subscription_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_share_subscription_operations_async.py new file mode 100644 index 00000000000..4416c305e0e --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_share_subscription_operations_async.py @@ -0,0 +1,858 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ShareSubscriptionOperations: + """ShareSubscriptionOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + **kwargs + ) -> "models.ShareSubscription": + """Get a shareSubscription in an account. + + Get shareSubscription in an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareSubscription or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscription"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('ShareSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} + + async def create( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + invitation_id: str, + source_share_location: str, + **kwargs + ) -> "models.ShareSubscription": + """Create a shareSubscription in an account. + + Create shareSubscription in an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param invitation_id: The invitation id. + :type invitation_id: str + :param source_share_location: Source share location. + :type source_share_location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareSubscription or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSubscription or ~data_share_management_client.models.ShareSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscription"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _share_subscription = models.ShareSubscription(invitation_id=invitation_id, source_share_location=source_share_location) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_share_subscription, 'ShareSubscription') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ShareSubscription', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ShareSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} + + async def _delete_initial( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + **kwargs + ) -> "models.OperationResponse": + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self._delete_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} + + async def delete( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + **kwargs + ) -> "models.OperationResponse": + """Delete a shareSubscription in an account. + + Delete shareSubscription in an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns OperationResponse + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} + + def list_by_account( + self, + resource_group_name: str, + account_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.ShareSubscriptionList": + """List share subscriptions in an account. + + List of available share subscriptions under an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param skip_token: Continuation Token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareSubscriptionList or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSubscriptionList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_account.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ShareSubscriptionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions'} + + def list_source_share_synchronization_setting( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.SourceShareSynchronizationSettingList": + """Get synchronization settings set on a share. + + Get source share synchronization settings for a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceShareSynchronizationSettingList or the result of cls(response) + :rtype: ~data_share_management_client.models.SourceShareSynchronizationSettingList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceShareSynchronizationSettingList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_source_share_synchronization_setting.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SourceShareSynchronizationSettingList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_source_share_synchronization_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSourceShareSynchronizationSettings'} + + def list_synchronization( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.ShareSubscriptionSynchronizationList": + """List synchronizations of a share subscription. + + List Synchronizations in a share subscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription. + :type share_subscription_name: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareSubscriptionSynchronizationList or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSubscriptionSynchronizationList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronizationList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronization.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ShareSubscriptionSynchronizationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizations'} + + def list_synchronization_detail( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + synchronization_id: str, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.SynchronizationDetailsList": + """List synchronization details. + + List data set level details for a share subscription synchronization. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription. + :type share_subscription_name: str + :param synchronization_id: Synchronization id. + :type synchronization_id: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SynchronizationDetailsList or the result of cls(response) + :rtype: ~data_share_management_client.models.SynchronizationDetailsList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationDetailsList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + _share_subscription_synchronization = models.ShareSubscriptionSynchronization(synchronization_id=synchronization_id) + api_version = "2019-11-01" + content_type = "application/json" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronization_detail.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_share_subscription_synchronization, 'ShareSubscriptionSynchronization') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SynchronizationDetailsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_synchronization_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizationDetails'} + + async def _synchronize_initial( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + synchronization_mode: Optional[Union[str, "models.SynchronizationMode"]] = None, + **kwargs + ) -> "models.ShareSubscriptionSynchronization": + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _synchronize = models.Synchronize(synchronization_mode=synchronization_mode) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._synchronize_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_synchronize, 'Synchronize') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _synchronize_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/Synchronize'} + + async def synchronize( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + synchronization_mode: Optional[Union[str, "models.SynchronizationMode"]] = None, + **kwargs + ) -> "models.ShareSubscriptionSynchronization": + """Initiate a copy. + + Initiate an asynchronous data share job. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of share subscription. + :type share_subscription_name: str + :param synchronization_mode: Mode of synchronization used in triggers and snapshot sync. + Incremental by default. + :type synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns ShareSubscriptionSynchronization + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.ShareSubscriptionSynchronization] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + raw_result = await self._synchronize_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + synchronization_mode=synchronization_mode, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + synchronize.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/Synchronize'} + + async def _cancel_synchronization_initial( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + synchronization_id: str, + **kwargs + ) -> "models.ShareSubscriptionSynchronization": + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _share_subscription_synchronization = models.ShareSubscriptionSynchronization(synchronization_id=synchronization_id) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._cancel_synchronization_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_share_subscription_synchronization, 'ShareSubscriptionSynchronization') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _cancel_synchronization_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization'} + + async def cancel_synchronization( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + synchronization_id: str, + **kwargs + ) -> "models.ShareSubscriptionSynchronization": + """Request to cancel a synchronization. + + Request cancellation of a data share snapshot. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param synchronization_id: Synchronization id. + :type synchronization_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns ShareSubscriptionSynchronization + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.ShareSubscriptionSynchronization] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + raw_result = await self._cancel_synchronization_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + synchronization_id=synchronization_id, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + cancel_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_synchronization_setting_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_synchronization_setting_operations_async.py new file mode 100644 index 00000000000..78a95bd6159 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_synchronization_setting_operations_async.py @@ -0,0 +1,378 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SynchronizationSettingOperations: + """SynchronizationSettingOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + account_name: str, + share_name: str, + synchronization_setting_name: str, + **kwargs + ) -> "models.SynchronizationSetting": + """Get a synchronizationSetting in a share. + + Get synchronizationSetting in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param synchronization_setting_name: The name of the synchronizationSetting. + :type synchronization_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SynchronizationSetting or the result of cls(response) + :rtype: ~data_share_management_client.models.SynchronizationSetting + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationSetting"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'synchronizationSettingName': self._serialize.url("synchronization_setting_name", synchronization_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('SynchronizationSetting', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + + async def create( + self, + resource_group_name: str, + account_name: str, + share_name: str, + synchronization_setting_name: str, + synchronization_setting: "models.SynchronizationSetting", + **kwargs + ) -> "models.SynchronizationSetting": + """Create or update a synchronizationSetting. + + Adds a new synchronization setting to an existing share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share to add the synchronization setting to. + :type share_name: str + :param synchronization_setting_name: The name of the synchronizationSetting. + :type synchronization_setting_name: str + :param synchronization_setting: The new synchronization setting information. + :type synchronization_setting: ~data_share_management_client.models.SynchronizationSetting + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SynchronizationSetting or the result of cls(response) + :rtype: ~data_share_management_client.models.SynchronizationSetting or ~data_share_management_client.models.SynchronizationSetting + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationSetting"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'synchronizationSettingName': self._serialize.url("synchronization_setting_name", synchronization_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(synchronization_setting, 'SynchronizationSetting') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SynchronizationSetting', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SynchronizationSetting', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + + async def _delete_initial( + self, + resource_group_name: str, + account_name: str, + share_name: str, + synchronization_setting_name: str, + **kwargs + ) -> "models.OperationResponse": + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self._delete_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'synchronizationSettingName': self._serialize.url("synchronization_setting_name", synchronization_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + + async def delete( + self, + resource_group_name: str, + account_name: str, + share_name: str, + synchronization_setting_name: str, + **kwargs + ) -> "models.OperationResponse": + """Delete a synchronizationSetting in a share. + + Delete synchronizationSetting in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param synchronization_setting_name: The name of the synchronizationSetting . + :type synchronization_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns OperationResponse + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + synchronization_setting_name=synchronization_setting_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + + def list_by_share( + self, + resource_group_name: str, + account_name: str, + share_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.SynchronizationSettingList": + """List synchronizationSettings in a share. + + List synchronizationSettings in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SynchronizationSettingList or the result of cls(response) + :rtype: ~data_share_management_client.models.SynchronizationSettingList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationSettingList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SynchronizationSettingList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_trigger_operations_async.py b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_trigger_operations_async.py new file mode 100644 index 00000000000..18598bf412e --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/aio/operations_async/_trigger_operations_async.py @@ -0,0 +1,421 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class TriggerOperations: + """TriggerOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + trigger_name: str, + **kwargs + ) -> "models.Trigger": + """Get a Trigger in a shareSubscription. + + Get Trigger in a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param trigger_name: The name of the trigger. + :type trigger_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Trigger or the result of cls(response) + :rtype: ~data_share_management_client.models.Trigger + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + + async def _create_initial( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + trigger_name: str, + trigger: "models.Trigger", + **kwargs + ) -> "models.Trigger": + cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(trigger, 'Trigger') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Trigger', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + + async def create( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + trigger_name: str, + trigger: "models.Trigger", + **kwargs + ) -> "models.Trigger": + """Create a Trigger. + + This method creates a trigger for a share subscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription which will hold the data set + sink. + :type share_subscription_name: str + :param trigger_name: The name of the trigger. + :type trigger_name: str + :param trigger: Trigger details. + :type trigger: ~data_share_management_client.models.Trigger + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns Trigger + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.Trigger] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + trigger_name=trigger_name, + trigger=trigger, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + + async def _delete_initial( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + trigger_name: str, + **kwargs + ) -> "models.OperationResponse": + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self._delete_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + + async def delete( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + trigger_name: str, + **kwargs + ) -> "models.OperationResponse": + """Delete a Trigger in a shareSubscription. + + Delete Trigger in a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param trigger_name: The name of the trigger. + :type trigger_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns OperationResponse + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + trigger_name=trigger_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + + def list_by_share_subscription( + self, + resource_group_name: str, + account_name: str, + share_subscription_name: str, + skip_token: Optional[str] = None, + **kwargs + ) -> "models.TriggerList": + """List Triggers in a share subscription. + + List Triggers in a share subscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription. + :type share_subscription_name: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggerList or the result of cls(response) + :rtype: ~data_share_management_client.models.TriggerList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TriggerList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share_subscription.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TriggerList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/models/__init__.py b/src/datashare/azext_datashare/vendored_sdks/datashare/models/__init__.py new file mode 100644 index 00000000000..237bc58e2ae --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/models/__init__.py @@ -0,0 +1,250 @@ +# 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 Account + from ._models_py3 import AccountList + from ._models_py3 import AccountUpdateParameters + from ._models_py3 import AdlsGen1FileDataSet + from ._models_py3 import AdlsGen1FolderDataSet + from ._models_py3 import AdlsGen2FileDataSet + from ._models_py3 import AdlsGen2FileDataSetMapping + from ._models_py3 import AdlsGen2FileSystemDataSet + from ._models_py3 import AdlsGen2FileSystemDataSetMapping + from ._models_py3 import AdlsGen2FolderDataSet + from ._models_py3 import AdlsGen2FolderDataSetMapping + from ._models_py3 import BlobContainerDataSet + from ._models_py3 import BlobContainerDataSetMapping + from ._models_py3 import BlobDataSet + from ._models_py3 import BlobDataSetMapping + from ._models_py3 import BlobFolderDataSet + from ._models_py3 import BlobFolderDataSetMapping + from ._models_py3 import ConsumerInvitation + from ._models_py3 import ConsumerInvitationList + from ._models_py3 import ConsumerSourceDataSet + from ._models_py3 import ConsumerSourceDataSetList + from ._models_py3 import DataSet + from ._models_py3 import DataSetList + from ._models_py3 import DataSetMapping + from ._models_py3 import DataSetMappingList + from ._models_py3 import DataShareError + from ._models_py3 import DataShareErrorInfo + from ._models_py3 import DefaultDto + from ._models_py3 import DimensionProperties + from ._models_py3 import Identity + from ._models_py3 import Invitation + from ._models_py3 import InvitationList + from ._models_py3 import KustoClusterDataSet + from ._models_py3 import KustoClusterDataSetMapping + from ._models_py3 import KustoDatabaseDataSet + from ._models_py3 import KustoDatabaseDataSetMapping + from ._models_py3 import OperationList + from ._models_py3 import OperationMetaLogSpecification + from ._models_py3 import OperationMetaMetricSpecification + from ._models_py3 import OperationMetaServiceSpecification + from ._models_py3 import OperationModel + from ._models_py3 import OperationModelProperties + from ._models_py3 import OperationResponse + from ._models_py3 import ProviderShareSubscription + from ._models_py3 import ProviderShareSubscriptionList + from ._models_py3 import ProxyDto + from ._models_py3 import ScheduledSourceSynchronizationSetting + from ._models_py3 import ScheduledSynchronizationSetting + from ._models_py3 import ScheduledTrigger + from ._models_py3 import Share + from ._models_py3 import ShareList + from ._models_py3 import ShareSubscription + from ._models_py3 import ShareSubscriptionList + from ._models_py3 import ShareSubscriptionSynchronization + from ._models_py3 import ShareSubscriptionSynchronizationList + from ._models_py3 import ShareSynchronization + from ._models_py3 import ShareSynchronizationList + from ._models_py3 import SourceShareSynchronizationSetting + from ._models_py3 import SourceShareSynchronizationSettingList + from ._models_py3 import SqlDBTableDataSet + from ._models_py3 import SqlDBTableDataSetMapping + from ._models_py3 import SqlDwTableDataSet + from ._models_py3 import SqlDwTableDataSetMapping + from ._models_py3 import SynchronizationDetails + from ._models_py3 import SynchronizationDetailsList + from ._models_py3 import SynchronizationSetting + from ._models_py3 import SynchronizationSettingList + from ._models_py3 import Synchronize + from ._models_py3 import Trigger + from ._models_py3 import TriggerList +except (SyntaxError, ImportError): + from ._models import Account # type: ignore + from ._models import AccountList # type: ignore + from ._models import AccountUpdateParameters # type: ignore + from ._models import AdlsGen1FileDataSet # type: ignore + from ._models import AdlsGen1FolderDataSet # type: ignore + from ._models import AdlsGen2FileDataSet # type: ignore + from ._models import AdlsGen2FileDataSetMapping # type: ignore + from ._models import AdlsGen2FileSystemDataSet # type: ignore + from ._models import AdlsGen2FileSystemDataSetMapping # type: ignore + from ._models import AdlsGen2FolderDataSet # type: ignore + from ._models import AdlsGen2FolderDataSetMapping # type: ignore + from ._models import BlobContainerDataSet # type: ignore + from ._models import BlobContainerDataSetMapping # type: ignore + from ._models import BlobDataSet # type: ignore + from ._models import BlobDataSetMapping # type: ignore + from ._models import BlobFolderDataSet # type: ignore + from ._models import BlobFolderDataSetMapping # type: ignore + from ._models import ConsumerInvitation # type: ignore + from ._models import ConsumerInvitationList # type: ignore + from ._models import ConsumerSourceDataSet # type: ignore + from ._models import ConsumerSourceDataSetList # type: ignore + from ._models import DataSet # type: ignore + from ._models import DataSetList # type: ignore + from ._models import DataSetMapping # type: ignore + from ._models import DataSetMappingList # type: ignore + from ._models import DataShareError # type: ignore + from ._models import DataShareErrorInfo # type: ignore + from ._models import DefaultDto # type: ignore + from ._models import DimensionProperties # type: ignore + from ._models import Identity # type: ignore + from ._models import Invitation # type: ignore + from ._models import InvitationList # type: ignore + from ._models import KustoClusterDataSet # type: ignore + from ._models import KustoClusterDataSetMapping # type: ignore + from ._models import KustoDatabaseDataSet # type: ignore + from ._models import KustoDatabaseDataSetMapping # type: ignore + from ._models import OperationList # type: ignore + from ._models import OperationMetaLogSpecification # type: ignore + from ._models import OperationMetaMetricSpecification # type: ignore + from ._models import OperationMetaServiceSpecification # type: ignore + from ._models import OperationModel # type: ignore + from ._models import OperationModelProperties # type: ignore + from ._models import OperationResponse # type: ignore + from ._models import ProviderShareSubscription # type: ignore + from ._models import ProviderShareSubscriptionList # type: ignore + from ._models import ProxyDto # type: ignore + from ._models import ScheduledSourceSynchronizationSetting # type: ignore + from ._models import ScheduledSynchronizationSetting # type: ignore + from ._models import ScheduledTrigger # type: ignore + from ._models import Share # type: ignore + from ._models import ShareList # type: ignore + from ._models import ShareSubscription # type: ignore + from ._models import ShareSubscriptionList # type: ignore + from ._models import ShareSubscriptionSynchronization # type: ignore + from ._models import ShareSubscriptionSynchronizationList # type: ignore + from ._models import ShareSynchronization # type: ignore + from ._models import ShareSynchronizationList # type: ignore + from ._models import SourceShareSynchronizationSetting # type: ignore + from ._models import SourceShareSynchronizationSettingList # type: ignore + from ._models import SqlDBTableDataSet # type: ignore + from ._models import SqlDBTableDataSetMapping # type: ignore + from ._models import SqlDwTableDataSet # type: ignore + from ._models import SqlDwTableDataSetMapping # type: ignore + from ._models import SynchronizationDetails # type: ignore + from ._models import SynchronizationDetailsList # type: ignore + from ._models import SynchronizationSetting # type: ignore + from ._models import SynchronizationSettingList # type: ignore + from ._models import Synchronize # type: ignore + from ._models import Trigger # type: ignore + from ._models import TriggerList # type: ignore + +from ._data_share_management_client_enums import ( + DataSetMappingStatus, + DataSetType, + InvitationStatus, + Kind, + OutputType, + ProvisioningState, + RecurrenceInterval, + ShareKind, + ShareSubscriptionStatus, + Status, + SynchronizationMode, + TriggerStatus, +) + +__all__ = [ + 'Account', + 'AccountList', + 'AccountUpdateParameters', + 'AdlsGen1FileDataSet', + 'AdlsGen1FolderDataSet', + 'AdlsGen2FileDataSet', + 'AdlsGen2FileDataSetMapping', + 'AdlsGen2FileSystemDataSet', + 'AdlsGen2FileSystemDataSetMapping', + 'AdlsGen2FolderDataSet', + 'AdlsGen2FolderDataSetMapping', + 'BlobContainerDataSet', + 'BlobContainerDataSetMapping', + 'BlobDataSet', + 'BlobDataSetMapping', + 'BlobFolderDataSet', + 'BlobFolderDataSetMapping', + 'ConsumerInvitation', + 'ConsumerInvitationList', + 'ConsumerSourceDataSet', + 'ConsumerSourceDataSetList', + 'DataSet', + 'DataSetList', + 'DataSetMapping', + 'DataSetMappingList', + 'DataShareError', + 'DataShareErrorInfo', + 'DefaultDto', + 'DimensionProperties', + 'Identity', + 'Invitation', + 'InvitationList', + 'KustoClusterDataSet', + 'KustoClusterDataSetMapping', + 'KustoDatabaseDataSet', + 'KustoDatabaseDataSetMapping', + 'OperationList', + 'OperationMetaLogSpecification', + 'OperationMetaMetricSpecification', + 'OperationMetaServiceSpecification', + 'OperationModel', + 'OperationModelProperties', + 'OperationResponse', + 'ProviderShareSubscription', + 'ProviderShareSubscriptionList', + 'ProxyDto', + 'ScheduledSourceSynchronizationSetting', + 'ScheduledSynchronizationSetting', + 'ScheduledTrigger', + 'Share', + 'ShareList', + 'ShareSubscription', + 'ShareSubscriptionList', + 'ShareSubscriptionSynchronization', + 'ShareSubscriptionSynchronizationList', + 'ShareSynchronization', + 'ShareSynchronizationList', + 'SourceShareSynchronizationSetting', + 'SourceShareSynchronizationSettingList', + 'SqlDBTableDataSet', + 'SqlDBTableDataSetMapping', + 'SqlDwTableDataSet', + 'SqlDwTableDataSetMapping', + 'SynchronizationDetails', + 'SynchronizationDetailsList', + 'SynchronizationSetting', + 'SynchronizationSettingList', + 'Synchronize', + 'Trigger', + 'TriggerList', + 'DataSetMappingStatus', + 'DataSetType', + 'InvitationStatus', + 'Kind', + 'OutputType', + 'ProvisioningState', + 'RecurrenceInterval', + 'ShareKind', + 'ShareSubscriptionStatus', + 'Status', + 'SynchronizationMode', + 'TriggerStatus', +] diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/models/_data_share_management_client_enums.py b/src/datashare/azext_datashare/vendored_sdks/datashare/models/_data_share_management_client_enums.py new file mode 100644 index 00000000000..a2a515c4266 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/models/_data_share_management_client_enums.py @@ -0,0 +1,128 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + +class ProvisioningState(str, Enum): + """Provisioning state of the Account + """ + + succeeded = "Succeeded" + creating = "Creating" + deleting = "Deleting" + moving = "Moving" + failed = "Failed" + +class InvitationStatus(str, Enum): + """The status of the invitation. + """ + + pending = "Pending" + accepted = "Accepted" + rejected = "Rejected" + withdrawn = "Withdrawn" + +class Kind(str, Enum): + """Kind of data set. + """ + + blob = "Blob" + container = "Container" + blob_folder = "BlobFolder" + adls_gen2_file_system = "AdlsGen2FileSystem" + adls_gen2_folder = "AdlsGen2Folder" + adls_gen2_file = "AdlsGen2File" + adls_gen1_folder = "AdlsGen1Folder" + adls_gen1_file = "AdlsGen1File" + kusto_cluster = "KustoCluster" + kusto_database = "KustoDatabase" + sql_db_table = "SqlDBTable" + sql_dw_table = "SqlDWTable" + +class SynchronizationKind(str, Enum): + schedule_based = "ScheduleBased" + +class ShareKind(str, Enum): + """Share kind. + """ + + copy_based = "CopyBased" + in_place = "InPlace" + +class SynchronizationMode(str, Enum): + """Synchronization mode + """ + + incremental = "Incremental" + full_sync = "FullSync" + +class DataSetType(str, Enum): + """Type of the data set + """ + + blob = "Blob" + container = "Container" + blob_folder = "BlobFolder" + adls_gen2_file_system = "AdlsGen2FileSystem" + adls_gen2_folder = "AdlsGen2Folder" + adls_gen2_file = "AdlsGen2File" + adls_gen1_folder = "AdlsGen1Folder" + adls_gen1_file = "AdlsGen1File" + kusto_cluster = "KustoCluster" + kusto_database = "KustoDatabase" + sql_db_table = "SqlDBTable" + sql_dw_table = "SqlDWTable" + +class ShareSubscriptionStatus(str, Enum): + """Gets the status of share subscription + """ + + active = "Active" + revoked = "Revoked" + source_deleted = "SourceDeleted" + revoking = "Revoking" + +class Status(str, Enum): + """Operation state of the long running operation. + """ + + accepted = "Accepted" + in_progress = "InProgress" + transient_failure = "TransientFailure" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" + +class RecurrenceInterval(str, Enum): + """Recurrence Interval + """ + + hour = "Hour" + day = "Day" + +class TriggerStatus(str, Enum): + """Gets the trigger state + """ + + active = "Active" + inactive = "Inactive" + source_synchronization_setting_deleted = "SourceSynchronizationSettingDeleted" + +class DataSetMappingStatus(str, Enum): + """Gets the status of the data set mapping. + """ + + ok = "Ok" + broken = "Broken" + +class OutputType(str, Enum): + """File output type + """ + + csv = "Csv" + parquet = "Parquet" diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/models/_models.py b/src/datashare/azext_datashare/vendored_sdks/datashare/models/_models.py new file mode 100644 index 00000000000..bee5d5e4df6 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/models/_models.py @@ -0,0 +1,3738 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class DefaultDto(msrest.serialization.Model): + """Base data transfer object implementation for default resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :param location: Location of the azure resource. + :type location: str + :ivar name: Name of the azure resource. + :vartype name: str + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Type of the azure resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DefaultDto, self).__init__(**kwargs) + self.id = None + self.location = kwargs.get('location', None) + self.name = None + self.tags = kwargs.get('tags', None) + self.type = None + + +class Account(DefaultDto): + """An account data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :param location: Location of the azure resource. + :type location: str + :ivar name: Name of the azure resource. + :vartype name: str + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Type of the azure resource. + :vartype type: str + :param identity: Required. Identity Info on the Account. + :type identity: ~data_share_management_client.models.Identity + :ivar created_at: Time at which the account was created. + :vartype created_at: ~datetime.datetime + :ivar provisioning_state: Provisioning state of the Account. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :ivar user_email: Email of the user who created the resource. + :vartype user_email: str + :ivar user_name: Name of the user who created the resource. + :vartype user_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identity': {'required': True}, + 'created_at': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'user_email': {'readonly': True}, + 'user_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'user_email': {'key': 'properties.userEmail', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Account, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.created_at = None + self.provisioning_state = None + self.user_email = None + self.user_name = None + + +class AccountList(msrest.serialization.Model): + """List response for get Accounts. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.Account] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Account]'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class AccountUpdateParameters(msrest.serialization.Model): + """Update parameters for accounts. + + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class ProxyDto(msrest.serialization.Model): + """Base data transfer object implementation for proxy resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + """ + + _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'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyDto, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class DataSet(ProxyDto): + """A DataSet data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AdlsGen1FileDataSet, AdlsGen1FolderDataSet, AdlsGen2FileDataSet, AdlsGen2FileSystemDataSet, AdlsGen2FolderDataSet, BlobDataSet, BlobFolderDataSet, BlobContainerDataSet, KustoClusterDataSet, KustoDatabaseDataSet, SqlDBTableDataSet, SqlDwTableDataSet. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'AdlsGen1File': 'AdlsGen1FileDataSet', 'AdlsGen1Folder': 'AdlsGen1FolderDataSet', 'AdlsGen2File': 'AdlsGen2FileDataSet', 'AdlsGen2FileSystem': 'AdlsGen2FileSystemDataSet', 'AdlsGen2Folder': 'AdlsGen2FolderDataSet', 'Blob': 'BlobDataSet', 'BlobFolder': 'BlobFolderDataSet', 'Container': 'BlobContainerDataSet', 'KustoCluster': 'KustoClusterDataSet', 'KustoDatabase': 'KustoDatabaseDataSet', 'SqlDBTable': 'SqlDBTableDataSet', 'SqlDWTable': 'SqlDwTableDataSet'} + } + + def __init__( + self, + **kwargs + ): + super(DataSet, self).__init__(**kwargs) + self.kind = 'DataSet' + + +class AdlsGen1FileDataSet(DataSet): + """An ADLS Gen 1 file data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param account_name: Required. The ADLS account name. + :type account_name: str + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param file_name: Required. The file name in the ADLS account. + :type file_name: str + :param folder_path: Required. The folder path within the ADLS account. + :type folder_path: str + :param resource_group: Required. Resource group of ADLS account. + :type resource_group: str + :param subscription_id: Required. Subscription id of ADLS account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'account_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_name': {'required': True}, + 'folder_path': {'required': True}, + 'resource_group': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AdlsGen1FileDataSet, self).__init__(**kwargs) + self.kind = 'AdlsGen1File' + self.account_name = kwargs.get('account_name', None) + self.data_set_id = None + self.file_name = kwargs.get('file_name', None) + self.folder_path = kwargs.get('folder_path', None) + self.resource_group = kwargs.get('resource_group', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class AdlsGen1FolderDataSet(DataSet): + """An ADLS Gen 1 folder data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param account_name: Required. The ADLS account name. + :type account_name: str + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param folder_path: Required. The folder path within the ADLS account. + :type folder_path: str + :param resource_group: Required. Resource group of ADLS account. + :type resource_group: str + :param subscription_id: Required. Subscription id of ADLS account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'account_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'folder_path': {'required': True}, + 'resource_group': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AdlsGen1FolderDataSet, self).__init__(**kwargs) + self.kind = 'AdlsGen1Folder' + self.account_name = kwargs.get('account_name', None) + self.data_set_id = None + self.folder_path = kwargs.get('folder_path', None) + self.resource_group = kwargs.get('resource_group', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class AdlsGen2FileDataSet(DataSet): + """An ADLS Gen 2 file data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param file_path: Required. File path within the file system. + :type file_path: str + :param file_system: Required. File system to which the file belongs. + :type file_system: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_path': {'required': True}, + 'file_system': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AdlsGen2FileDataSet, self).__init__(**kwargs) + self.kind = 'AdlsGen2File' + self.data_set_id = None + self.file_path = kwargs.get('file_path', None) + self.file_system = kwargs.get('file_system', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class DataSetMapping(ProxyDto): + """A data set mapping data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AdlsGen2FileDataSetMapping, AdlsGen2FileSystemDataSetMapping, AdlsGen2FolderDataSetMapping, BlobDataSetMapping, BlobFolderDataSetMapping, BlobContainerDataSetMapping, KustoClusterDataSetMapping, KustoDatabaseDataSetMapping, SqlDBTableDataSetMapping, SqlDwTableDataSetMapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'AdlsGen2File': 'AdlsGen2FileDataSetMapping', 'AdlsGen2FileSystem': 'AdlsGen2FileSystemDataSetMapping', 'AdlsGen2Folder': 'AdlsGen2FolderDataSetMapping', 'Blob': 'BlobDataSetMapping', 'BlobFolder': 'BlobFolderDataSetMapping', 'Container': 'BlobContainerDataSetMapping', 'KustoCluster': 'KustoClusterDataSetMapping', 'KustoDatabase': 'KustoDatabaseDataSetMapping', 'SqlDBTable': 'SqlDBTableDataSetMapping', 'SqlDWTable': 'SqlDwTableDataSetMapping'} + } + + def __init__( + self, + **kwargs + ): + super(DataSetMapping, self).__init__(**kwargs) + self.kind = 'DataSetMapping' + + +class AdlsGen2FileDataSetMapping(DataSetMapping): + """An ADLS Gen2 file data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param file_path: Required. File path within the file system. + :type file_path: str + :param file_system: Required. File system to which the file belongs. + :type file_system: str + :param output_type: Type of output file. Possible values include: 'Csv', 'Parquet'. + :type output_type: str or ~data_share_management_client.models.OutputType + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'file_path': {'required': True}, + 'file_system': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'output_type': {'key': 'properties.outputType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AdlsGen2FileDataSetMapping, self).__init__(**kwargs) + self.kind = 'AdlsGen2File' + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = None + self.file_path = kwargs.get('file_path', None) + self.file_system = kwargs.get('file_system', None) + self.output_type = kwargs.get('output_type', None) + self.provisioning_state = None + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class AdlsGen2FileSystemDataSet(DataSet): + """An ADLS Gen 2 file system data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param file_system: Required. The file system name. + :type file_system: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_system': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AdlsGen2FileSystemDataSet, self).__init__(**kwargs) + self.kind = 'AdlsGen2FileSystem' + self.data_set_id = None + self.file_system = kwargs.get('file_system', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class AdlsGen2FileSystemDataSetMapping(DataSetMapping): + """An ADLS Gen2 file system data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param file_system: Required. The file system name. + :type file_system: str + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'file_system': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AdlsGen2FileSystemDataSetMapping, self).__init__(**kwargs) + self.kind = 'AdlsGen2FileSystem' + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = None + self.file_system = kwargs.get('file_system', None) + self.provisioning_state = None + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class AdlsGen2FolderDataSet(DataSet): + """An ADLS Gen 2 folder data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param file_system: Required. File system to which the folder belongs. + :type file_system: str + :param folder_path: Required. Folder path within the file system. + :type folder_path: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_system': {'required': True}, + 'folder_path': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AdlsGen2FolderDataSet, self).__init__(**kwargs) + self.kind = 'AdlsGen2Folder' + self.data_set_id = None + self.file_system = kwargs.get('file_system', None) + self.folder_path = kwargs.get('folder_path', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class AdlsGen2FolderDataSetMapping(DataSetMapping): + """An ADLS Gen2 folder data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param file_system: Required. File system to which the folder belongs. + :type file_system: str + :param folder_path: Required. Folder path within the file system. + :type folder_path: str + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'file_system': {'required': True}, + 'folder_path': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AdlsGen2FolderDataSetMapping, self).__init__(**kwargs) + self.kind = 'AdlsGen2Folder' + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = None + self.file_system = kwargs.get('file_system', None) + self.folder_path = kwargs.get('folder_path', None) + self.provisioning_state = None + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class BlobContainerDataSet(DataSet): + """An Azure storage blob container data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param container_name: Required. BLOB Container name. + :type container_name: str + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobContainerDataSet, self).__init__(**kwargs) + self.kind = 'Container' + self.container_name = kwargs.get('container_name', None) + self.data_set_id = None + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class BlobContainerDataSetMapping(DataSetMapping): + """A Blob container data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param container_name: Required. BLOB Container name. + :type container_name: str + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobContainerDataSetMapping, self).__init__(**kwargs) + self.kind = 'Container' + self.container_name = kwargs.get('container_name', None) + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = None + self.provisioning_state = None + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class BlobDataSet(DataSet): + """An Azure storage blob data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param container_name: Required. Container that has the file path. + :type container_name: str + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param file_path: Required. File path within the source data set. + :type file_path: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_path': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobDataSet, self).__init__(**kwargs) + self.kind = 'Blob' + self.container_name = kwargs.get('container_name', None) + self.data_set_id = None + self.file_path = kwargs.get('file_path', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class BlobDataSetMapping(DataSetMapping): + """A Blob data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param container_name: Required. Container that has the file path. + :type container_name: str + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param file_path: Required. File path within the source data set. + :type file_path: str + :param output_type: File output type. Possible values include: 'Csv', 'Parquet'. + :type output_type: str or ~data_share_management_client.models.OutputType + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'file_path': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'output_type': {'key': 'properties.outputType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobDataSetMapping, self).__init__(**kwargs) + self.kind = 'Blob' + self.container_name = kwargs.get('container_name', None) + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = None + self.file_path = kwargs.get('file_path', None) + self.output_type = kwargs.get('output_type', None) + self.provisioning_state = None + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class BlobFolderDataSet(DataSet): + """An Azure storage blob folder data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param container_name: Required. Container that has the file path. + :type container_name: str + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param prefix: Required. Prefix for blob folder. + :type prefix: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'prefix': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'prefix': {'key': 'properties.prefix', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobFolderDataSet, self).__init__(**kwargs) + self.kind = 'BlobFolder' + self.container_name = kwargs.get('container_name', None) + self.data_set_id = None + self.prefix = kwargs.get('prefix', None) + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class BlobFolderDataSetMapping(DataSetMapping): + """A Blob folder data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param container_name: Required. Container that has the file path. + :type container_name: str + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param prefix: Required. Prefix for blob folder. + :type prefix: str + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'prefix': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'prefix': {'key': 'properties.prefix', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BlobFolderDataSetMapping, self).__init__(**kwargs) + self.kind = 'BlobFolder' + self.container_name = kwargs.get('container_name', None) + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = None + self.prefix = kwargs.get('prefix', None) + self.provisioning_state = None + self.resource_group = kwargs.get('resource_group', None) + self.storage_account_name = kwargs.get('storage_account_name', None) + self.subscription_id = kwargs.get('subscription_id', None) + + +class ConsumerInvitation(ProxyDto): + """A consumer Invitation data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :ivar data_set_count: Number of data sets in a share. + :vartype data_set_count: int + :ivar description: Description shared when the invitation was created. + :vartype description: str + :param invitation_id: Required. Unique id of the invitation. + :type invitation_id: str + :ivar invitation_status: The status of the invitation. Possible values include: 'Pending', + 'Accepted', 'Rejected', 'Withdrawn'. + :vartype invitation_status: str or ~data_share_management_client.models.InvitationStatus + :ivar location: invitation location. + :vartype location: str + :ivar provider_email: Email of the provider who created the resource. + :vartype provider_email: str + :ivar provider_name: Name of the provider who created the resource. + :vartype provider_name: str + :ivar provider_tenant_name: Tenant name of the provider who created the resource. + :vartype provider_tenant_name: str + :ivar responded_at: The time the recipient responded to the invitation. + :vartype responded_at: ~datetime.datetime + :ivar sent_at: Gets the time at which the invitation was sent. + :vartype sent_at: ~datetime.datetime + :ivar share_name: Gets the source share Name. + :vartype share_name: str + :ivar terms_of_use: Terms of use shared when the invitation was created. + :vartype terms_of_use: str + :ivar user_email: Email of the user who created the resource. + :vartype user_email: str + :ivar user_name: Name of the user who created the resource. + :vartype user_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'data_set_count': {'readonly': True}, + 'description': {'readonly': True}, + 'invitation_id': {'required': True}, + 'invitation_status': {'readonly': True}, + 'location': {'readonly': True}, + 'provider_email': {'readonly': True}, + 'provider_name': {'readonly': True}, + 'provider_tenant_name': {'readonly': True}, + 'responded_at': {'readonly': True}, + 'sent_at': {'readonly': True}, + 'share_name': {'readonly': True}, + 'terms_of_use': {'readonly': True}, + 'user_email': {'readonly': True}, + 'user_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_set_count': {'key': 'properties.dataSetCount', 'type': 'int'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'invitation_id': {'key': 'properties.invitationId', 'type': 'str'}, + 'invitation_status': {'key': 'properties.invitationStatus', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'provider_email': {'key': 'properties.providerEmail', 'type': 'str'}, + 'provider_name': {'key': 'properties.providerName', 'type': 'str'}, + 'provider_tenant_name': {'key': 'properties.providerTenantName', 'type': 'str'}, + 'responded_at': {'key': 'properties.respondedAt', 'type': 'iso-8601'}, + 'sent_at': {'key': 'properties.sentAt', 'type': 'iso-8601'}, + 'share_name': {'key': 'properties.shareName', 'type': 'str'}, + 'terms_of_use': {'key': 'properties.termsOfUse', 'type': 'str'}, + 'user_email': {'key': 'properties.userEmail', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConsumerInvitation, self).__init__(**kwargs) + self.data_set_count = None + self.description = None + self.invitation_id = kwargs.get('invitation_id', None) + self.invitation_status = None + self.location = None + self.provider_email = None + self.provider_name = None + self.provider_tenant_name = None + self.responded_at = None + self.sent_at = None + self.share_name = None + self.terms_of_use = None + self.user_email = None + self.user_name = None + + +class ConsumerInvitationList(msrest.serialization.Model): + """List response for get InvitationList. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.ConsumerInvitation] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ConsumerInvitation]'}, + } + + def __init__( + self, + **kwargs + ): + super(ConsumerInvitationList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class ConsumerSourceDataSet(ProxyDto): + """A consumer side dataSet data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :ivar data_set_id: DataSet Id. + :vartype data_set_id: str + :ivar data_set_location: Location of the data set. + :vartype data_set_location: str + :ivar data_set_name: DataSet name. + :vartype data_set_name: str + :ivar data_set_path: DataSet path. + :vartype data_set_path: str + :ivar data_set_type: Type of data set. Possible values include: 'Blob', 'Container', + 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', + 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable'. + :vartype data_set_type: str or ~data_share_management_client.models.DataSetType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'data_set_id': {'readonly': True}, + 'data_set_location': {'readonly': True}, + 'data_set_name': {'readonly': True}, + 'data_set_path': {'readonly': True}, + 'data_set_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_location': {'key': 'properties.dataSetLocation', 'type': 'str'}, + 'data_set_name': {'key': 'properties.dataSetName', 'type': 'str'}, + 'data_set_path': {'key': 'properties.dataSetPath', 'type': 'str'}, + 'data_set_type': {'key': 'properties.dataSetType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConsumerSourceDataSet, self).__init__(**kwargs) + self.data_set_id = None + self.data_set_location = None + self.data_set_name = None + self.data_set_path = None + self.data_set_type = None + + +class ConsumerSourceDataSetList(msrest.serialization.Model): + """A consumer side list of source dataSets. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.ConsumerSourceDataSet] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ConsumerSourceDataSet]'}, + } + + def __init__( + self, + **kwargs + ): + super(ConsumerSourceDataSetList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class DataSetList(msrest.serialization.Model): + """List response for get DataSets. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.DataSet] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[DataSet]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataSetList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class DataSetMappingList(msrest.serialization.Model): + """List response for get DataSetMappings. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.DataSetMapping] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[DataSetMapping]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataSetMappingList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class DataShareError(msrest.serialization.Model): + """The data share error model. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. The data share error body. + :type error: ~data_share_management_client.models.DataShareErrorInfo + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'DataShareErrorInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(DataShareError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class DataShareErrorInfo(msrest.serialization.Model): + """The data share error body model. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Code of the error. + :type code: str + :param details: Nested details of the error model. + :type details: list[~data_share_management_client.models.DataShareErrorInfo] + :param message: Required. Message of the error. + :type message: str + :param target: Target of the error. + :type target: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[DataShareErrorInfo]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataShareErrorInfo, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.details = kwargs.get('details', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + + +class DimensionProperties(msrest.serialization.Model): + """properties for dimension. + + :param display_name: localized display name of the dimension to customer. + :type display_name: str + :param name: dimension name. + :type name: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DimensionProperties, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.name = kwargs.get('name', None) + + +class Identity(msrest.serialization.Model): + """Identity of resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: service principal Id. + :vartype principal_id: str + :ivar tenant_id: Tenant Id. + :vartype tenant_id: str + :ivar type: Identity Type. Default value: "SystemAssigned". + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class Invitation(ProxyDto): + """A Invitation data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :ivar invitation_id: unique invitation id. + :vartype invitation_id: str + :ivar invitation_status: The status of the invitation. Possible values include: 'Pending', + 'Accepted', 'Rejected', 'Withdrawn'. + :vartype invitation_status: str or ~data_share_management_client.models.InvitationStatus + :ivar responded_at: The time the recipient responded to the invitation. + :vartype responded_at: ~datetime.datetime + :ivar sent_at: Gets the time at which the invitation was sent. + :vartype sent_at: ~datetime.datetime + :param target_active_directory_id: The target Azure AD Id. Can't be combined with email. + :type target_active_directory_id: str + :param target_email: The email the invitation is directed to. + :type target_email: str + :param target_object_id: The target user or application Id that invitation is being sent to. + Must be specified along TargetActiveDirectoryId. This enables sending + invitations to specific users or applications in an AD tenant. + :type target_object_id: str + :ivar user_email: Email of the user who created the resource. + :vartype user_email: str + :ivar user_name: Name of the user who created the resource. + :vartype user_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'invitation_id': {'readonly': True}, + 'invitation_status': {'readonly': True}, + 'responded_at': {'readonly': True}, + 'sent_at': {'readonly': True}, + 'user_email': {'readonly': True}, + 'user_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'invitation_id': {'key': 'properties.invitationId', 'type': 'str'}, + 'invitation_status': {'key': 'properties.invitationStatus', 'type': 'str'}, + 'responded_at': {'key': 'properties.respondedAt', 'type': 'iso-8601'}, + 'sent_at': {'key': 'properties.sentAt', 'type': 'iso-8601'}, + 'target_active_directory_id': {'key': 'properties.targetActiveDirectoryId', 'type': 'str'}, + 'target_email': {'key': 'properties.targetEmail', 'type': 'str'}, + 'target_object_id': {'key': 'properties.targetObjectId', 'type': 'str'}, + 'user_email': {'key': 'properties.userEmail', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Invitation, self).__init__(**kwargs) + self.invitation_id = None + self.invitation_status = None + self.responded_at = None + self.sent_at = None + self.target_active_directory_id = kwargs.get('target_active_directory_id', None) + self.target_email = kwargs.get('target_email', None) + self.target_object_id = kwargs.get('target_object_id', None) + self.user_email = None + self.user_name = None + + +class InvitationList(msrest.serialization.Model): + """List response for get InvitationList. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.Invitation] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Invitation]'}, + } + + def __init__( + self, + **kwargs + ): + super(InvitationList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class KustoClusterDataSet(DataSet): + """A kusto cluster data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param kusto_cluster_resource_id: Required. Resource id of the kusto cluster. + :type kusto_cluster_resource_id: str + :ivar location: Location of the kusto cluster. + :vartype location: str + :ivar provisioning_state: Provisioning state of the kusto cluster data set. Possible values + include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'kusto_cluster_resource_id': {'required': True}, + 'location': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'kusto_cluster_resource_id': {'key': 'properties.kustoClusterResourceId', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KustoClusterDataSet, self).__init__(**kwargs) + self.kind = 'KustoCluster' + self.data_set_id = None + self.kusto_cluster_resource_id = kwargs.get('kusto_cluster_resource_id', None) + self.location = None + self.provisioning_state = None + + +class KustoClusterDataSetMapping(DataSetMapping): + """A Kusto cluster data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param kusto_cluster_resource_id: Required. Resource id of the sink kusto cluster. + :type kusto_cluster_resource_id: str + :ivar location: Location of the sink kusto cluster. + :vartype location: str + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'kusto_cluster_resource_id': {'required': True}, + 'location': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'kusto_cluster_resource_id': {'key': 'properties.kustoClusterResourceId', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KustoClusterDataSetMapping, self).__init__(**kwargs) + self.kind = 'KustoCluster' + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = None + self.kusto_cluster_resource_id = kwargs.get('kusto_cluster_resource_id', None) + self.location = None + self.provisioning_state = None + + +class KustoDatabaseDataSet(DataSet): + """A kusto database data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param kusto_database_resource_id: Required. Resource id of the kusto database. + :type kusto_database_resource_id: str + :ivar location: Location of the kusto cluster. + :vartype location: str + :ivar provisioning_state: Provisioning state of the kusto database data set. Possible values + include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'kusto_database_resource_id': {'required': True}, + 'location': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'kusto_database_resource_id': {'key': 'properties.kustoDatabaseResourceId', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KustoDatabaseDataSet, self).__init__(**kwargs) + self.kind = 'KustoDatabase' + self.data_set_id = None + self.kusto_database_resource_id = kwargs.get('kusto_database_resource_id', None) + self.location = None + self.provisioning_state = None + + +class KustoDatabaseDataSetMapping(DataSetMapping): + """A Kusto database data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param kusto_cluster_resource_id: Required. Resource id of the sink kusto cluster. + :type kusto_cluster_resource_id: str + :ivar location: Location of the sink kusto cluster. + :vartype location: str + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'kusto_cluster_resource_id': {'required': True}, + 'location': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'kusto_cluster_resource_id': {'key': 'properties.kustoClusterResourceId', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KustoDatabaseDataSetMapping, self).__init__(**kwargs) + self.kind = 'KustoDatabase' + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = None + self.kusto_cluster_resource_id = kwargs.get('kusto_cluster_resource_id', None) + self.location = None + self.provisioning_state = None + + +class OperationList(msrest.serialization.Model): + """List response for get operations. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.OperationModel] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[OperationModel]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class OperationMetaLogSpecification(msrest.serialization.Model): + """log specifications for operation api. + + :param blob_duration: blob duration of the log. + :type blob_duration: str + :param display_name: localized name of the log category. + :type display_name: str + :param name: name of the log category. + :type name: str + """ + + _attribute_map = { + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationMetaLogSpecification, self).__init__(**kwargs) + self.blob_duration = kwargs.get('blob_duration', None) + self.display_name = kwargs.get('display_name', None) + self.name = kwargs.get('name', None) + + +class OperationMetaMetricSpecification(msrest.serialization.Model): + """metric specifications for the operation. + + :param aggregation_type: aggregation type of metric. + :type aggregation_type: str + :param dimensions: properties for dimension. + :type dimensions: list[~data_share_management_client.models.DimensionProperties] + :param display_description: description of the metric. + :type display_description: str + :param display_name: localized name of the metric. + :type display_name: str + :param enable_regional_mdm_account: enable regional mdm account. + :type enable_regional_mdm_account: str + :param internal_metric_name: internal metric name. + :type internal_metric_name: str + :param name: name of the metric. + :type name: str + :param resource_id_dimension_name_override: dimension name use to replace resource id if + specified. + :type resource_id_dimension_name_override: str + :param supported_aggregation_types: supported aggregation types. + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: supported time grain types. + :type supported_time_grain_types: list[str] + :param unit: units for the metric. + :type unit: str + """ + + _attribute_map = { + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[DimensionProperties]'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationMetaMetricSpecification, self).__init__(**kwargs) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.dimensions = kwargs.get('dimensions', None) + self.display_description = kwargs.get('display_description', None) + self.display_name = kwargs.get('display_name', None) + self.enable_regional_mdm_account = kwargs.get('enable_regional_mdm_account', None) + self.internal_metric_name = kwargs.get('internal_metric_name', None) + self.name = kwargs.get('name', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.unit = kwargs.get('unit', None) + + +class OperationMetaServiceSpecification(msrest.serialization.Model): + """The operation meta service specification. + + :param log_specifications: log specifications for the operation. + :type log_specifications: + list[~data_share_management_client.models.OperationMetaLogSpecification] + :param metric_specifications: metric specifications for the operation. + :type metric_specifications: + list[~data_share_management_client.models.OperationMetaMetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[OperationMetaLogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetaMetricSpecification]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationMetaServiceSpecification, self).__init__(**kwargs) + self.log_specifications = kwargs.get('log_specifications', None) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class OperationModel(msrest.serialization.Model): + """The response model for get operations. + + :param display: Properties on the operation. + :type display: ~data_share_management_client.models.OperationModelProperties + :param name: Operation name for display purposes. + :type name: str + :param origin: origin of the operation. + :type origin: str + :param service_specification: meta service specification. + :type service_specification: + ~data_share_management_client.models.OperationMetaServiceSpecification + """ + + _attribute_map = { + 'display': {'key': 'display', 'type': 'OperationModelProperties'}, + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationMetaServiceSpecification'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationModel, self).__init__(**kwargs) + self.display = kwargs.get('display', None) + self.name = kwargs.get('name', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationModelProperties(msrest.serialization.Model): + """Properties on operations. + + :param description: Description of the operation for display purposes. + :type description: str + :param operation: Name of the operation for display purposes. + :type operation: str + :param provider: Name of the provider for display purposes. + :type provider: str + :param resource: Name of the resource type for display purposes. + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationModelProperties, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.operation = kwargs.get('operation', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + + +class OperationResponse(msrest.serialization.Model): + """Response for long running operation. + + All required parameters must be populated in order to send to Azure. + + :param end_time: start time. + :type end_time: ~datetime.datetime + :param error: The error property when status is failed. + :type error: ~data_share_management_client.models.DataShareErrorInfo + :param start_time: start time. + :type start_time: ~datetime.datetime + :param status: Required. Operation state of the long running operation. Possible values + include: 'Accepted', 'InProgress', 'TransientFailure', 'Succeeded', 'Failed', 'Canceled'. + :type status: str or ~data_share_management_client.models.Status + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'DataShareErrorInfo'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationResponse, self).__init__(**kwargs) + self.end_time = kwargs.get('end_time', None) + self.error = kwargs.get('error', None) + self.start_time = kwargs.get('start_time', None) + self.status = kwargs.get('status', None) + + +class ProviderShareSubscription(ProxyDto): + """A provider side share subscription data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :ivar consumer_email: Email of the consumer who created the share subscription. + :vartype consumer_email: str + :ivar consumer_name: Name of the consumer who created the share subscription. + :vartype consumer_name: str + :ivar consumer_tenant_name: Tenant name of the consumer who created the share subscription. + :vartype consumer_tenant_name: str + :ivar created_at: created at. + :vartype created_at: ~datetime.datetime + :ivar provider_email: Email of the provider who created the share. + :vartype provider_email: str + :ivar provider_name: Name of the provider who created the share. + :vartype provider_name: str + :ivar shared_at: Shared at. + :vartype shared_at: ~datetime.datetime + :ivar share_subscription_object_id: share Subscription Object Id. + :vartype share_subscription_object_id: str + :ivar share_subscription_status: Gets the status of share subscription. Possible values + include: 'Active', 'Revoked', 'SourceDeleted', 'Revoking'. + :vartype share_subscription_status: str or + ~data_share_management_client.models.ShareSubscriptionStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'consumer_email': {'readonly': True}, + 'consumer_name': {'readonly': True}, + 'consumer_tenant_name': {'readonly': True}, + 'created_at': {'readonly': True}, + 'provider_email': {'readonly': True}, + 'provider_name': {'readonly': True}, + 'shared_at': {'readonly': True}, + 'share_subscription_object_id': {'readonly': True}, + 'share_subscription_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'consumer_email': {'key': 'properties.consumerEmail', 'type': 'str'}, + 'consumer_name': {'key': 'properties.consumerName', 'type': 'str'}, + 'consumer_tenant_name': {'key': 'properties.consumerTenantName', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'provider_email': {'key': 'properties.providerEmail', 'type': 'str'}, + 'provider_name': {'key': 'properties.providerName', 'type': 'str'}, + 'shared_at': {'key': 'properties.sharedAt', 'type': 'iso-8601'}, + 'share_subscription_object_id': {'key': 'properties.shareSubscriptionObjectId', 'type': 'str'}, + 'share_subscription_status': {'key': 'properties.shareSubscriptionStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProviderShareSubscription, self).__init__(**kwargs) + self.consumer_email = None + self.consumer_name = None + self.consumer_tenant_name = None + self.created_at = None + self.provider_email = None + self.provider_name = None + self.shared_at = None + self.share_subscription_object_id = None + self.share_subscription_status = None + + +class ProviderShareSubscriptionList(msrest.serialization.Model): + """List response for get ShareSubscription. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.ProviderShareSubscription] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ProviderShareSubscription]'}, + } + + def __init__( + self, + **kwargs + ): + super(ProviderShareSubscriptionList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class SourceShareSynchronizationSetting(msrest.serialization.Model): + """A view of synchronization setting added by the provider. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduledSourceSynchronizationSetting. + + All required parameters must be populated in order to send to Azure. + + :param kind: Required. Kind of synchronization.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ScheduleBased': 'ScheduledSourceSynchronizationSetting'} + } + + def __init__( + self, + **kwargs + ): + super(SourceShareSynchronizationSetting, self).__init__(**kwargs) + self.kind = None + + +class ScheduledSourceSynchronizationSetting(SourceShareSynchronizationSetting): + """A type of synchronization setting based on schedule. + + All required parameters must be populated in order to send to Azure. + + :param kind: Required. Kind of synchronization.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param recurrence_interval: Recurrence Interval. Possible values include: 'Hour', 'Day'. + :type recurrence_interval: str or ~data_share_management_client.models.RecurrenceInterval + :param synchronization_time: Synchronization time. + :type synchronization_time: ~datetime.datetime + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'recurrence_interval': {'key': 'properties.recurrenceInterval', 'type': 'str'}, + 'synchronization_time': {'key': 'properties.synchronizationTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(ScheduledSourceSynchronizationSetting, self).__init__(**kwargs) + self.kind = 'ScheduleBased' + self.recurrence_interval = kwargs.get('recurrence_interval', None) + self.synchronization_time = kwargs.get('synchronization_time', None) + + +class SynchronizationSetting(ProxyDto): + """A Synchronization Setting data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduledSynchronizationSetting. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of synchronization.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ScheduleBased': 'ScheduledSynchronizationSetting'} + } + + def __init__( + self, + **kwargs + ): + super(SynchronizationSetting, self).__init__(**kwargs) + self.kind = 'SynchronizationSetting' + + +class ScheduledSynchronizationSetting(SynchronizationSetting): + """A type of synchronization setting based on schedule. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of synchronization.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar created_at: Time at which the synchronization setting was created. + :vartype created_at: ~datetime.datetime + :ivar provisioning_state: Gets or sets the provisioning state. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param recurrence_interval: Required. Recurrence Interval. Possible values include: 'Hour', + 'Day'. + :type recurrence_interval: str or ~data_share_management_client.models.RecurrenceInterval + :param synchronization_time: Required. Synchronization time. + :type synchronization_time: ~datetime.datetime + :ivar user_name: Name of the user who created the synchronization setting. + :vartype user_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'created_at': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'recurrence_interval': {'required': True}, + 'synchronization_time': {'required': True}, + 'user_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'recurrence_interval': {'key': 'properties.recurrenceInterval', 'type': 'str'}, + 'synchronization_time': {'key': 'properties.synchronizationTime', 'type': 'iso-8601'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ScheduledSynchronizationSetting, self).__init__(**kwargs) + self.kind = 'ScheduleBased' + self.created_at = None + self.provisioning_state = None + self.recurrence_interval = kwargs.get('recurrence_interval', None) + self.synchronization_time = kwargs.get('synchronization_time', None) + self.user_name = None + + +class Trigger(ProxyDto): + """A Trigger data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduledTrigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of synchronization.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ScheduleBased': 'ScheduledTrigger'} + } + + def __init__( + self, + **kwargs + ): + super(Trigger, self).__init__(**kwargs) + self.kind = 'Trigger' + + +class ScheduledTrigger(Trigger): + """A type of trigger based on schedule. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of synchronization.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar created_at: Time at which the trigger was created. + :vartype created_at: ~datetime.datetime + :ivar provisioning_state: Gets the provisioning state. Possible values include: 'Succeeded', + 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param recurrence_interval: Required. Recurrence Interval. Possible values include: 'Hour', + 'Day'. + :type recurrence_interval: str or ~data_share_management_client.models.RecurrenceInterval + :param synchronization_mode: Synchronization mode. Possible values include: 'Incremental', + 'FullSync'. + :type synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode + :param synchronization_time: Required. Synchronization time. + :type synchronization_time: ~datetime.datetime + :ivar trigger_status: Gets the trigger state. Possible values include: 'Active', 'Inactive', + 'SourceSynchronizationSettingDeleted'. + :vartype trigger_status: str or ~data_share_management_client.models.TriggerStatus + :ivar user_name: Name of the user who created the trigger. + :vartype user_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'created_at': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'recurrence_interval': {'required': True}, + 'synchronization_time': {'required': True}, + 'trigger_status': {'readonly': True}, + 'user_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'recurrence_interval': {'key': 'properties.recurrenceInterval', 'type': 'str'}, + 'synchronization_mode': {'key': 'properties.synchronizationMode', 'type': 'str'}, + 'synchronization_time': {'key': 'properties.synchronizationTime', 'type': 'iso-8601'}, + 'trigger_status': {'key': 'properties.triggerStatus', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ScheduledTrigger, self).__init__(**kwargs) + self.kind = 'ScheduleBased' + self.created_at = None + self.provisioning_state = None + self.recurrence_interval = kwargs.get('recurrence_interval', None) + self.synchronization_mode = kwargs.get('synchronization_mode', None) + self.synchronization_time = kwargs.get('synchronization_time', None) + self.trigger_status = None + self.user_name = None + + +class Share(ProxyDto): + """A share data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :ivar created_at: Time at which the share was created. + :vartype created_at: ~datetime.datetime + :param description: Share description. + :type description: str + :ivar provisioning_state: Gets or sets the provisioning state. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param share_kind: Share kind. Possible values include: 'CopyBased', 'InPlace'. + :type share_kind: str or ~data_share_management_client.models.ShareKind + :param terms: Share terms. + :type terms: str + :ivar user_email: Email of the user who created the resource. + :vartype user_email: str + :ivar user_name: Name of the user who created the resource. + :vartype user_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'user_email': {'readonly': True}, + 'user_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'share_kind': {'key': 'properties.shareKind', 'type': 'str'}, + 'terms': {'key': 'properties.terms', 'type': 'str'}, + 'user_email': {'key': 'properties.userEmail', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Share, self).__init__(**kwargs) + self.created_at = None + self.description = kwargs.get('description', None) + self.provisioning_state = None + self.share_kind = kwargs.get('share_kind', None) + self.terms = kwargs.get('terms', None) + self.user_email = None + self.user_name = None + + +class ShareList(msrest.serialization.Model): + """List response for get Shares. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.Share] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Share]'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class ShareSubscription(ProxyDto): + """A share subscription data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :ivar created_at: Time at which the share subscription was created. + :vartype created_at: ~datetime.datetime + :param invitation_id: Required. The invitation id. + :type invitation_id: str + :ivar provider_email: Email of the provider who created the resource. + :vartype provider_email: str + :ivar provider_name: Name of the provider who created the resource. + :vartype provider_name: str + :ivar provider_tenant_name: Tenant name of the provider who created the resource. + :vartype provider_tenant_name: str + :ivar provisioning_state: Provisioning state of the share subscription. Possible values + include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :ivar share_description: Description of share. + :vartype share_description: str + :ivar share_kind: Kind of share. Possible values include: 'CopyBased', 'InPlace'. + :vartype share_kind: str or ~data_share_management_client.models.ShareKind + :ivar share_name: Name of the share. + :vartype share_name: str + :ivar share_subscription_status: Gets the current status of share subscription. Possible values + include: 'Active', 'Revoked', 'SourceDeleted', 'Revoking'. + :vartype share_subscription_status: str or + ~data_share_management_client.models.ShareSubscriptionStatus + :ivar share_terms: Terms of a share. + :vartype share_terms: str + :param source_share_location: Required. Source share location. + :type source_share_location: str + :ivar user_email: Email of the user who created the resource. + :vartype user_email: str + :ivar user_name: Name of the user who created the resource. + :vartype user_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'invitation_id': {'required': True}, + 'provider_email': {'readonly': True}, + 'provider_name': {'readonly': True}, + 'provider_tenant_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'share_description': {'readonly': True}, + 'share_kind': {'readonly': True}, + 'share_name': {'readonly': True}, + 'share_subscription_status': {'readonly': True}, + 'share_terms': {'readonly': True}, + 'source_share_location': {'required': True}, + 'user_email': {'readonly': True}, + 'user_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'invitation_id': {'key': 'properties.invitationId', 'type': 'str'}, + 'provider_email': {'key': 'properties.providerEmail', 'type': 'str'}, + 'provider_name': {'key': 'properties.providerName', 'type': 'str'}, + 'provider_tenant_name': {'key': 'properties.providerTenantName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'share_description': {'key': 'properties.shareDescription', 'type': 'str'}, + 'share_kind': {'key': 'properties.shareKind', 'type': 'str'}, + 'share_name': {'key': 'properties.shareName', 'type': 'str'}, + 'share_subscription_status': {'key': 'properties.shareSubscriptionStatus', 'type': 'str'}, + 'share_terms': {'key': 'properties.shareTerms', 'type': 'str'}, + 'source_share_location': {'key': 'properties.sourceShareLocation', 'type': 'str'}, + 'user_email': {'key': 'properties.userEmail', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareSubscription, self).__init__(**kwargs) + self.created_at = None + self.invitation_id = kwargs.get('invitation_id', None) + self.provider_email = None + self.provider_name = None + self.provider_tenant_name = None + self.provisioning_state = None + self.share_description = None + self.share_kind = None + self.share_name = None + self.share_subscription_status = None + self.share_terms = None + self.source_share_location = kwargs.get('source_share_location', None) + self.user_email = None + self.user_name = None + + +class ShareSubscriptionList(msrest.serialization.Model): + """List response for get ShareSubscription. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.ShareSubscription] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ShareSubscription]'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareSubscriptionList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class ShareSubscriptionSynchronization(msrest.serialization.Model): + """A ShareSubscriptionSynchronization data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar duration_ms: Synchronization duration. + :vartype duration_ms: int + :ivar end_time: End time of synchronization. + :vartype end_time: ~datetime.datetime + :ivar message: message of Synchronization. + :vartype message: str + :ivar start_time: start time of synchronization. + :vartype start_time: ~datetime.datetime + :ivar status: Raw Status. + :vartype status: str + :param synchronization_id: Required. Synchronization id. + :type synchronization_id: str + :ivar synchronization_mode: Synchronization Mode. Possible values include: 'Incremental', + 'FullSync'. + :vartype synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode + """ + + _validation = { + 'duration_ms': {'readonly': True}, + 'end_time': {'readonly': True}, + 'message': {'readonly': True}, + 'start_time': {'readonly': True}, + 'status': {'readonly': True}, + 'synchronization_id': {'required': True}, + 'synchronization_mode': {'readonly': True}, + } + + _attribute_map = { + 'duration_ms': {'key': 'durationMs', 'type': 'int'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'synchronization_id': {'key': 'synchronizationId', 'type': 'str'}, + 'synchronization_mode': {'key': 'synchronizationMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareSubscriptionSynchronization, self).__init__(**kwargs) + self.duration_ms = None + self.end_time = None + self.message = None + self.start_time = None + self.status = None + self.synchronization_id = kwargs.get('synchronization_id', None) + self.synchronization_mode = None + + +class ShareSubscriptionSynchronizationList(msrest.serialization.Model): + """A consumer side list of share subscription synchronizations. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.ShareSubscriptionSynchronization] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ShareSubscriptionSynchronization]'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareSubscriptionSynchronizationList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class ShareSynchronization(msrest.serialization.Model): + """A ShareSynchronization data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param consumer_email: Email of the user who created the synchronization. + :type consumer_email: str + :param consumer_name: Name of the user who created the synchronization. + :type consumer_name: str + :param consumer_tenant_name: Tenant name of the consumer who created the synchronization. + :type consumer_tenant_name: str + :param duration_ms: synchronization duration. + :type duration_ms: int + :param end_time: End time of synchronization. + :type end_time: ~datetime.datetime + :param message: message of synchronization. + :type message: str + :param start_time: start time of synchronization. + :type start_time: ~datetime.datetime + :param status: Raw Status. + :type status: str + :param synchronization_id: Synchronization id. + :type synchronization_id: str + :ivar synchronization_mode: Synchronization mode. Possible values include: 'Incremental', + 'FullSync'. + :vartype synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode + """ + + _validation = { + 'synchronization_mode': {'readonly': True}, + } + + _attribute_map = { + 'consumer_email': {'key': 'consumerEmail', 'type': 'str'}, + 'consumer_name': {'key': 'consumerName', 'type': 'str'}, + 'consumer_tenant_name': {'key': 'consumerTenantName', 'type': 'str'}, + 'duration_ms': {'key': 'durationMs', 'type': 'int'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'synchronization_id': {'key': 'synchronizationId', 'type': 'str'}, + 'synchronization_mode': {'key': 'synchronizationMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareSynchronization, self).__init__(**kwargs) + self.consumer_email = kwargs.get('consumer_email', None) + self.consumer_name = kwargs.get('consumer_name', None) + self.consumer_tenant_name = kwargs.get('consumer_tenant_name', None) + self.duration_ms = kwargs.get('duration_ms', None) + self.end_time = kwargs.get('end_time', None) + self.message = kwargs.get('message', None) + self.start_time = kwargs.get('start_time', None) + self.status = kwargs.get('status', None) + self.synchronization_id = kwargs.get('synchronization_id', None) + self.synchronization_mode = None + + +class ShareSynchronizationList(msrest.serialization.Model): + """List response for get ShareSynchronization. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.ShareSynchronization] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ShareSynchronization]'}, + } + + def __init__( + self, + **kwargs + ): + super(ShareSynchronizationList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class SourceShareSynchronizationSettingList(msrest.serialization.Model): + """List response for get source share Synchronization settings. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.SourceShareSynchronizationSetting] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[SourceShareSynchronizationSetting]'}, + } + + def __init__( + self, + **kwargs + ): + super(SourceShareSynchronizationSettingList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class SqlDBTableDataSet(DataSet): + """A SQL DB table data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param database_name: Database name of the source data set. + :type database_name: str + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param schema_name: Schema of the table. Default value is dbo. + :type schema_name: str + :param sql_server_resource_id: Resource id of SQL server. + :type sql_server_resource_id: str + :param table_name: SQL DB table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'schema_name': {'key': 'properties.schemaName', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlDBTableDataSet, self).__init__(**kwargs) + self.kind = 'SqlDBTable' + self.database_name = kwargs.get('database_name', None) + self.data_set_id = None + self.schema_name = kwargs.get('schema_name', None) + self.sql_server_resource_id = kwargs.get('sql_server_resource_id', None) + self.table_name = kwargs.get('table_name', None) + + +class SqlDBTableDataSetMapping(DataSetMapping): + """A SQL DB Table data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param database_name: Required. DatabaseName name of the sink data set. + :type database_name: str + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param schema_name: Required. Schema of the table. Default value is dbo. + :type schema_name: str + :param sql_server_resource_id: Required. Resource id of SQL server. + :type sql_server_resource_id: str + :param table_name: Required. SQL DB table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'database_name': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'schema_name': {'required': True}, + 'sql_server_resource_id': {'required': True}, + 'table_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'schema_name': {'key': 'properties.schemaName', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlDBTableDataSetMapping, self).__init__(**kwargs) + self.kind = 'SqlDBTable' + self.database_name = kwargs.get('database_name', None) + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = None + self.provisioning_state = None + self.schema_name = kwargs.get('schema_name', None) + self.sql_server_resource_id = kwargs.get('sql_server_resource_id', None) + self.table_name = kwargs.get('table_name', None) + + +class SqlDwTableDataSet(DataSet): + """A SQL DW table data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param data_warehouse_name: DataWarehouse name of the source data set. + :type data_warehouse_name: str + :param schema_name: Schema of the table. Default value is dbo. + :type schema_name: str + :param sql_server_resource_id: Resource id of SQL server. + :type sql_server_resource_id: str + :param table_name: SQL DW table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_warehouse_name': {'key': 'properties.dataWarehouseName', 'type': 'str'}, + 'schema_name': {'key': 'properties.schemaName', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlDwTableDataSet, self).__init__(**kwargs) + self.kind = 'SqlDWTable' + self.data_set_id = None + self.data_warehouse_name = kwargs.get('data_warehouse_name', None) + self.schema_name = kwargs.get('schema_name', None) + self.sql_server_resource_id = kwargs.get('sql_server_resource_id', None) + self.table_name = kwargs.get('table_name', None) + + +class SqlDwTableDataSetMapping(DataSetMapping): + """A SQL DW Table data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param data_warehouse_name: Required. DataWarehouse name of the source data set. + :type data_warehouse_name: str + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param schema_name: Required. Schema of the table. Default value is dbo. + :type schema_name: str + :param sql_server_resource_id: Required. Resource id of SQL server. + :type sql_server_resource_id: str + :param table_name: Required. SQL DW table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'data_warehouse_name': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'schema_name': {'required': True}, + 'sql_server_resource_id': {'required': True}, + 'table_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'data_warehouse_name': {'key': 'properties.dataWarehouseName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'schema_name': {'key': 'properties.schemaName', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlDwTableDataSetMapping, self).__init__(**kwargs) + self.kind = 'SqlDWTable' + self.data_set_id = kwargs.get('data_set_id', None) + self.data_set_mapping_status = None + self.data_warehouse_name = kwargs.get('data_warehouse_name', None) + self.provisioning_state = None + self.schema_name = kwargs.get('schema_name', None) + self.sql_server_resource_id = kwargs.get('sql_server_resource_id', None) + self.table_name = kwargs.get('table_name', None) + + +class SynchronizationDetails(msrest.serialization.Model): + """Synchronization details at data set level. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar data_set_id: Id of data set. + :vartype data_set_id: str + :ivar data_set_type: Type of the data set. Possible values include: 'Blob', 'Container', + 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', + 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable'. + :vartype data_set_type: str or ~data_share_management_client.models.DataSetType + :ivar duration_ms: Duration of data set level copy. + :vartype duration_ms: int + :ivar end_time: End time of data set level copy. + :vartype end_time: ~datetime.datetime + :ivar files_read: The number of files read from the source data set. + :vartype files_read: long + :ivar files_written: The number of files written into the sink data set. + :vartype files_written: long + :ivar message: Error message if any. + :vartype message: str + :ivar name: Name of the data set. + :vartype name: str + :ivar rows_copied: The number of files copied into the sink data set. + :vartype rows_copied: long + :ivar rows_read: The number of rows read from the source data set. + :vartype rows_read: long + :ivar size_read: The size of the data read from the source data set in bytes. + :vartype size_read: long + :ivar size_written: The size of the data written into the sink data set in bytes. + :vartype size_written: long + :ivar start_time: Start time of data set level copy. + :vartype start_time: ~datetime.datetime + :ivar status: Raw Status. + :vartype status: str + :ivar v_core: The vCore units consumed for the data set synchronization. + :vartype v_core: long + """ + + _validation = { + 'data_set_id': {'readonly': True}, + 'data_set_type': {'readonly': True}, + 'duration_ms': {'readonly': True}, + 'end_time': {'readonly': True}, + 'files_read': {'readonly': True}, + 'files_written': {'readonly': True}, + 'message': {'readonly': True}, + 'name': {'readonly': True}, + 'rows_copied': {'readonly': True}, + 'rows_read': {'readonly': True}, + 'size_read': {'readonly': True}, + 'size_written': {'readonly': True}, + 'start_time': {'readonly': True}, + 'status': {'readonly': True}, + 'v_core': {'readonly': True}, + } + + _attribute_map = { + 'data_set_id': {'key': 'dataSetId', 'type': 'str'}, + 'data_set_type': {'key': 'dataSetType', 'type': 'str'}, + 'duration_ms': {'key': 'durationMs', 'type': 'int'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'files_read': {'key': 'filesRead', 'type': 'long'}, + 'files_written': {'key': 'filesWritten', 'type': 'long'}, + 'message': {'key': 'message', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'rows_copied': {'key': 'rowsCopied', 'type': 'long'}, + 'rows_read': {'key': 'rowsRead', 'type': 'long'}, + 'size_read': {'key': 'sizeRead', 'type': 'long'}, + 'size_written': {'key': 'sizeWritten', 'type': 'long'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'v_core': {'key': 'vCore', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(SynchronizationDetails, self).__init__(**kwargs) + self.data_set_id = None + self.data_set_type = None + self.duration_ms = None + self.end_time = None + self.files_read = None + self.files_written = None + self.message = None + self.name = None + self.rows_copied = None + self.rows_read = None + self.size_read = None + self.size_written = None + self.start_time = None + self.status = None + self.v_core = None + + +class SynchronizationDetailsList(msrest.serialization.Model): + """details of synchronization. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.SynchronizationDetails] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[SynchronizationDetails]'}, + } + + def __init__( + self, + **kwargs + ): + super(SynchronizationDetailsList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class SynchronizationSettingList(msrest.serialization.Model): + """List response for get Synchronization settings. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.SynchronizationSetting] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[SynchronizationSetting]'}, + } + + def __init__( + self, + **kwargs + ): + super(SynchronizationSettingList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class Synchronize(msrest.serialization.Model): + """Payload for the synchronizing the data. + + :param synchronization_mode: Mode of synchronization used in triggers and snapshot sync. + Incremental by default. Possible values include: 'Incremental', 'FullSync'. + :type synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode + """ + + _attribute_map = { + 'synchronization_mode': {'key': 'synchronizationMode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Synchronize, self).__init__(**kwargs) + self.synchronization_mode = kwargs.get('synchronization_mode', None) + + +class TriggerList(msrest.serialization.Model): + """List response for get triggers. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.Trigger] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Trigger]'}, + } + + def __init__( + self, + **kwargs + ): + super(TriggerList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/models/_models_py3.py b/src/datashare/azext_datashare/vendored_sdks/datashare/models/_models_py3.py new file mode 100644 index 00000000000..bc585b353f5 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/models/_models_py3.py @@ -0,0 +1,3998 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class DefaultDto(msrest.serialization.Model): + """Base data transfer object implementation for default resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :param location: Location of the azure resource. + :type location: str + :ivar name: Name of the azure resource. + :vartype name: str + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Type of the azure resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(DefaultDto, self).__init__(**kwargs) + self.id = None + self.location = location + self.name = None + self.tags = tags + self.type = None + + +class Account(DefaultDto): + """An account data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :param location: Location of the azure resource. + :type location: str + :ivar name: Name of the azure resource. + :vartype name: str + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + :ivar type: Type of the azure resource. + :vartype type: str + :param identity: Required. Identity Info on the Account. + :type identity: ~data_share_management_client.models.Identity + :ivar created_at: Time at which the account was created. + :vartype created_at: ~datetime.datetime + :ivar provisioning_state: Provisioning state of the Account. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :ivar user_email: Email of the user who created the resource. + :vartype user_email: str + :ivar user_name: Name of the user who created the resource. + :vartype user_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'identity': {'required': True}, + 'created_at': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'user_email': {'readonly': True}, + 'user_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'user_email': {'key': 'properties.userEmail', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + } + + def __init__( + self, + *, + identity: "Identity", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Account, self).__init__(location=location, tags=tags, **kwargs) + self.identity = identity + self.created_at = None + self.provisioning_state = None + self.user_email = None + self.user_name = None + + +class AccountList(msrest.serialization.Model): + """List response for get Accounts. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.Account] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Account]'}, + } + + def __init__( + self, + *, + value: List["Account"], + next_link: Optional[str] = None, + **kwargs + ): + super(AccountList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class AccountUpdateParameters(msrest.serialization.Model): + """Update parameters for accounts. + + :param tags: A set of tags. Tags on the azure resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(AccountUpdateParameters, self).__init__(**kwargs) + self.tags = tags + + +class ProxyDto(msrest.serialization.Model): + """Base data transfer object implementation for proxy resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + """ + + _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'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyDto, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class DataSet(ProxyDto): + """A DataSet data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AdlsGen1FileDataSet, AdlsGen1FolderDataSet, AdlsGen2FileDataSet, AdlsGen2FileSystemDataSet, AdlsGen2FolderDataSet, BlobDataSet, BlobFolderDataSet, BlobContainerDataSet, KustoClusterDataSet, KustoDatabaseDataSet, SqlDBTableDataSet, SqlDwTableDataSet. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'AdlsGen1File': 'AdlsGen1FileDataSet', 'AdlsGen1Folder': 'AdlsGen1FolderDataSet', 'AdlsGen2File': 'AdlsGen2FileDataSet', 'AdlsGen2FileSystem': 'AdlsGen2FileSystemDataSet', 'AdlsGen2Folder': 'AdlsGen2FolderDataSet', 'Blob': 'BlobDataSet', 'BlobFolder': 'BlobFolderDataSet', 'Container': 'BlobContainerDataSet', 'KustoCluster': 'KustoClusterDataSet', 'KustoDatabase': 'KustoDatabaseDataSet', 'SqlDBTable': 'SqlDBTableDataSet', 'SqlDWTable': 'SqlDwTableDataSet'} + } + + def __init__( + self, + **kwargs + ): + super(DataSet, self).__init__(**kwargs) + self.kind = 'DataSet' + + +class AdlsGen1FileDataSet(DataSet): + """An ADLS Gen 1 file data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param account_name: Required. The ADLS account name. + :type account_name: str + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param file_name: Required. The file name in the ADLS account. + :type file_name: str + :param folder_path: Required. The folder path within the ADLS account. + :type folder_path: str + :param resource_group: Required. Resource group of ADLS account. + :type resource_group: str + :param subscription_id: Required. Subscription id of ADLS account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'account_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_name': {'required': True}, + 'folder_path': {'required': True}, + 'resource_group': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + account_name: str, + file_name: str, + folder_path: str, + resource_group: str, + subscription_id: str, + **kwargs + ): + super(AdlsGen1FileDataSet, self).__init__(**kwargs) + self.kind = 'AdlsGen1File' + self.account_name = account_name + self.data_set_id = None + self.file_name = file_name + self.folder_path = folder_path + self.resource_group = resource_group + self.subscription_id = subscription_id + + +class AdlsGen1FolderDataSet(DataSet): + """An ADLS Gen 1 folder data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param account_name: Required. The ADLS account name. + :type account_name: str + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param folder_path: Required. The folder path within the ADLS account. + :type folder_path: str + :param resource_group: Required. Resource group of ADLS account. + :type resource_group: str + :param subscription_id: Required. Subscription id of ADLS account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'account_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'folder_path': {'required': True}, + 'resource_group': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'account_name': {'key': 'properties.accountName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + account_name: str, + folder_path: str, + resource_group: str, + subscription_id: str, + **kwargs + ): + super(AdlsGen1FolderDataSet, self).__init__(**kwargs) + self.kind = 'AdlsGen1Folder' + self.account_name = account_name + self.data_set_id = None + self.folder_path = folder_path + self.resource_group = resource_group + self.subscription_id = subscription_id + + +class AdlsGen2FileDataSet(DataSet): + """An ADLS Gen 2 file data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param file_path: Required. File path within the file system. + :type file_path: str + :param file_system: Required. File system to which the file belongs. + :type file_system: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_path': {'required': True}, + 'file_system': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + file_path: str, + file_system: str, + resource_group: str, + storage_account_name: str, + subscription_id: str, + **kwargs + ): + super(AdlsGen2FileDataSet, self).__init__(**kwargs) + self.kind = 'AdlsGen2File' + self.data_set_id = None + self.file_path = file_path + self.file_system = file_system + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + + +class DataSetMapping(ProxyDto): + """A data set mapping data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AdlsGen2FileDataSetMapping, AdlsGen2FileSystemDataSetMapping, AdlsGen2FolderDataSetMapping, BlobDataSetMapping, BlobFolderDataSetMapping, BlobContainerDataSetMapping, KustoClusterDataSetMapping, KustoDatabaseDataSetMapping, SqlDBTableDataSetMapping, SqlDwTableDataSetMapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'AdlsGen2File': 'AdlsGen2FileDataSetMapping', 'AdlsGen2FileSystem': 'AdlsGen2FileSystemDataSetMapping', 'AdlsGen2Folder': 'AdlsGen2FolderDataSetMapping', 'Blob': 'BlobDataSetMapping', 'BlobFolder': 'BlobFolderDataSetMapping', 'Container': 'BlobContainerDataSetMapping', 'KustoCluster': 'KustoClusterDataSetMapping', 'KustoDatabase': 'KustoDatabaseDataSetMapping', 'SqlDBTable': 'SqlDBTableDataSetMapping', 'SqlDWTable': 'SqlDwTableDataSetMapping'} + } + + def __init__( + self, + **kwargs + ): + super(DataSetMapping, self).__init__(**kwargs) + self.kind = 'DataSetMapping' + + +class AdlsGen2FileDataSetMapping(DataSetMapping): + """An ADLS Gen2 file data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param file_path: Required. File path within the file system. + :type file_path: str + :param file_system: Required. File system to which the file belongs. + :type file_system: str + :param output_type: Type of output file. Possible values include: 'Csv', 'Parquet'. + :type output_type: str or ~data_share_management_client.models.OutputType + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'file_path': {'required': True}, + 'file_system': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'output_type': {'key': 'properties.outputType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + data_set_id: str, + file_path: str, + file_system: str, + resource_group: str, + storage_account_name: str, + subscription_id: str, + output_type: Optional[Union[str, "OutputType"]] = None, + **kwargs + ): + super(AdlsGen2FileDataSetMapping, self).__init__(**kwargs) + self.kind = 'AdlsGen2File' + self.data_set_id = data_set_id + self.data_set_mapping_status = None + self.file_path = file_path + self.file_system = file_system + self.output_type = output_type + self.provisioning_state = None + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + + +class AdlsGen2FileSystemDataSet(DataSet): + """An ADLS Gen 2 file system data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param file_system: Required. The file system name. + :type file_system: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_system': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + file_system: str, + resource_group: str, + storage_account_name: str, + subscription_id: str, + **kwargs + ): + super(AdlsGen2FileSystemDataSet, self).__init__(**kwargs) + self.kind = 'AdlsGen2FileSystem' + self.data_set_id = None + self.file_system = file_system + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + + +class AdlsGen2FileSystemDataSetMapping(DataSetMapping): + """An ADLS Gen2 file system data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param file_system: Required. The file system name. + :type file_system: str + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'file_system': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + data_set_id: str, + file_system: str, + resource_group: str, + storage_account_name: str, + subscription_id: str, + **kwargs + ): + super(AdlsGen2FileSystemDataSetMapping, self).__init__(**kwargs) + self.kind = 'AdlsGen2FileSystem' + self.data_set_id = data_set_id + self.data_set_mapping_status = None + self.file_system = file_system + self.provisioning_state = None + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + + +class AdlsGen2FolderDataSet(DataSet): + """An ADLS Gen 2 folder data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param file_system: Required. File system to which the folder belongs. + :type file_system: str + :param folder_path: Required. Folder path within the file system. + :type folder_path: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_system': {'required': True}, + 'folder_path': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + file_system: str, + folder_path: str, + resource_group: str, + storage_account_name: str, + subscription_id: str, + **kwargs + ): + super(AdlsGen2FolderDataSet, self).__init__(**kwargs) + self.kind = 'AdlsGen2Folder' + self.data_set_id = None + self.file_system = file_system + self.folder_path = folder_path + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + + +class AdlsGen2FolderDataSetMapping(DataSetMapping): + """An ADLS Gen2 folder data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param file_system: Required. File system to which the folder belongs. + :type file_system: str + :param folder_path: Required. Folder path within the file system. + :type folder_path: str + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'file_system': {'required': True}, + 'folder_path': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_system': {'key': 'properties.fileSystem', 'type': 'str'}, + 'folder_path': {'key': 'properties.folderPath', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + data_set_id: str, + file_system: str, + folder_path: str, + resource_group: str, + storage_account_name: str, + subscription_id: str, + **kwargs + ): + super(AdlsGen2FolderDataSetMapping, self).__init__(**kwargs) + self.kind = 'AdlsGen2Folder' + self.data_set_id = data_set_id + self.data_set_mapping_status = None + self.file_system = file_system + self.folder_path = folder_path + self.provisioning_state = None + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + + +class BlobContainerDataSet(DataSet): + """An Azure storage blob container data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param container_name: Required. BLOB Container name. + :type container_name: str + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + container_name: str, + resource_group: str, + storage_account_name: str, + subscription_id: str, + **kwargs + ): + super(BlobContainerDataSet, self).__init__(**kwargs) + self.kind = 'Container' + self.container_name = container_name + self.data_set_id = None + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + + +class BlobContainerDataSetMapping(DataSetMapping): + """A Blob container data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param container_name: Required. BLOB Container name. + :type container_name: str + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + container_name: str, + data_set_id: str, + resource_group: str, + storage_account_name: str, + subscription_id: str, + **kwargs + ): + super(BlobContainerDataSetMapping, self).__init__(**kwargs) + self.kind = 'Container' + self.container_name = container_name + self.data_set_id = data_set_id + self.data_set_mapping_status = None + self.provisioning_state = None + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + + +class BlobDataSet(DataSet): + """An Azure storage blob data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param container_name: Required. Container that has the file path. + :type container_name: str + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param file_path: Required. File path within the source data set. + :type file_path: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'file_path': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + container_name: str, + file_path: str, + resource_group: str, + storage_account_name: str, + subscription_id: str, + **kwargs + ): + super(BlobDataSet, self).__init__(**kwargs) + self.kind = 'Blob' + self.container_name = container_name + self.data_set_id = None + self.file_path = file_path + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + + +class BlobDataSetMapping(DataSetMapping): + """A Blob data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param container_name: Required. Container that has the file path. + :type container_name: str + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param file_path: Required. File path within the source data set. + :type file_path: str + :param output_type: File output type. Possible values include: 'Csv', 'Parquet'. + :type output_type: str or ~data_share_management_client.models.OutputType + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'file_path': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'output_type': {'key': 'properties.outputType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + container_name: str, + data_set_id: str, + file_path: str, + resource_group: str, + storage_account_name: str, + subscription_id: str, + output_type: Optional[Union[str, "OutputType"]] = None, + **kwargs + ): + super(BlobDataSetMapping, self).__init__(**kwargs) + self.kind = 'Blob' + self.container_name = container_name + self.data_set_id = data_set_id + self.data_set_mapping_status = None + self.file_path = file_path + self.output_type = output_type + self.provisioning_state = None + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + + +class BlobFolderDataSet(DataSet): + """An Azure storage blob folder data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param container_name: Required. Container that has the file path. + :type container_name: str + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param prefix: Required. Prefix for blob folder. + :type prefix: str + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'readonly': True}, + 'prefix': {'required': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'prefix': {'key': 'properties.prefix', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + container_name: str, + prefix: str, + resource_group: str, + storage_account_name: str, + subscription_id: str, + **kwargs + ): + super(BlobFolderDataSet, self).__init__(**kwargs) + self.kind = 'BlobFolder' + self.container_name = container_name + self.data_set_id = None + self.prefix = prefix + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + + +class BlobFolderDataSetMapping(DataSetMapping): + """A Blob folder data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param container_name: Required. Container that has the file path. + :type container_name: str + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param prefix: Required. Prefix for blob folder. + :type prefix: str + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param resource_group: Required. Resource group of storage account. + :type resource_group: str + :param storage_account_name: Required. Storage account name of the source data set. + :type storage_account_name: str + :param subscription_id: Required. Subscription id of storage account. + :type subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'container_name': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'prefix': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'resource_group': {'required': True}, + 'storage_account_name': {'required': True}, + 'subscription_id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'container_name': {'key': 'properties.containerName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'prefix': {'key': 'properties.prefix', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'storage_account_name': {'key': 'properties.storageAccountName', 'type': 'str'}, + 'subscription_id': {'key': 'properties.subscriptionId', 'type': 'str'}, + } + + def __init__( + self, + *, + container_name: str, + data_set_id: str, + prefix: str, + resource_group: str, + storage_account_name: str, + subscription_id: str, + **kwargs + ): + super(BlobFolderDataSetMapping, self).__init__(**kwargs) + self.kind = 'BlobFolder' + self.container_name = container_name + self.data_set_id = data_set_id + self.data_set_mapping_status = None + self.prefix = prefix + self.provisioning_state = None + self.resource_group = resource_group + self.storage_account_name = storage_account_name + self.subscription_id = subscription_id + + +class ConsumerInvitation(ProxyDto): + """A consumer Invitation data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :ivar data_set_count: Number of data sets in a share. + :vartype data_set_count: int + :ivar description: Description shared when the invitation was created. + :vartype description: str + :param invitation_id: Required. Unique id of the invitation. + :type invitation_id: str + :ivar invitation_status: The status of the invitation. Possible values include: 'Pending', + 'Accepted', 'Rejected', 'Withdrawn'. + :vartype invitation_status: str or ~data_share_management_client.models.InvitationStatus + :ivar location: invitation location. + :vartype location: str + :ivar provider_email: Email of the provider who created the resource. + :vartype provider_email: str + :ivar provider_name: Name of the provider who created the resource. + :vartype provider_name: str + :ivar provider_tenant_name: Tenant name of the provider who created the resource. + :vartype provider_tenant_name: str + :ivar responded_at: The time the recipient responded to the invitation. + :vartype responded_at: ~datetime.datetime + :ivar sent_at: Gets the time at which the invitation was sent. + :vartype sent_at: ~datetime.datetime + :ivar share_name: Gets the source share Name. + :vartype share_name: str + :ivar terms_of_use: Terms of use shared when the invitation was created. + :vartype terms_of_use: str + :ivar user_email: Email of the user who created the resource. + :vartype user_email: str + :ivar user_name: Name of the user who created the resource. + :vartype user_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'data_set_count': {'readonly': True}, + 'description': {'readonly': True}, + 'invitation_id': {'required': True}, + 'invitation_status': {'readonly': True}, + 'location': {'readonly': True}, + 'provider_email': {'readonly': True}, + 'provider_name': {'readonly': True}, + 'provider_tenant_name': {'readonly': True}, + 'responded_at': {'readonly': True}, + 'sent_at': {'readonly': True}, + 'share_name': {'readonly': True}, + 'terms_of_use': {'readonly': True}, + 'user_email': {'readonly': True}, + 'user_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_set_count': {'key': 'properties.dataSetCount', 'type': 'int'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'invitation_id': {'key': 'properties.invitationId', 'type': 'str'}, + 'invitation_status': {'key': 'properties.invitationStatus', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'provider_email': {'key': 'properties.providerEmail', 'type': 'str'}, + 'provider_name': {'key': 'properties.providerName', 'type': 'str'}, + 'provider_tenant_name': {'key': 'properties.providerTenantName', 'type': 'str'}, + 'responded_at': {'key': 'properties.respondedAt', 'type': 'iso-8601'}, + 'sent_at': {'key': 'properties.sentAt', 'type': 'iso-8601'}, + 'share_name': {'key': 'properties.shareName', 'type': 'str'}, + 'terms_of_use': {'key': 'properties.termsOfUse', 'type': 'str'}, + 'user_email': {'key': 'properties.userEmail', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + } + + def __init__( + self, + *, + invitation_id: str, + **kwargs + ): + super(ConsumerInvitation, self).__init__(**kwargs) + self.data_set_count = None + self.description = None + self.invitation_id = invitation_id + self.invitation_status = None + self.location = None + self.provider_email = None + self.provider_name = None + self.provider_tenant_name = None + self.responded_at = None + self.sent_at = None + self.share_name = None + self.terms_of_use = None + self.user_email = None + self.user_name = None + + +class ConsumerInvitationList(msrest.serialization.Model): + """List response for get InvitationList. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.ConsumerInvitation] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ConsumerInvitation]'}, + } + + def __init__( + self, + *, + value: List["ConsumerInvitation"], + next_link: Optional[str] = None, + **kwargs + ): + super(ConsumerInvitationList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class ConsumerSourceDataSet(ProxyDto): + """A consumer side dataSet data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :ivar data_set_id: DataSet Id. + :vartype data_set_id: str + :ivar data_set_location: Location of the data set. + :vartype data_set_location: str + :ivar data_set_name: DataSet name. + :vartype data_set_name: str + :ivar data_set_path: DataSet path. + :vartype data_set_path: str + :ivar data_set_type: Type of data set. Possible values include: 'Blob', 'Container', + 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', + 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable'. + :vartype data_set_type: str or ~data_share_management_client.models.DataSetType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'data_set_id': {'readonly': True}, + 'data_set_location': {'readonly': True}, + 'data_set_name': {'readonly': True}, + 'data_set_path': {'readonly': True}, + 'data_set_type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_location': {'key': 'properties.dataSetLocation', 'type': 'str'}, + 'data_set_name': {'key': 'properties.dataSetName', 'type': 'str'}, + 'data_set_path': {'key': 'properties.dataSetPath', 'type': 'str'}, + 'data_set_type': {'key': 'properties.dataSetType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConsumerSourceDataSet, self).__init__(**kwargs) + self.data_set_id = None + self.data_set_location = None + self.data_set_name = None + self.data_set_path = None + self.data_set_type = None + + +class ConsumerSourceDataSetList(msrest.serialization.Model): + """A consumer side list of source dataSets. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.ConsumerSourceDataSet] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ConsumerSourceDataSet]'}, + } + + def __init__( + self, + *, + value: List["ConsumerSourceDataSet"], + next_link: Optional[str] = None, + **kwargs + ): + super(ConsumerSourceDataSetList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class DataSetList(msrest.serialization.Model): + """List response for get DataSets. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.DataSet] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[DataSet]'}, + } + + def __init__( + self, + *, + value: List["DataSet"], + next_link: Optional[str] = None, + **kwargs + ): + super(DataSetList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class DataSetMappingList(msrest.serialization.Model): + """List response for get DataSetMappings. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.DataSetMapping] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[DataSetMapping]'}, + } + + def __init__( + self, + *, + value: List["DataSetMapping"], + next_link: Optional[str] = None, + **kwargs + ): + super(DataSetMappingList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class DataShareError(msrest.serialization.Model): + """The data share error model. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. The data share error body. + :type error: ~data_share_management_client.models.DataShareErrorInfo + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'DataShareErrorInfo'}, + } + + def __init__( + self, + *, + error: "DataShareErrorInfo", + **kwargs + ): + super(DataShareError, self).__init__(**kwargs) + self.error = error + + +class DataShareErrorInfo(msrest.serialization.Model): + """The data share error body model. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Code of the error. + :type code: str + :param details: Nested details of the error model. + :type details: list[~data_share_management_client.models.DataShareErrorInfo] + :param message: Required. Message of the error. + :type message: str + :param target: Target of the error. + :type target: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[DataShareErrorInfo]'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + *, + code: str, + message: str, + details: Optional[List["DataShareErrorInfo"]] = None, + target: Optional[str] = None, + **kwargs + ): + super(DataShareErrorInfo, self).__init__(**kwargs) + self.code = code + self.details = details + self.message = message + self.target = target + + +class DimensionProperties(msrest.serialization.Model): + """properties for dimension. + + :param display_name: localized display name of the dimension to customer. + :type display_name: str + :param name: dimension name. + :type name: str + """ + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + display_name: Optional[str] = None, + name: Optional[str] = None, + **kwargs + ): + super(DimensionProperties, self).__init__(**kwargs) + self.display_name = display_name + self.name = name + + +class Identity(msrest.serialization.Model): + """Identity of resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: service principal Id. + :vartype principal_id: str + :ivar tenant_id: Tenant Id. + :vartype tenant_id: str + :ivar type: Identity Type. Default value: "SystemAssigned". + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class Invitation(ProxyDto): + """A Invitation data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :ivar invitation_id: unique invitation id. + :vartype invitation_id: str + :ivar invitation_status: The status of the invitation. Possible values include: 'Pending', + 'Accepted', 'Rejected', 'Withdrawn'. + :vartype invitation_status: str or ~data_share_management_client.models.InvitationStatus + :ivar responded_at: The time the recipient responded to the invitation. + :vartype responded_at: ~datetime.datetime + :ivar sent_at: Gets the time at which the invitation was sent. + :vartype sent_at: ~datetime.datetime + :param target_active_directory_id: The target Azure AD Id. Can't be combined with email. + :type target_active_directory_id: str + :param target_email: The email the invitation is directed to. + :type target_email: str + :param target_object_id: The target user or application Id that invitation is being sent to. + Must be specified along TargetActiveDirectoryId. This enables sending + invitations to specific users or applications in an AD tenant. + :type target_object_id: str + :ivar user_email: Email of the user who created the resource. + :vartype user_email: str + :ivar user_name: Name of the user who created the resource. + :vartype user_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'invitation_id': {'readonly': True}, + 'invitation_status': {'readonly': True}, + 'responded_at': {'readonly': True}, + 'sent_at': {'readonly': True}, + 'user_email': {'readonly': True}, + 'user_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'invitation_id': {'key': 'properties.invitationId', 'type': 'str'}, + 'invitation_status': {'key': 'properties.invitationStatus', 'type': 'str'}, + 'responded_at': {'key': 'properties.respondedAt', 'type': 'iso-8601'}, + 'sent_at': {'key': 'properties.sentAt', 'type': 'iso-8601'}, + 'target_active_directory_id': {'key': 'properties.targetActiveDirectoryId', 'type': 'str'}, + 'target_email': {'key': 'properties.targetEmail', 'type': 'str'}, + 'target_object_id': {'key': 'properties.targetObjectId', 'type': 'str'}, + 'user_email': {'key': 'properties.userEmail', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + } + + def __init__( + self, + *, + target_active_directory_id: Optional[str] = None, + target_email: Optional[str] = None, + target_object_id: Optional[str] = None, + **kwargs + ): + super(Invitation, self).__init__(**kwargs) + self.invitation_id = None + self.invitation_status = None + self.responded_at = None + self.sent_at = None + self.target_active_directory_id = target_active_directory_id + self.target_email = target_email + self.target_object_id = target_object_id + self.user_email = None + self.user_name = None + + +class InvitationList(msrest.serialization.Model): + """List response for get InvitationList. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.Invitation] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Invitation]'}, + } + + def __init__( + self, + *, + value: List["Invitation"], + next_link: Optional[str] = None, + **kwargs + ): + super(InvitationList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class KustoClusterDataSet(DataSet): + """A kusto cluster data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param kusto_cluster_resource_id: Required. Resource id of the kusto cluster. + :type kusto_cluster_resource_id: str + :ivar location: Location of the kusto cluster. + :vartype location: str + :ivar provisioning_state: Provisioning state of the kusto cluster data set. Possible values + include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'kusto_cluster_resource_id': {'required': True}, + 'location': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'kusto_cluster_resource_id': {'key': 'properties.kustoClusterResourceId', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + kusto_cluster_resource_id: str, + **kwargs + ): + super(KustoClusterDataSet, self).__init__(**kwargs) + self.kind = 'KustoCluster' + self.data_set_id = None + self.kusto_cluster_resource_id = kusto_cluster_resource_id + self.location = None + self.provisioning_state = None + + +class KustoClusterDataSetMapping(DataSetMapping): + """A Kusto cluster data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param kusto_cluster_resource_id: Required. Resource id of the sink kusto cluster. + :type kusto_cluster_resource_id: str + :ivar location: Location of the sink kusto cluster. + :vartype location: str + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'kusto_cluster_resource_id': {'required': True}, + 'location': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'kusto_cluster_resource_id': {'key': 'properties.kustoClusterResourceId', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + data_set_id: str, + kusto_cluster_resource_id: str, + **kwargs + ): + super(KustoClusterDataSetMapping, self).__init__(**kwargs) + self.kind = 'KustoCluster' + self.data_set_id = data_set_id + self.data_set_mapping_status = None + self.kusto_cluster_resource_id = kusto_cluster_resource_id + self.location = None + self.provisioning_state = None + + +class KustoDatabaseDataSet(DataSet): + """A kusto database data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param kusto_database_resource_id: Required. Resource id of the kusto database. + :type kusto_database_resource_id: str + :ivar location: Location of the kusto cluster. + :vartype location: str + :ivar provisioning_state: Provisioning state of the kusto database data set. Possible values + include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + 'kusto_database_resource_id': {'required': True}, + 'location': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'kusto_database_resource_id': {'key': 'properties.kustoDatabaseResourceId', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + kusto_database_resource_id: str, + **kwargs + ): + super(KustoDatabaseDataSet, self).__init__(**kwargs) + self.kind = 'KustoDatabase' + self.data_set_id = None + self.kusto_database_resource_id = kusto_database_resource_id + self.location = None + self.provisioning_state = None + + +class KustoDatabaseDataSetMapping(DataSetMapping): + """A Kusto database data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param kusto_cluster_resource_id: Required. Resource id of the sink kusto cluster. + :type kusto_cluster_resource_id: str + :ivar location: Location of the sink kusto cluster. + :vartype location: str + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'kusto_cluster_resource_id': {'required': True}, + 'location': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'kusto_cluster_resource_id': {'key': 'properties.kustoClusterResourceId', 'type': 'str'}, + 'location': {'key': 'properties.location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + data_set_id: str, + kusto_cluster_resource_id: str, + **kwargs + ): + super(KustoDatabaseDataSetMapping, self).__init__(**kwargs) + self.kind = 'KustoDatabase' + self.data_set_id = data_set_id + self.data_set_mapping_status = None + self.kusto_cluster_resource_id = kusto_cluster_resource_id + self.location = None + self.provisioning_state = None + + +class OperationList(msrest.serialization.Model): + """List response for get operations. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.OperationModel] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[OperationModel]'}, + } + + def __init__( + self, + *, + value: List["OperationModel"], + next_link: Optional[str] = None, + **kwargs + ): + super(OperationList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class OperationMetaLogSpecification(msrest.serialization.Model): + """log specifications for operation api. + + :param blob_duration: blob duration of the log. + :type blob_duration: str + :param display_name: localized name of the log category. + :type display_name: str + :param name: name of the log category. + :type name: str + """ + + _attribute_map = { + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + blob_duration: Optional[str] = None, + display_name: Optional[str] = None, + name: Optional[str] = None, + **kwargs + ): + super(OperationMetaLogSpecification, self).__init__(**kwargs) + self.blob_duration = blob_duration + self.display_name = display_name + self.name = name + + +class OperationMetaMetricSpecification(msrest.serialization.Model): + """metric specifications for the operation. + + :param aggregation_type: aggregation type of metric. + :type aggregation_type: str + :param dimensions: properties for dimension. + :type dimensions: list[~data_share_management_client.models.DimensionProperties] + :param display_description: description of the metric. + :type display_description: str + :param display_name: localized name of the metric. + :type display_name: str + :param enable_regional_mdm_account: enable regional mdm account. + :type enable_regional_mdm_account: str + :param internal_metric_name: internal metric name. + :type internal_metric_name: str + :param name: name of the metric. + :type name: str + :param resource_id_dimension_name_override: dimension name use to replace resource id if + specified. + :type resource_id_dimension_name_override: str + :param supported_aggregation_types: supported aggregation types. + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: supported time grain types. + :type supported_time_grain_types: list[str] + :param unit: units for the metric. + :type unit: str + """ + + _attribute_map = { + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[DimensionProperties]'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'str'}, + 'internal_metric_name': {'key': 'internalMetricName', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'unit': {'key': 'unit', 'type': 'str'}, + } + + def __init__( + self, + *, + aggregation_type: Optional[str] = None, + dimensions: Optional[List["DimensionProperties"]] = None, + display_description: Optional[str] = None, + display_name: Optional[str] = None, + enable_regional_mdm_account: Optional[str] = None, + internal_metric_name: Optional[str] = None, + name: Optional[str] = None, + resource_id_dimension_name_override: Optional[str] = None, + supported_aggregation_types: Optional[List[str]] = None, + supported_time_grain_types: Optional[List[str]] = None, + unit: Optional[str] = None, + **kwargs + ): + super(OperationMetaMetricSpecification, self).__init__(**kwargs) + self.aggregation_type = aggregation_type + self.dimensions = dimensions + self.display_description = display_description + self.display_name = display_name + self.enable_regional_mdm_account = enable_regional_mdm_account + self.internal_metric_name = internal_metric_name + self.name = name + self.resource_id_dimension_name_override = resource_id_dimension_name_override + self.supported_aggregation_types = supported_aggregation_types + self.supported_time_grain_types = supported_time_grain_types + self.unit = unit + + +class OperationMetaServiceSpecification(msrest.serialization.Model): + """The operation meta service specification. + + :param log_specifications: log specifications for the operation. + :type log_specifications: + list[~data_share_management_client.models.OperationMetaLogSpecification] + :param metric_specifications: metric specifications for the operation. + :type metric_specifications: + list[~data_share_management_client.models.OperationMetaMetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[OperationMetaLogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[OperationMetaMetricSpecification]'}, + } + + def __init__( + self, + *, + log_specifications: Optional[List["OperationMetaLogSpecification"]] = None, + metric_specifications: Optional[List["OperationMetaMetricSpecification"]] = None, + **kwargs + ): + super(OperationMetaServiceSpecification, self).__init__(**kwargs) + self.log_specifications = log_specifications + self.metric_specifications = metric_specifications + + +class OperationModel(msrest.serialization.Model): + """The response model for get operations. + + :param display: Properties on the operation. + :type display: ~data_share_management_client.models.OperationModelProperties + :param name: Operation name for display purposes. + :type name: str + :param origin: origin of the operation. + :type origin: str + :param service_specification: meta service specification. + :type service_specification: + ~data_share_management_client.models.OperationMetaServiceSpecification + """ + + _attribute_map = { + 'display': {'key': 'display', 'type': 'OperationModelProperties'}, + 'name': {'key': 'name', 'type': 'str'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationMetaServiceSpecification'}, + } + + def __init__( + self, + *, + display: Optional["OperationModelProperties"] = None, + name: Optional[str] = None, + origin: Optional[str] = None, + service_specification: Optional["OperationMetaServiceSpecification"] = None, + **kwargs + ): + super(OperationModel, self).__init__(**kwargs) + self.display = display + self.name = name + self.origin = origin + self.service_specification = service_specification + + +class OperationModelProperties(msrest.serialization.Model): + """Properties on operations. + + :param description: Description of the operation for display purposes. + :type description: str + :param operation: Name of the operation for display purposes. + :type operation: str + :param provider: Name of the provider for display purposes. + :type provider: str + :param resource: Name of the resource type for display purposes. + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + operation: Optional[str] = None, + provider: Optional[str] = None, + resource: Optional[str] = None, + **kwargs + ): + super(OperationModelProperties, self).__init__(**kwargs) + self.description = description + self.operation = operation + self.provider = provider + self.resource = resource + + +class OperationResponse(msrest.serialization.Model): + """Response for long running operation. + + All required parameters must be populated in order to send to Azure. + + :param end_time: start time. + :type end_time: ~datetime.datetime + :param error: The error property when status is failed. + :type error: ~data_share_management_client.models.DataShareErrorInfo + :param start_time: start time. + :type start_time: ~datetime.datetime + :param status: Required. Operation state of the long running operation. Possible values + include: 'Accepted', 'InProgress', 'TransientFailure', 'Succeeded', 'Failed', 'Canceled'. + :type status: str or ~data_share_management_client.models.Status + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'DataShareErrorInfo'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Union[str, "Status"], + end_time: Optional[datetime.datetime] = None, + error: Optional["DataShareErrorInfo"] = None, + start_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(OperationResponse, self).__init__(**kwargs) + self.end_time = end_time + self.error = error + self.start_time = start_time + self.status = status + + +class ProviderShareSubscription(ProxyDto): + """A provider side share subscription data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :ivar consumer_email: Email of the consumer who created the share subscription. + :vartype consumer_email: str + :ivar consumer_name: Name of the consumer who created the share subscription. + :vartype consumer_name: str + :ivar consumer_tenant_name: Tenant name of the consumer who created the share subscription. + :vartype consumer_tenant_name: str + :ivar created_at: created at. + :vartype created_at: ~datetime.datetime + :ivar provider_email: Email of the provider who created the share. + :vartype provider_email: str + :ivar provider_name: Name of the provider who created the share. + :vartype provider_name: str + :ivar shared_at: Shared at. + :vartype shared_at: ~datetime.datetime + :ivar share_subscription_object_id: share Subscription Object Id. + :vartype share_subscription_object_id: str + :ivar share_subscription_status: Gets the status of share subscription. Possible values + include: 'Active', 'Revoked', 'SourceDeleted', 'Revoking'. + :vartype share_subscription_status: str or + ~data_share_management_client.models.ShareSubscriptionStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'consumer_email': {'readonly': True}, + 'consumer_name': {'readonly': True}, + 'consumer_tenant_name': {'readonly': True}, + 'created_at': {'readonly': True}, + 'provider_email': {'readonly': True}, + 'provider_name': {'readonly': True}, + 'shared_at': {'readonly': True}, + 'share_subscription_object_id': {'readonly': True}, + 'share_subscription_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'consumer_email': {'key': 'properties.consumerEmail', 'type': 'str'}, + 'consumer_name': {'key': 'properties.consumerName', 'type': 'str'}, + 'consumer_tenant_name': {'key': 'properties.consumerTenantName', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'provider_email': {'key': 'properties.providerEmail', 'type': 'str'}, + 'provider_name': {'key': 'properties.providerName', 'type': 'str'}, + 'shared_at': {'key': 'properties.sharedAt', 'type': 'iso-8601'}, + 'share_subscription_object_id': {'key': 'properties.shareSubscriptionObjectId', 'type': 'str'}, + 'share_subscription_status': {'key': 'properties.shareSubscriptionStatus', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProviderShareSubscription, self).__init__(**kwargs) + self.consumer_email = None + self.consumer_name = None + self.consumer_tenant_name = None + self.created_at = None + self.provider_email = None + self.provider_name = None + self.shared_at = None + self.share_subscription_object_id = None + self.share_subscription_status = None + + +class ProviderShareSubscriptionList(msrest.serialization.Model): + """List response for get ShareSubscription. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.ProviderShareSubscription] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ProviderShareSubscription]'}, + } + + def __init__( + self, + *, + value: List["ProviderShareSubscription"], + next_link: Optional[str] = None, + **kwargs + ): + super(ProviderShareSubscriptionList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class SourceShareSynchronizationSetting(msrest.serialization.Model): + """A view of synchronization setting added by the provider. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduledSourceSynchronizationSetting. + + All required parameters must be populated in order to send to Azure. + + :param kind: Required. Kind of synchronization.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ScheduleBased': 'ScheduledSourceSynchronizationSetting'} + } + + def __init__( + self, + **kwargs + ): + super(SourceShareSynchronizationSetting, self).__init__(**kwargs) + self.kind = None + + +class ScheduledSourceSynchronizationSetting(SourceShareSynchronizationSetting): + """A type of synchronization setting based on schedule. + + All required parameters must be populated in order to send to Azure. + + :param kind: Required. Kind of synchronization.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param recurrence_interval: Recurrence Interval. Possible values include: 'Hour', 'Day'. + :type recurrence_interval: str or ~data_share_management_client.models.RecurrenceInterval + :param synchronization_time: Synchronization time. + :type synchronization_time: ~datetime.datetime + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'recurrence_interval': {'key': 'properties.recurrenceInterval', 'type': 'str'}, + 'synchronization_time': {'key': 'properties.synchronizationTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + recurrence_interval: Optional[Union[str, "RecurrenceInterval"]] = None, + synchronization_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(ScheduledSourceSynchronizationSetting, self).__init__(**kwargs) + self.kind = 'ScheduleBased' + self.recurrence_interval = recurrence_interval + self.synchronization_time = synchronization_time + + +class SynchronizationSetting(ProxyDto): + """A Synchronization Setting data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduledSynchronizationSetting. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of synchronization.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ScheduleBased': 'ScheduledSynchronizationSetting'} + } + + def __init__( + self, + **kwargs + ): + super(SynchronizationSetting, self).__init__(**kwargs) + self.kind = 'SynchronizationSetting' + + +class ScheduledSynchronizationSetting(SynchronizationSetting): + """A type of synchronization setting based on schedule. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of synchronization.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar created_at: Time at which the synchronization setting was created. + :vartype created_at: ~datetime.datetime + :ivar provisioning_state: Gets or sets the provisioning state. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param recurrence_interval: Required. Recurrence Interval. Possible values include: 'Hour', + 'Day'. + :type recurrence_interval: str or ~data_share_management_client.models.RecurrenceInterval + :param synchronization_time: Required. Synchronization time. + :type synchronization_time: ~datetime.datetime + :ivar user_name: Name of the user who created the synchronization setting. + :vartype user_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'created_at': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'recurrence_interval': {'required': True}, + 'synchronization_time': {'required': True}, + 'user_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'recurrence_interval': {'key': 'properties.recurrenceInterval', 'type': 'str'}, + 'synchronization_time': {'key': 'properties.synchronizationTime', 'type': 'iso-8601'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + } + + def __init__( + self, + *, + recurrence_interval: Union[str, "RecurrenceInterval"], + synchronization_time: datetime.datetime, + **kwargs + ): + super(ScheduledSynchronizationSetting, self).__init__(**kwargs) + self.kind = 'ScheduleBased' + self.created_at = None + self.provisioning_state = None + self.recurrence_interval = recurrence_interval + self.synchronization_time = synchronization_time + self.user_name = None + + +class Trigger(ProxyDto): + """A Trigger data transfer object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ScheduledTrigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of synchronization.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ScheduleBased': 'ScheduledTrigger'} + } + + def __init__( + self, + **kwargs + ): + super(Trigger, self).__init__(**kwargs) + self.kind = 'Trigger' + + +class ScheduledTrigger(Trigger): + """A type of trigger based on schedule. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of synchronization.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar created_at: Time at which the trigger was created. + :vartype created_at: ~datetime.datetime + :ivar provisioning_state: Gets the provisioning state. Possible values include: 'Succeeded', + 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param recurrence_interval: Required. Recurrence Interval. Possible values include: 'Hour', + 'Day'. + :type recurrence_interval: str or ~data_share_management_client.models.RecurrenceInterval + :param synchronization_mode: Synchronization mode. Possible values include: 'Incremental', + 'FullSync'. + :type synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode + :param synchronization_time: Required. Synchronization time. + :type synchronization_time: ~datetime.datetime + :ivar trigger_status: Gets the trigger state. Possible values include: 'Active', 'Inactive', + 'SourceSynchronizationSettingDeleted'. + :vartype trigger_status: str or ~data_share_management_client.models.TriggerStatus + :ivar user_name: Name of the user who created the trigger. + :vartype user_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'created_at': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'recurrence_interval': {'required': True}, + 'synchronization_time': {'required': True}, + 'trigger_status': {'readonly': True}, + 'user_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'recurrence_interval': {'key': 'properties.recurrenceInterval', 'type': 'str'}, + 'synchronization_mode': {'key': 'properties.synchronizationMode', 'type': 'str'}, + 'synchronization_time': {'key': 'properties.synchronizationTime', 'type': 'iso-8601'}, + 'trigger_status': {'key': 'properties.triggerStatus', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + } + + def __init__( + self, + *, + recurrence_interval: Union[str, "RecurrenceInterval"], + synchronization_time: datetime.datetime, + synchronization_mode: Optional[Union[str, "SynchronizationMode"]] = None, + **kwargs + ): + super(ScheduledTrigger, self).__init__(**kwargs) + self.kind = 'ScheduleBased' + self.created_at = None + self.provisioning_state = None + self.recurrence_interval = recurrence_interval + self.synchronization_mode = synchronization_mode + self.synchronization_time = synchronization_time + self.trigger_status = None + self.user_name = None + + +class Share(ProxyDto): + """A share data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :ivar created_at: Time at which the share was created. + :vartype created_at: ~datetime.datetime + :param description: Share description. + :type description: str + :ivar provisioning_state: Gets or sets the provisioning state. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param share_kind: Share kind. Possible values include: 'CopyBased', 'InPlace'. + :type share_kind: str or ~data_share_management_client.models.ShareKind + :param terms: Share terms. + :type terms: str + :ivar user_email: Email of the user who created the resource. + :vartype user_email: str + :ivar user_name: Name of the user who created the resource. + :vartype user_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'user_email': {'readonly': True}, + 'user_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'share_kind': {'key': 'properties.shareKind', 'type': 'str'}, + 'terms': {'key': 'properties.terms', 'type': 'str'}, + 'user_email': {'key': 'properties.userEmail', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + share_kind: Optional[Union[str, "ShareKind"]] = None, + terms: Optional[str] = None, + **kwargs + ): + super(Share, self).__init__(**kwargs) + self.created_at = None + self.description = description + self.provisioning_state = None + self.share_kind = share_kind + self.terms = terms + self.user_email = None + self.user_name = None + + +class ShareList(msrest.serialization.Model): + """List response for get Shares. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.Share] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Share]'}, + } + + def __init__( + self, + *, + value: List["Share"], + next_link: Optional[str] = None, + **kwargs + ): + super(ShareList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class ShareSubscription(ProxyDto): + """A share subscription data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :ivar created_at: Time at which the share subscription was created. + :vartype created_at: ~datetime.datetime + :param invitation_id: Required. The invitation id. + :type invitation_id: str + :ivar provider_email: Email of the provider who created the resource. + :vartype provider_email: str + :ivar provider_name: Name of the provider who created the resource. + :vartype provider_name: str + :ivar provider_tenant_name: Tenant name of the provider who created the resource. + :vartype provider_tenant_name: str + :ivar provisioning_state: Provisioning state of the share subscription. Possible values + include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :ivar share_description: Description of share. + :vartype share_description: str + :ivar share_kind: Kind of share. Possible values include: 'CopyBased', 'InPlace'. + :vartype share_kind: str or ~data_share_management_client.models.ShareKind + :ivar share_name: Name of the share. + :vartype share_name: str + :ivar share_subscription_status: Gets the current status of share subscription. Possible values + include: 'Active', 'Revoked', 'SourceDeleted', 'Revoking'. + :vartype share_subscription_status: str or + ~data_share_management_client.models.ShareSubscriptionStatus + :ivar share_terms: Terms of a share. + :vartype share_terms: str + :param source_share_location: Required. Source share location. + :type source_share_location: str + :ivar user_email: Email of the user who created the resource. + :vartype user_email: str + :ivar user_name: Name of the user who created the resource. + :vartype user_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_at': {'readonly': True}, + 'invitation_id': {'required': True}, + 'provider_email': {'readonly': True}, + 'provider_name': {'readonly': True}, + 'provider_tenant_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'share_description': {'readonly': True}, + 'share_kind': {'readonly': True}, + 'share_name': {'readonly': True}, + 'share_subscription_status': {'readonly': True}, + 'share_terms': {'readonly': True}, + 'source_share_location': {'required': True}, + 'user_email': {'readonly': True}, + 'user_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'created_at': {'key': 'properties.createdAt', 'type': 'iso-8601'}, + 'invitation_id': {'key': 'properties.invitationId', 'type': 'str'}, + 'provider_email': {'key': 'properties.providerEmail', 'type': 'str'}, + 'provider_name': {'key': 'properties.providerName', 'type': 'str'}, + 'provider_tenant_name': {'key': 'properties.providerTenantName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'share_description': {'key': 'properties.shareDescription', 'type': 'str'}, + 'share_kind': {'key': 'properties.shareKind', 'type': 'str'}, + 'share_name': {'key': 'properties.shareName', 'type': 'str'}, + 'share_subscription_status': {'key': 'properties.shareSubscriptionStatus', 'type': 'str'}, + 'share_terms': {'key': 'properties.shareTerms', 'type': 'str'}, + 'source_share_location': {'key': 'properties.sourceShareLocation', 'type': 'str'}, + 'user_email': {'key': 'properties.userEmail', 'type': 'str'}, + 'user_name': {'key': 'properties.userName', 'type': 'str'}, + } + + def __init__( + self, + *, + invitation_id: str, + source_share_location: str, + **kwargs + ): + super(ShareSubscription, self).__init__(**kwargs) + self.created_at = None + self.invitation_id = invitation_id + self.provider_email = None + self.provider_name = None + self.provider_tenant_name = None + self.provisioning_state = None + self.share_description = None + self.share_kind = None + self.share_name = None + self.share_subscription_status = None + self.share_terms = None + self.source_share_location = source_share_location + self.user_email = None + self.user_name = None + + +class ShareSubscriptionList(msrest.serialization.Model): + """List response for get ShareSubscription. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.ShareSubscription] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ShareSubscription]'}, + } + + def __init__( + self, + *, + value: List["ShareSubscription"], + next_link: Optional[str] = None, + **kwargs + ): + super(ShareSubscriptionList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class ShareSubscriptionSynchronization(msrest.serialization.Model): + """A ShareSubscriptionSynchronization data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar duration_ms: Synchronization duration. + :vartype duration_ms: int + :ivar end_time: End time of synchronization. + :vartype end_time: ~datetime.datetime + :ivar message: message of Synchronization. + :vartype message: str + :ivar start_time: start time of synchronization. + :vartype start_time: ~datetime.datetime + :ivar status: Raw Status. + :vartype status: str + :param synchronization_id: Required. Synchronization id. + :type synchronization_id: str + :ivar synchronization_mode: Synchronization Mode. Possible values include: 'Incremental', + 'FullSync'. + :vartype synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode + """ + + _validation = { + 'duration_ms': {'readonly': True}, + 'end_time': {'readonly': True}, + 'message': {'readonly': True}, + 'start_time': {'readonly': True}, + 'status': {'readonly': True}, + 'synchronization_id': {'required': True}, + 'synchronization_mode': {'readonly': True}, + } + + _attribute_map = { + 'duration_ms': {'key': 'durationMs', 'type': 'int'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'synchronization_id': {'key': 'synchronizationId', 'type': 'str'}, + 'synchronization_mode': {'key': 'synchronizationMode', 'type': 'str'}, + } + + def __init__( + self, + *, + synchronization_id: str, + **kwargs + ): + super(ShareSubscriptionSynchronization, self).__init__(**kwargs) + self.duration_ms = None + self.end_time = None + self.message = None + self.start_time = None + self.status = None + self.synchronization_id = synchronization_id + self.synchronization_mode = None + + +class ShareSubscriptionSynchronizationList(msrest.serialization.Model): + """A consumer side list of share subscription synchronizations. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.ShareSubscriptionSynchronization] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ShareSubscriptionSynchronization]'}, + } + + def __init__( + self, + *, + value: List["ShareSubscriptionSynchronization"], + next_link: Optional[str] = None, + **kwargs + ): + super(ShareSubscriptionSynchronizationList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class ShareSynchronization(msrest.serialization.Model): + """A ShareSynchronization data transfer object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param consumer_email: Email of the user who created the synchronization. + :type consumer_email: str + :param consumer_name: Name of the user who created the synchronization. + :type consumer_name: str + :param consumer_tenant_name: Tenant name of the consumer who created the synchronization. + :type consumer_tenant_name: str + :param duration_ms: synchronization duration. + :type duration_ms: int + :param end_time: End time of synchronization. + :type end_time: ~datetime.datetime + :param message: message of synchronization. + :type message: str + :param start_time: start time of synchronization. + :type start_time: ~datetime.datetime + :param status: Raw Status. + :type status: str + :param synchronization_id: Synchronization id. + :type synchronization_id: str + :ivar synchronization_mode: Synchronization mode. Possible values include: 'Incremental', + 'FullSync'. + :vartype synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode + """ + + _validation = { + 'synchronization_mode': {'readonly': True}, + } + + _attribute_map = { + 'consumer_email': {'key': 'consumerEmail', 'type': 'str'}, + 'consumer_name': {'key': 'consumerName', 'type': 'str'}, + 'consumer_tenant_name': {'key': 'consumerTenantName', 'type': 'str'}, + 'duration_ms': {'key': 'durationMs', 'type': 'int'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'synchronization_id': {'key': 'synchronizationId', 'type': 'str'}, + 'synchronization_mode': {'key': 'synchronizationMode', 'type': 'str'}, + } + + def __init__( + self, + *, + consumer_email: Optional[str] = None, + consumer_name: Optional[str] = None, + consumer_tenant_name: Optional[str] = None, + duration_ms: Optional[int] = None, + end_time: Optional[datetime.datetime] = None, + message: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + status: Optional[str] = None, + synchronization_id: Optional[str] = None, + **kwargs + ): + super(ShareSynchronization, self).__init__(**kwargs) + self.consumer_email = consumer_email + self.consumer_name = consumer_name + self.consumer_tenant_name = consumer_tenant_name + self.duration_ms = duration_ms + self.end_time = end_time + self.message = message + self.start_time = start_time + self.status = status + self.synchronization_id = synchronization_id + self.synchronization_mode = None + + +class ShareSynchronizationList(msrest.serialization.Model): + """List response for get ShareSynchronization. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.ShareSynchronization] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ShareSynchronization]'}, + } + + def __init__( + self, + *, + value: List["ShareSynchronization"], + next_link: Optional[str] = None, + **kwargs + ): + super(ShareSynchronizationList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class SourceShareSynchronizationSettingList(msrest.serialization.Model): + """List response for get source share Synchronization settings. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.SourceShareSynchronizationSetting] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[SourceShareSynchronizationSetting]'}, + } + + def __init__( + self, + *, + value: List["SourceShareSynchronizationSetting"], + next_link: Optional[str] = None, + **kwargs + ): + super(SourceShareSynchronizationSettingList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class SqlDBTableDataSet(DataSet): + """A SQL DB table data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param database_name: Database name of the source data set. + :type database_name: str + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param schema_name: Schema of the table. Default value is dbo. + :type schema_name: str + :param sql_server_resource_id: Resource id of SQL server. + :type sql_server_resource_id: str + :param table_name: SQL DB table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'schema_name': {'key': 'properties.schemaName', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__( + self, + *, + database_name: Optional[str] = None, + schema_name: Optional[str] = None, + sql_server_resource_id: Optional[str] = None, + table_name: Optional[str] = None, + **kwargs + ): + super(SqlDBTableDataSet, self).__init__(**kwargs) + self.kind = 'SqlDBTable' + self.database_name = database_name + self.data_set_id = None + self.schema_name = schema_name + self.sql_server_resource_id = sql_server_resource_id + self.table_name = table_name + + +class SqlDBTableDataSetMapping(DataSetMapping): + """A SQL DB Table data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param database_name: Required. DatabaseName name of the sink data set. + :type database_name: str + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param schema_name: Required. Schema of the table. Default value is dbo. + :type schema_name: str + :param sql_server_resource_id: Required. Resource id of SQL server. + :type sql_server_resource_id: str + :param table_name: Required. SQL DB table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'database_name': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'schema_name': {'required': True}, + 'sql_server_resource_id': {'required': True}, + 'table_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'schema_name': {'key': 'properties.schemaName', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__( + self, + *, + database_name: str, + data_set_id: str, + schema_name: str, + sql_server_resource_id: str, + table_name: str, + **kwargs + ): + super(SqlDBTableDataSetMapping, self).__init__(**kwargs) + self.kind = 'SqlDBTable' + self.database_name = database_name + self.data_set_id = data_set_id + self.data_set_mapping_status = None + self.provisioning_state = None + self.schema_name = schema_name + self.sql_server_resource_id = sql_server_resource_id + self.table_name = table_name + + +class SqlDwTableDataSet(DataSet): + """A SQL DW table data set. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set.Constant filled by server. Possible values include: + 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', + 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable', + 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :ivar data_set_id: Unique id for identifying a data set resource. + :vartype data_set_id: str + :param data_warehouse_name: DataWarehouse name of the source data set. + :type data_warehouse_name: str + :param schema_name: Schema of the table. Default value is dbo. + :type schema_name: str + :param sql_server_resource_id: Resource id of SQL server. + :type sql_server_resource_id: str + :param table_name: SQL DW table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_warehouse_name': {'key': 'properties.dataWarehouseName', 'type': 'str'}, + 'schema_name': {'key': 'properties.schemaName', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__( + self, + *, + data_warehouse_name: Optional[str] = None, + schema_name: Optional[str] = None, + sql_server_resource_id: Optional[str] = None, + table_name: Optional[str] = None, + **kwargs + ): + super(SqlDwTableDataSet, self).__init__(**kwargs) + self.kind = 'SqlDWTable' + self.data_set_id = None + self.data_warehouse_name = data_warehouse_name + self.schema_name = schema_name + self.sql_server_resource_id = sql_server_resource_id + self.table_name = table_name + + +class SqlDwTableDataSetMapping(DataSetMapping): + """A SQL DW Table data set mapping. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the azure resource. + :vartype id: str + :ivar name: Name of the azure resource. + :vartype name: str + :ivar type: Type of the azure resource. + :vartype type: str + :param kind: Required. Kind of data set mapping.Constant filled by server. Possible values + include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', + 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', + 'SqlDBTable', 'SqlDWTable', 'ScheduleBased'. + :type kind: str or ~data_share_management_client.models.Kind + :param data_set_id: Required. The id of the source data set. + :type data_set_id: str + :ivar data_set_mapping_status: Gets the status of the data set mapping. Possible values + include: 'Ok', 'Broken'. + :vartype data_set_mapping_status: str or + ~data_share_management_client.models.DataSetMappingStatus + :param data_warehouse_name: Required. DataWarehouse name of the source data set. + :type data_warehouse_name: str + :ivar provisioning_state: Provisioning state of the data set mapping. Possible values include: + 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed'. + :vartype provisioning_state: str or ~data_share_management_client.models.ProvisioningState + :param schema_name: Required. Schema of the table. Default value is dbo. + :type schema_name: str + :param sql_server_resource_id: Required. Resource id of SQL server. + :type sql_server_resource_id: str + :param table_name: Required. SQL DW table name. + :type table_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'data_set_id': {'required': True}, + 'data_set_mapping_status': {'readonly': True}, + 'data_warehouse_name': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'schema_name': {'required': True}, + 'sql_server_resource_id': {'required': True}, + 'table_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_set_id': {'key': 'properties.dataSetId', 'type': 'str'}, + 'data_set_mapping_status': {'key': 'properties.dataSetMappingStatus', 'type': 'str'}, + 'data_warehouse_name': {'key': 'properties.dataWarehouseName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'schema_name': {'key': 'properties.schemaName', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'properties.sqlServerResourceId', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + } + + def __init__( + self, + *, + data_set_id: str, + data_warehouse_name: str, + schema_name: str, + sql_server_resource_id: str, + table_name: str, + **kwargs + ): + super(SqlDwTableDataSetMapping, self).__init__(**kwargs) + self.kind = 'SqlDWTable' + self.data_set_id = data_set_id + self.data_set_mapping_status = None + self.data_warehouse_name = data_warehouse_name + self.provisioning_state = None + self.schema_name = schema_name + self.sql_server_resource_id = sql_server_resource_id + self.table_name = table_name + + +class SynchronizationDetails(msrest.serialization.Model): + """Synchronization details at data set level. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar data_set_id: Id of data set. + :vartype data_set_id: str + :ivar data_set_type: Type of the data set. Possible values include: 'Blob', 'Container', + 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', + 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SqlDBTable', 'SqlDWTable'. + :vartype data_set_type: str or ~data_share_management_client.models.DataSetType + :ivar duration_ms: Duration of data set level copy. + :vartype duration_ms: int + :ivar end_time: End time of data set level copy. + :vartype end_time: ~datetime.datetime + :ivar files_read: The number of files read from the source data set. + :vartype files_read: long + :ivar files_written: The number of files written into the sink data set. + :vartype files_written: long + :ivar message: Error message if any. + :vartype message: str + :ivar name: Name of the data set. + :vartype name: str + :ivar rows_copied: The number of files copied into the sink data set. + :vartype rows_copied: long + :ivar rows_read: The number of rows read from the source data set. + :vartype rows_read: long + :ivar size_read: The size of the data read from the source data set in bytes. + :vartype size_read: long + :ivar size_written: The size of the data written into the sink data set in bytes. + :vartype size_written: long + :ivar start_time: Start time of data set level copy. + :vartype start_time: ~datetime.datetime + :ivar status: Raw Status. + :vartype status: str + :ivar v_core: The vCore units consumed for the data set synchronization. + :vartype v_core: long + """ + + _validation = { + 'data_set_id': {'readonly': True}, + 'data_set_type': {'readonly': True}, + 'duration_ms': {'readonly': True}, + 'end_time': {'readonly': True}, + 'files_read': {'readonly': True}, + 'files_written': {'readonly': True}, + 'message': {'readonly': True}, + 'name': {'readonly': True}, + 'rows_copied': {'readonly': True}, + 'rows_read': {'readonly': True}, + 'size_read': {'readonly': True}, + 'size_written': {'readonly': True}, + 'start_time': {'readonly': True}, + 'status': {'readonly': True}, + 'v_core': {'readonly': True}, + } + + _attribute_map = { + 'data_set_id': {'key': 'dataSetId', 'type': 'str'}, + 'data_set_type': {'key': 'dataSetType', 'type': 'str'}, + 'duration_ms': {'key': 'durationMs', 'type': 'int'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'files_read': {'key': 'filesRead', 'type': 'long'}, + 'files_written': {'key': 'filesWritten', 'type': 'long'}, + 'message': {'key': 'message', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'rows_copied': {'key': 'rowsCopied', 'type': 'long'}, + 'rows_read': {'key': 'rowsRead', 'type': 'long'}, + 'size_read': {'key': 'sizeRead', 'type': 'long'}, + 'size_written': {'key': 'sizeWritten', 'type': 'long'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'v_core': {'key': 'vCore', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(SynchronizationDetails, self).__init__(**kwargs) + self.data_set_id = None + self.data_set_type = None + self.duration_ms = None + self.end_time = None + self.files_read = None + self.files_written = None + self.message = None + self.name = None + self.rows_copied = None + self.rows_read = None + self.size_read = None + self.size_written = None + self.start_time = None + self.status = None + self.v_core = None + + +class SynchronizationDetailsList(msrest.serialization.Model): + """details of synchronization. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.SynchronizationDetails] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[SynchronizationDetails]'}, + } + + def __init__( + self, + *, + value: List["SynchronizationDetails"], + next_link: Optional[str] = None, + **kwargs + ): + super(SynchronizationDetailsList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class SynchronizationSettingList(msrest.serialization.Model): + """List response for get Synchronization settings. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.SynchronizationSetting] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[SynchronizationSetting]'}, + } + + def __init__( + self, + *, + value: List["SynchronizationSetting"], + next_link: Optional[str] = None, + **kwargs + ): + super(SynchronizationSettingList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class Synchronize(msrest.serialization.Model): + """Payload for the synchronizing the data. + + :param synchronization_mode: Mode of synchronization used in triggers and snapshot sync. + Incremental by default. Possible values include: 'Incremental', 'FullSync'. + :type synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode + """ + + _attribute_map = { + 'synchronization_mode': {'key': 'synchronizationMode', 'type': 'str'}, + } + + def __init__( + self, + *, + synchronization_mode: Optional[Union[str, "SynchronizationMode"]] = None, + **kwargs + ): + super(Synchronize, self).__init__(**kwargs) + self.synchronization_mode = synchronization_mode + + +class TriggerList(msrest.serialization.Model): + """List response for get triggers. + + All required parameters must be populated in order to send to Azure. + + :param next_link: The Url of next result page. + :type next_link: str + :param value: Required. Collection of items of type DataTransferObjects. + :type value: list[~data_share_management_client.models.Trigger] + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[Trigger]'}, + } + + def __init__( + self, + *, + value: List["Trigger"], + next_link: Optional[str] = None, + **kwargs + ): + super(TriggerList, self).__init__(**kwargs) + self.next_link = next_link + self.value = value diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/__init__.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/__init__.py new file mode 100644 index 00000000000..72ad85b0b3c --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/__init__.py @@ -0,0 +1,35 @@ +# 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 ._account_operations import AccountOperations +from ._consumer_invitation_operations import ConsumerInvitationOperations +from ._data_set_operations import DataSetOperations +from ._data_set_mapping_operations import DataSetMappingOperations +from ._invitation_operations import InvitationOperations +from ._operation_operations import OperationOperations +from ._share_operations import ShareOperations +from ._provider_share_subscription_operations import ProviderShareSubscriptionOperations +from ._share_subscription_operations import ShareSubscriptionOperations +from ._consumer_source_data_set_operations import ConsumerSourceDataSetOperations +from ._synchronization_setting_operations import SynchronizationSettingOperations +from ._trigger_operations import TriggerOperations + +__all__ = [ + 'AccountOperations', + 'ConsumerInvitationOperations', + 'DataSetOperations', + 'DataSetMappingOperations', + 'InvitationOperations', + 'OperationOperations', + 'ShareOperations', + 'ProviderShareSubscriptionOperations', + 'ShareSubscriptionOperations', + 'ConsumerSourceDataSetOperations', + 'SynchronizationSettingOperations', + 'TriggerOperations', +] diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_account_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_account_operations.py new file mode 100644 index 00000000000..2b06a214c51 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_account_operations.py @@ -0,0 +1,539 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AccountOperations(object): + """AccountOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Account" + """Get an account. + + Get an account under a resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Account or the result of cls(response) + :rtype: ~data_share_management_client.models.Account + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + + def _create_initial( + self, + resource_group_name, # type: str + account_name, # type: str + identity, # type: "models.Identity" + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + **kwargs # type: Any + ): + # type: (...) -> "models.Account" + cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _account = models.Account(location=location, tags=tags, identity=identity) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_account, 'Account') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Account', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + + def begin_create( + self, + resource_group_name, # type: str + account_name, # type: str + identity, # type: "models.Identity" + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + **kwargs # type: Any + ): + # type: (...) -> "models.Account" + """Create an account. + + Create an account in the given resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param identity: Identity Info on the Account. + :type identity: ~data_share_management_client.models.Identity + :param location: Location of the azure resource. + :type location: str + :param tags: Tags on the azure resource. + :type tags: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns Account + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.Account] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + identity=identity, + location=location, + tags=tags, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + + def _delete_initial( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OperationResponse" + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self._delete_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + + def begin_delete( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OperationResponse" + """DeleteAccount. + + Delete an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns OperationResponse + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + tags=None, # type: Optional[Dict[str, str]] + **kwargs # type: Any + ): + # type: (...) -> "models.Account" + """Patch an account. + + Patch a given account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param tags: Tags on the azure resource. + :type tags: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Account or the result of cls(response) + :rtype: ~data_share_management_client.models.Account + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Account"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _account_update_parameters = models.AccountUpdateParameters(tags=tags) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_account_update_parameters, 'AccountUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Account', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}'} + + def list_by_subscription( + self, + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.AccountList" + """List Accounts in Subscription. + + List Accounts in a subscription. + + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccountList or the result of cls(response) + :rtype: ~data_share_management_client.models.AccountList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccountList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # 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) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AccountList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataShare/accounts'} + + def list_by_resource_group( + self, + resource_group_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.AccountList" + """List Accounts in ResourceGroup. + + List Accounts in a resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccountList or the result of cls(response) + :rtype: ~data_share_management_client.models.AccountList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccountList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # 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'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AccountList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_consumer_invitation_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_consumer_invitation_operations.py new file mode 100644 index 00000000000..61235cd44a9 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_consumer_invitation_operations.py @@ -0,0 +1,231 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ConsumerInvitationOperations(object): + """ConsumerInvitationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def reject_invitation( + self, + location, # type: str + invitation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ConsumerInvitation" + """Reject an invitation. + + Rejects the invitation identified by invitationId. + + :param location: Location of the invitation. + :type location: str + :param invitation_id: Unique id of the invitation. + :type invitation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConsumerInvitation or the result of cls(response) + :rtype: ~data_share_management_client.models.ConsumerInvitation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerInvitation"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _invitation = models.ConsumerInvitation(invitation_id=invitation_id) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.reject_invitation.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_invitation, 'ConsumerInvitation') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('ConsumerInvitation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + reject_invitation.metadata = {'url': '/providers/Microsoft.DataShare/locations/{location}/RejectInvitation'} + + def get( + self, + location, # type: str + invitation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ConsumerInvitation" + """Get an invitation. + + Gets the invitation identified by invitationId. + + :param location: Location of the invitation. + :type location: str + :param invitation_id: An invitation id. + :type invitation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConsumerInvitation or the result of cls(response) + :rtype: ~data_share_management_client.models.ConsumerInvitation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerInvitation"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'location': self._serialize.url("location", location, 'str'), + 'invitationId': self._serialize.url("invitation_id", invitation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('ConsumerInvitation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/providers/Microsoft.DataShare/locations/{location}/consumerInvitations/{invitationId}'} + + def list_invitation( + self, + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.ConsumerInvitationList" + """Lists invitations. + + List the invitations. + + :param skip_token: The continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConsumerInvitationList or the result of cls(response) + :rtype: ~data_share_management_client.models.ConsumerInvitationList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerInvitationList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_invitation.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ConsumerInvitationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_invitation.metadata = {'url': '/providers/Microsoft.DataShare/ListInvitations'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_consumer_source_data_set_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_consumer_source_data_set_operations.py new file mode 100644 index 00000000000..f45b8832698 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_consumer_source_data_set_operations.py @@ -0,0 +1,124 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ConsumerSourceDataSetOperations(object): + """ConsumerSourceDataSetOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_share_subscription( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.ConsumerSourceDataSetList" + """Get source dataSets of a shareSubscription. + + Get source dataSets of a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConsumerSourceDataSetList or the result of cls(response) + :rtype: ~data_share_management_client.models.ConsumerSourceDataSetList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ConsumerSourceDataSetList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share_subscription.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ConsumerSourceDataSetList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/ConsumerSourceDataSets'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_data_set_mapping_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_data_set_mapping_operations.py new file mode 100644 index 00000000000..be59ce3d9b9 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_data_set_mapping_operations.py @@ -0,0 +1,337 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DataSetMappingOperations(object): + """DataSetMappingOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + data_set_mapping_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DataSetMapping" + """Get a DataSetMapping in a shareSubscription. + + Get DataSetMapping in a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param data_set_mapping_name: The name of the dataSetMapping. + :type data_set_mapping_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataSetMapping or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSetMapping + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetMapping"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'dataSetMappingName': self._serialize.url("data_set_mapping_name", data_set_mapping_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('DataSetMapping', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + data_set_mapping_name, # type: str + data_set_mapping, # type: "models.DataSetMapping" + **kwargs # type: Any + ): + # type: (...) -> "models.DataSetMapping" + """Create a DataSetMapping. + + Maps a source data set in the source share to a sink data set in the share subscription. + Enables copying the data set from source to destination. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription which will hold the data set + sink. + :type share_subscription_name: str + :param data_set_mapping_name: The name of the data set mapping to be created. + :type data_set_mapping_name: str + :param data_set_mapping: Destination data set configuration details. + :type data_set_mapping: ~data_share_management_client.models.DataSetMapping + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataSetMapping or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSetMapping or ~data_share_management_client.models.DataSetMapping + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetMapping"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'dataSetMappingName': self._serialize.url("data_set_mapping_name", data_set_mapping_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(data_set_mapping, 'DataSetMapping') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DataSetMapping', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataSetMapping', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + data_set_mapping_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a DataSetMapping in a shareSubscription. + + Delete DataSetMapping in a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param data_set_mapping_name: The name of the dataSetMapping. + :type data_set_mapping_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'dataSetMappingName': self._serialize.url("data_set_mapping_name", data_set_mapping_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}'} + + def list_by_share_subscription( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.DataSetMappingList" + """List DataSetMappings in a share subscription. + + List DataSetMappings in a share subscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription. + :type share_subscription_name: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataSetMappingList or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSetMappingList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetMappingList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share_subscription.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataSetMappingList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_data_set_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_data_set_operations.py new file mode 100644 index 00000000000..95929ba4858 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_data_set_operations.py @@ -0,0 +1,374 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DataSetOperations(object): + """DataSetOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + data_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DataSet" + """Get a DataSet in a share. + + Get DataSet in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param data_set_name: The name of the dataSet. + :type data_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataSet or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataSet"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'dataSetName': self._serialize.url("data_set_name", data_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('DataSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + data_set_name, # type: str + data_set, # type: "models.DataSet" + **kwargs # type: Any + ): + # type: (...) -> "models.DataSet" + """Create a DataSet. + + Adds a new data set to an existing share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share to add the data set to. + :type share_name: str + :param data_set_name: The name of the dataSet. + :type data_set_name: str + :param data_set: The new data set information. + :type data_set: ~data_share_management_client.models.DataSet + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataSet or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSet or ~data_share_management_client.models.DataSet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataSet"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'dataSetName': self._serialize.url("data_set_name", data_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(data_set, 'DataSet') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DataSet', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataSet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + + def _delete_initial( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + data_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self._delete_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'dataSetName': self._serialize.url("data_set_name", data_set_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + + def begin_delete( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + data_set_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a DataSet in a share. + + Delete DataSet in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param data_set_name: The name of the dataSet. + :type data_set_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + data_set_name=data_set_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}'} + + def list_by_share( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.DataSetList" + """List DataSets in a share. + + List DataSets in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataSetList or the result of cls(response) + :rtype: ~data_share_management_client.models.DataSetList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataSetList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataSetList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_invitation_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_invitation_operations.py new file mode 100644 index 00000000000..f6d2e38dc1a --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_invitation_operations.py @@ -0,0 +1,345 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class InvitationOperations(object): + """InvitationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + invitation_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Invitation" + """Get an invitation in a share. + + Get Invitation in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param invitation_name: The name of the invitation. + :type invitation_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Invitation or the result of cls(response) + :rtype: ~data_share_management_client.models.Invitation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Invitation"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'invitationName': self._serialize.url("invitation_name", invitation_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Invitation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + invitation_name, # type: str + target_active_directory_id=None, # type: Optional[str] + target_email=None, # type: Optional[str] + target_object_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Invitation" + """Create an invitation. + + Sends a new invitation to a recipient to access a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share to send the invitation for. + :type share_name: str + :param invitation_name: The name of the invitation. + :type invitation_name: str + :param target_active_directory_id: The target Azure AD Id. Can't be combined with email. + :type target_active_directory_id: str + :param target_email: The email the invitation is directed to. + :type target_email: str + :param target_object_id: The target user or application Id that invitation is being sent to. + Must be specified along TargetActiveDirectoryId. This enables sending + invitations to specific users or applications in an AD tenant. + :type target_object_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Invitation or the result of cls(response) + :rtype: ~data_share_management_client.models.Invitation or ~data_share_management_client.models.Invitation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Invitation"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _invitation = models.Invitation(target_active_directory_id=target_active_directory_id, target_email=target_email, target_object_id=target_object_id) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'invitationName': self._serialize.url("invitation_name", invitation_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_invitation, 'Invitation') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Invitation', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Invitation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + invitation_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete an invitation in a share. + + Delete Invitation in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param invitation_name: The name of the invitation. + :type invitation_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'invitationName': self._serialize.url("invitation_name", invitation_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}'} + + def list_by_share( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.InvitationList" + """List invitations in a share. + + List all Invitations in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: The continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: InvitationList or the result of cls(response) + :rtype: ~data_share_management_client.models.InvitationList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.InvitationList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('InvitationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_operation_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_operation_operations.py new file mode 100644 index 00000000000..ea88e363ce7 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_operation_operations.py @@ -0,0 +1,103 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations(object): + """OperationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.OperationList" + """List of available operations. + + Lists the available operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationList or the result of cls(response) + :rtype: ~data_share_management_client.models.OperationList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.DataShare/operations'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_provider_share_subscription_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_provider_share_subscription_operations.py new file mode 100644 index 00000000000..8c663fab40b --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_provider_share_subscription_operations.py @@ -0,0 +1,372 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ProviderShareSubscriptionOperations(object): + """ProviderShareSubscriptionOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get_by_share( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + provider_share_subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ProviderShareSubscription" + """Get share subscription in a provider share. + + Get share subscription in a provider share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param provider_share_subscription_id: To locate shareSubscription. + :type provider_share_subscription_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProviderShareSubscription or the result of cls(response) + :rtype: ~data_share_management_client.models.ProviderShareSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self.get_by_share.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'providerShareSubscriptionId': self._serialize.url("provider_share_subscription_id", provider_share_subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}'} + + def list_by_share( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.ProviderShareSubscriptionList" + """List share subscriptions in a provider share. + + List of available share subscriptions to a provider share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: Continuation Token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProviderShareSubscriptionList or the result of cls(response) + :rtype: ~data_share_management_client.models.ProviderShareSubscriptionList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscriptionList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProviderShareSubscriptionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions'} + + def _revoke_initial( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + provider_share_subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ProviderShareSubscription" + cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self._revoke_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'providerShareSubscriptionId': self._serialize.url("provider_share_subscription_id", provider_share_subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _revoke_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/revoke'} + + def begin_revoke( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + provider_share_subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ProviderShareSubscription" + """Revoke share subscription in a provider share. + + Revoke share subscription in a provider share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param provider_share_subscription_id: To locate shareSubscription. + :type provider_share_subscription_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns ProviderShareSubscription + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.ProviderShareSubscription] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] + raw_result = self._revoke_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + provider_share_subscription_id=provider_share_subscription_id, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_revoke.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/revoke'} + + def reinstate( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + provider_share_subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ProviderShareSubscription" + """Reinstate share subscription in a provider share. + + Reinstate share subscription in a provider share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param provider_share_subscription_id: To locate shareSubscription. + :type provider_share_subscription_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProviderShareSubscription or the result of cls(response) + :rtype: ~data_share_management_client.models.ProviderShareSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProviderShareSubscription"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self.reinstate.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'providerShareSubscriptionId': self._serialize.url("provider_share_subscription_id", provider_share_subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('ProviderShareSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + reinstate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/reinstate'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_share_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_share_operations.py new file mode 100644 index 00000000000..a891d441424 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_share_operations.py @@ -0,0 +1,574 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ShareOperations(object): + """ShareOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Share" + """Get a share. + + Get a specified share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share to retrieve. + :type share_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Share or the result of cls(response) + :rtype: ~data_share_management_client.models.Share + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Share"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + description=None, # type: Optional[str] + share_kind=None, # type: Optional[Union[str, "models.ShareKind"]] + terms=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.Share" + """Create a share. + + Create a share in the given account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param description: Share description. + :type description: str + :param share_kind: Share kind. + :type share_kind: str or ~data_share_management_client.models.ShareKind + :param terms: Share terms. + :type terms: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Share or the result of cls(response) + :rtype: ~data_share_management_client.models.Share or ~data_share_management_client.models.Share + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Share"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _share = models.Share(description=description, share_kind=share_kind, terms=terms) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_share, 'Share') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Share', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Share', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + + def _delete_initial( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OperationResponse" + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self._delete_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + + def begin_delete( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OperationResponse" + """Delete a share. + + Deletes a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns OperationResponse + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}'} + + def list_by_account( + self, + resource_group_name, # type: str + account_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.ShareList" + """List shares in an account. + + List of available shares under an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param skip_token: Continuation Token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareList or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_account.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ShareList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares'} + + def list_synchronization( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.ShareSynchronizationList" + """List synchronizations of a share. + + List Synchronizations in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareSynchronizationList or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSynchronizationList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSynchronizationList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronization.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ShareSynchronizationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizations'} + + def list_synchronization_detail( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + skip_token=None, # type: Optional[str] + consumer_email=None, # type: Optional[str] + consumer_name=None, # type: Optional[str] + consumer_tenant_name=None, # type: Optional[str] + duration_ms=None, # type: Optional[int] + end_time=None, # type: Optional[datetime.datetime] + message=None, # type: Optional[str] + start_time=None, # type: Optional[datetime.datetime] + status=None, # type: Optional[str] + synchronization_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SynchronizationDetailsList" + """List synchronization details. + + List data set level details for a share synchronization. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: Continuation token. + :type skip_token: str + :param consumer_email: Email of the user who created the synchronization. + :type consumer_email: str + :param consumer_name: Name of the user who created the synchronization. + :type consumer_name: str + :param consumer_tenant_name: Tenant name of the consumer who created the synchronization. + :type consumer_tenant_name: str + :param duration_ms: synchronization duration. + :type duration_ms: int + :param end_time: End time of synchronization. + :type end_time: ~datetime.datetime + :param message: message of synchronization. + :type message: str + :param start_time: start time of synchronization. + :type start_time: ~datetime.datetime + :param status: Raw Status. + :type status: str + :param synchronization_id: Synchronization id. + :type synchronization_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SynchronizationDetailsList or the result of cls(response) + :rtype: ~data_share_management_client.models.SynchronizationDetailsList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationDetailsList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + _share_synchronization = models.ShareSynchronization(consumer_email=consumer_email, consumer_name=consumer_name, consumer_tenant_name=consumer_tenant_name, duration_ms=duration_ms, end_time=end_time, message=message, start_time=start_time, status=status, synchronization_id=synchronization_id) + api_version = "2019-11-01" + content_type = "application/json" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronization_detail.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_share_synchronization, 'ShareSynchronization') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SynchronizationDetailsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_synchronization_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizationDetails'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_share_subscription_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_share_subscription_operations.py new file mode 100644 index 00000000000..59e710c1c5b --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_share_subscription_operations.py @@ -0,0 +1,870 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ShareSubscriptionOperations(object): + """ShareSubscriptionOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ShareSubscription" + """Get a shareSubscription in an account. + + Get shareSubscription in an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareSubscription or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscription"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('ShareSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + invitation_id, # type: str + source_share_location, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ShareSubscription" + """Create a shareSubscription in an account. + + Create shareSubscription in an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param invitation_id: The invitation id. + :type invitation_id: str + :param source_share_location: Source share location. + :type source_share_location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareSubscription or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSubscription or ~data_share_management_client.models.ShareSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscription"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _share_subscription = models.ShareSubscription(invitation_id=invitation_id, source_share_location=source_share_location) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_share_subscription, 'ShareSubscription') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ShareSubscription', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ShareSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} + + def _delete_initial( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OperationResponse" + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self._delete_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} + + def begin_delete( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OperationResponse" + """Delete a shareSubscription in an account. + + Delete shareSubscription in an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns OperationResponse + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}'} + + def list_by_account( + self, + resource_group_name, # type: str + account_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.ShareSubscriptionList" + """List share subscriptions in an account. + + List of available share subscriptions under an account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param skip_token: Continuation Token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareSubscriptionList or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSubscriptionList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_account.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ShareSubscriptionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions'} + + def list_source_share_synchronization_setting( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SourceShareSynchronizationSettingList" + """Get synchronization settings set on a share. + + Get source share synchronization settings for a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SourceShareSynchronizationSettingList or the result of cls(response) + :rtype: ~data_share_management_client.models.SourceShareSynchronizationSettingList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SourceShareSynchronizationSettingList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_source_share_synchronization_setting.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SourceShareSynchronizationSettingList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_source_share_synchronization_setting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSourceShareSynchronizationSettings'} + + def list_synchronization( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.ShareSubscriptionSynchronizationList" + """List synchronizations of a share subscription. + + List Synchronizations in a share subscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription. + :type share_subscription_name: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ShareSubscriptionSynchronizationList or the result of cls(response) + :rtype: ~data_share_management_client.models.ShareSubscriptionSynchronizationList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronizationList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronization.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ShareSubscriptionSynchronizationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizations'} + + def list_synchronization_detail( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + synchronization_id, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SynchronizationDetailsList" + """List synchronization details. + + List data set level details for a share subscription synchronization. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription. + :type share_subscription_name: str + :param synchronization_id: Synchronization id. + :type synchronization_id: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SynchronizationDetailsList or the result of cls(response) + :rtype: ~data_share_management_client.models.SynchronizationDetailsList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationDetailsList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + _share_subscription_synchronization = models.ShareSubscriptionSynchronization(synchronization_id=synchronization_id) + api_version = "2019-11-01" + content_type = "application/json" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_synchronization_detail.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_share_subscription_synchronization, 'ShareSubscriptionSynchronization') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SynchronizationDetailsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_synchronization_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizationDetails'} + + def _synchronize_initial( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + synchronization_mode=None, # type: Optional[Union[str, "models.SynchronizationMode"]] + **kwargs # type: Any + ): + # type: (...) -> "models.ShareSubscriptionSynchronization" + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _synchronize = models.Synchronize(synchronization_mode=synchronization_mode) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._synchronize_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_synchronize, 'Synchronize') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _synchronize_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/Synchronize'} + + def begin_synchronize( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + synchronization_mode=None, # type: Optional[Union[str, "models.SynchronizationMode"]] + **kwargs # type: Any + ): + # type: (...) -> "models.ShareSubscriptionSynchronization" + """Initiate a copy. + + Initiate an asynchronous data share job. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of share subscription. + :type share_subscription_name: str + :param synchronization_mode: Mode of synchronization used in triggers and snapshot sync. + Incremental by default. + :type synchronization_mode: str or ~data_share_management_client.models.SynchronizationMode + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns ShareSubscriptionSynchronization + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.ShareSubscriptionSynchronization] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + raw_result = self._synchronize_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + synchronization_mode=synchronization_mode, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_synchronize.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/Synchronize'} + + def _cancel_synchronization_initial( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + synchronization_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ShareSubscriptionSynchronization" + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _share_subscription_synchronization = models.ShareSubscriptionSynchronization(synchronization_id=synchronization_id) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._cancel_synchronization_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_share_subscription_synchronization, 'ShareSubscriptionSynchronization') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _cancel_synchronization_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization'} + + def begin_cancel_synchronization( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + synchronization_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ShareSubscriptionSynchronization" + """Request to cancel a synchronization. + + Request cancellation of a data share snapshot. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param synchronization_id: Synchronization id. + :type synchronization_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns ShareSubscriptionSynchronization + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.ShareSubscriptionSynchronization] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ShareSubscriptionSynchronization"] + raw_result = self._cancel_synchronization_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + synchronization_id=synchronization_id, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ShareSubscriptionSynchronization', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_cancel_synchronization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_synchronization_setting_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_synchronization_setting_operations.py new file mode 100644 index 00000000000..4b59370d082 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_synchronization_setting_operations.py @@ -0,0 +1,383 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SynchronizationSettingOperations(object): + """SynchronizationSettingOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + synchronization_setting_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.SynchronizationSetting" + """Get a synchronizationSetting in a share. + + Get synchronizationSetting in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param synchronization_setting_name: The name of the synchronizationSetting. + :type synchronization_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SynchronizationSetting or the result of cls(response) + :rtype: ~data_share_management_client.models.SynchronizationSetting + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationSetting"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'synchronizationSettingName': self._serialize.url("synchronization_setting_name", synchronization_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('SynchronizationSetting', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + + def create( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + synchronization_setting_name, # type: str + synchronization_setting, # type: "models.SynchronizationSetting" + **kwargs # type: Any + ): + # type: (...) -> "models.SynchronizationSetting" + """Create or update a synchronizationSetting. + + Adds a new synchronization setting to an existing share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share to add the synchronization setting to. + :type share_name: str + :param synchronization_setting_name: The name of the synchronizationSetting. + :type synchronization_setting_name: str + :param synchronization_setting: The new synchronization setting information. + :type synchronization_setting: ~data_share_management_client.models.SynchronizationSetting + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SynchronizationSetting or the result of cls(response) + :rtype: ~data_share_management_client.models.SynchronizationSetting or ~data_share_management_client.models.SynchronizationSetting + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationSetting"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.create.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'synchronizationSettingName': self._serialize.url("synchronization_setting_name", synchronization_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(synchronization_setting, 'SynchronizationSetting') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SynchronizationSetting', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SynchronizationSetting', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + + def _delete_initial( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + synchronization_setting_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OperationResponse" + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self._delete_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + 'synchronizationSettingName': self._serialize.url("synchronization_setting_name", synchronization_setting_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + + def begin_delete( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + synchronization_setting_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OperationResponse" + """Delete a synchronizationSetting in a share. + + Delete synchronizationSetting in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param synchronization_setting_name: The name of the synchronizationSetting . + :type synchronization_setting_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns OperationResponse + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_name=share_name, + synchronization_setting_name=synchronization_setting_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}'} + + def list_by_share( + self, + resource_group_name, # type: str + account_name, # type: str + share_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SynchronizationSettingList" + """List synchronizationSettings in a share. + + List synchronizationSettings in a share. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_name: The name of the share. + :type share_name: str + :param skip_token: continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SynchronizationSettingList or the result of cls(response) + :rtype: ~data_share_management_client.models.SynchronizationSettingList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SynchronizationSettingList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareName': self._serialize.url("share_name", share_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SynchronizationSettingList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_share.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings'} diff --git a/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_trigger_operations.py b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_trigger_operations.py new file mode 100644 index 00000000000..1bea3c38c31 --- /dev/null +++ b/src/datashare/azext_datashare/vendored_sdks/datashare/operations/_trigger_operations.py @@ -0,0 +1,427 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TriggerOperations(object): + """TriggerOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~data_share_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + trigger_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Trigger" + """Get a Trigger in a shareSubscription. + + Get Trigger in a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param trigger_name: The name of the trigger. + :type trigger_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Trigger or the result of cls(response) + :rtype: ~data_share_management_client.models.Trigger + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # 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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + + def _create_initial( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + trigger_name, # type: str + trigger, # type: "models.Trigger" + **kwargs # type: Any + ): + # type: (...) -> "models.Trigger" + cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(trigger, 'Trigger') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Trigger', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + + def begin_create( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + trigger_name, # type: str + trigger, # type: "models.Trigger" + **kwargs # type: Any + ): + # type: (...) -> "models.Trigger" + """Create a Trigger. + + This method creates a trigger for a share subscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription which will hold the data set + sink. + :type share_subscription_name: str + :param trigger_name: The name of the trigger. + :type trigger_name: str + :param trigger: Trigger details. + :type trigger: ~data_share_management_client.models.Trigger + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns Trigger + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.Trigger] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Trigger"] + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + trigger_name=trigger_name, + trigger=trigger, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Trigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + + def _delete_initial( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + trigger_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OperationResponse" + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + # Construct URL + url = self._delete_initial.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.DataShareError, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + + def begin_delete( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + trigger_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.OperationResponse" + """Delete a Trigger in a shareSubscription. + + Delete Trigger in a shareSubscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the shareSubscription. + :type share_subscription_name: str + :param trigger_name: The name of the trigger. + :type trigger_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns OperationResponse + :rtype: ~azure.core.polling.LROPoller[~data_share_management_client.models.OperationResponse] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationResponse"] + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + account_name=account_name, + share_subscription_name=share_subscription_name, + trigger_name=trigger_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OperationResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}'} + + def list_by_share_subscription( + self, + resource_group_name, # type: str + account_name, # type: str + share_subscription_name, # type: str + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.TriggerList" + """List Triggers in a share subscription. + + List Triggers in a share subscription. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param account_name: The name of the share account. + :type account_name: str + :param share_subscription_name: The name of the share subscription. + :type share_subscription_name: str + :param skip_token: Continuation token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TriggerList or the result of cls(response) + :rtype: ~data_share_management_client.models.TriggerList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.TriggerList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_share_subscription.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'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TriggerList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.DataShareError, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_share_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers'} diff --git a/src/datashare/report.md b/src/datashare/report.md new file mode 100644 index 00000000000..652f8051a95 --- /dev/null +++ b/src/datashare/report.md @@ -0,0 +1,483 @@ +# Azure CLI Module Creation Report + +### datashare account create + +create a datashare account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--identity**|object|Identity of resource|identity|identity| +|**--location**|string|Location of the azure resource.|location|location| +|**--tags**|dictionary|Tags on the azure resource.|tags|tags| +### datashare account delete + +delete a datashare account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +### datashare account list + +list a datashare account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +### datashare account show + +show a datashare account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +### datashare account update + +update a datashare account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--tags**|dictionary|Tags on the azure resource.|tags|tags| +### datashare consumer-invitation list + +list a datashare consumer-invitation. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +### datashare consumer-invitation reject-invitation + +reject-invitation a datashare consumer-invitation. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--location**|string|Location of the invitation|location|location| +|**--invitation_id**|string|Unique id of the invitation.|invitation_id|properties_invitation_id| +### datashare consumer-invitation show + +show a datashare consumer-invitation. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--location**|string|Location of the invitation|location|location| +|**--invitation_id**|string|An invitation id|invitation_id|invitation_id| +### datashare consumer-source-data-set list + +list a datashare consumer-source-data-set. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +### datashare data-set create + +create a datashare data-set. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--data_set_name**|string|The name of the dataSet.|data_set_name|data_set_name| +|**--kind**|choice|Kind of data set.|kind|kind| +### datashare data-set delete + +delete a datashare data-set. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--data_set_name**|string|The name of the dataSet.|data_set_name|data_set_name| +### datashare data-set list + +list a datashare data-set. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +### datashare data-set show + +show a datashare data-set. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--data_set_name**|string|The name of the dataSet.|data_set_name|data_set_name| +### datashare data-set-mapping create + +create a datashare data-set-mapping. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--data_set_mapping_name**|string|The name of the dataSetMapping.|data_set_mapping_name|data_set_mapping_name| +|**--kind**|choice|Kind of data set.|kind|kind| +### datashare data-set-mapping delete + +delete a datashare data-set-mapping. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--data_set_mapping_name**|string|The name of the dataSetMapping.|data_set_mapping_name|data_set_mapping_name| +### datashare data-set-mapping list + +list a datashare data-set-mapping. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +### datashare data-set-mapping show + +show a datashare data-set-mapping. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--data_set_mapping_name**|string|The name of the dataSetMapping.|data_set_mapping_name|data_set_mapping_name| +### datashare invitation create + +create a datashare invitation. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--invitation_name**|string|The name of the invitation.|invitation_name|invitation_name| +|**--target_active_directory_id**|string|The target Azure AD Id. Can't be combined with email.|target_active_directory_id|properties_target_active_directory_id| +|**--target_email**|string|The email the invitation is directed to.|target_email|properties_target_email| +|**--target_object_id**|string|The target user or application Id that invitation is being sent to. Must be specified along TargetActiveDirectoryId. This enables sending invitations to specific users or applications in an AD tenant.|target_object_id|properties_target_object_id| +### datashare invitation delete + +delete a datashare invitation. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--invitation_name**|string|The name of the invitation.|invitation_name|invitation_name| +### datashare invitation list + +list a datashare invitation. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +### datashare invitation show + +show a datashare invitation. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--invitation_name**|string|The name of the invitation.|invitation_name|invitation_name| +### datashare provider-share-subscription list + +list a datashare provider-share-subscription. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +### datashare provider-share-subscription reinstate + +reinstate a datashare provider-share-subscription. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--provider_share_subscription_id**|string|To locate shareSubscription|provider_share_subscription_id|provider_share_subscription_id| +### datashare provider-share-subscription revoke + +revoke a datashare provider-share-subscription. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--provider_share_subscription_id**|string|To locate shareSubscription|provider_share_subscription_id|provider_share_subscription_id| +### datashare provider-share-subscription show + +show a datashare provider-share-subscription. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--provider_share_subscription_id**|string|To locate shareSubscription|provider_share_subscription_id|provider_share_subscription_id| +### datashare share create + +create a datashare share. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--description**|string|Share description.|description|properties_description| +|**--share_kind**|choice|Share kind.|share_kind|properties_share_kind| +|**--terms**|string|Share terms.|terms|properties_terms| +### datashare share delete + +delete a datashare share. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +### datashare share list + +list a datashare share. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +### datashare share list-synchronization + +list-synchronization a datashare share. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +### datashare share list-synchronization-detail + +list-synchronization-detail a datashare share. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +|**--consumer_email**|string|Email of the user who created the synchronization|consumer_email|consumer_email| +|**--consumer_name**|string|Name of the user who created the synchronization|consumer_name|consumer_name| +|**--consumer_tenant_name**|string|Tenant name of the consumer who created the synchronization|consumer_tenant_name|consumer_tenant_name| +|**--duration_ms**|integer|synchronization duration|duration_ms|duration_ms| +|**--end_time**|date-time|End time of synchronization|end_time|end_time| +|**--message**|string|message of synchronization|message|message| +|**--start_time**|date-time|start time of synchronization|start_time|start_time| +|**--status**|string|Raw Status|status|status| +|**--synchronization_id**|string|Synchronization id|synchronization_id|synchronization_id| +### datashare share show + +show a datashare share. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +### datashare share-subscription cancel-synchronization + +cancel-synchronization a datashare share-subscription. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--synchronization_id**|string|Synchronization id|synchronization_id|synchronization_id| +### datashare share-subscription create + +create a datashare share-subscription. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--invitation_id**|string|The invitation id.|invitation_id|properties_invitation_id| +|**--source_share_location**|string|Source share location.|source_share_location|properties_source_share_location| +### datashare share-subscription delete + +delete a datashare share-subscription. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +### datashare share-subscription list + +list a datashare share-subscription. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +### datashare share-subscription list-source-share-synchronization-setting + +list-source-share-synchronization-setting a datashare share-subscription. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +### datashare share-subscription list-synchronization + +list-synchronization a datashare share-subscription. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +### datashare share-subscription list-synchronization-detail + +list-synchronization-detail a datashare share-subscription. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--synchronization_id**|string|Synchronization id|synchronization_id|synchronization_id| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +### datashare share-subscription show + +show a datashare share-subscription. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +### datashare share-subscription synchronize + +synchronize a datashare share-subscription. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--synchronization_mode**|choice|Synchronization mode|synchronization_mode|synchronization_mode| +### datashare synchronization-setting create + +create a datashare synchronization-setting. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--synchronization_setting_name**|string|The name of the synchronizationSetting.|synchronization_setting_name|synchronization_setting_name| +|**--kind**|choice|Kind of data set.|kind|kind| +### datashare synchronization-setting delete + +delete a datashare synchronization-setting. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--synchronization_setting_name**|string|The name of the synchronizationSetting.|synchronization_setting_name|synchronization_setting_name| +### datashare synchronization-setting list + +list a datashare synchronization-setting. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +### datashare synchronization-setting show + +show a datashare synchronization-setting. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_name**|string|The name of the share.|share_name|share_name| +|**--synchronization_setting_name**|string|The name of the synchronizationSetting.|synchronization_setting_name|synchronization_setting_name| +### datashare trigger create + +create a datashare trigger. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--trigger_name**|string|The name of the trigger.|trigger_name|trigger_name| +|**--kind**|choice|Kind of data set.|kind|kind| +### datashare trigger delete + +delete a datashare trigger. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--trigger_name**|string|The name of the trigger.|trigger_name|trigger_name| +### datashare trigger list + +list a datashare trigger. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--skip_token**|string|Continuation token|skip_token|skip_token| +### datashare trigger show + +show a datashare trigger. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--account_name**|string|The name of the share account.|account_name|account_name| +|**--share_subscription_name**|string|The name of the shareSubscription.|share_subscription_name|share_subscription_name| +|**--trigger_name**|string|The name of the trigger.|trigger_name|trigger_name| \ No newline at end of file diff --git a/src/datashare/setup.cfg b/src/datashare/setup.cfg new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/datashare/setup.py b/src/datashare/setup.py new file mode 100644 index 00000000000..172005632aa --- /dev/null +++ b/src/datashare/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.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + '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='datashare', + version=VERSION, + description='Microsoft Azure Command-Line Tools DataShareManagementClient 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_datashare': ['azext_metadata.json']}, +) diff --git a/src/import-export/HISTORY.rst b/src/import-export/HISTORY.rst new file mode 100644 index 00000000000..03b096b7a70 --- /dev/null +++ b/src/import-export/HISTORY.rst @@ -0,0 +1,12 @@ +.. :changelog: + +Release History +=============== + +0.1.1 +++++++ +* Fix generated package not found issue. + +0.1.0 +++++++ +* Initial release. diff --git a/src/import-export/README.md b/src/import-export/README.md new file mode 100644 index 00000000000..cafd6fbaa8c --- /dev/null +++ b/src/import-export/README.md @@ -0,0 +1,91 @@ +# Azure CLI import-export Extension # +This package is for the 'import-export' extension, i.e. 'az import-export'. + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name import-export +``` + +### Included Features +#### Import Export Management: +Manage Import Export: [more info](https://docs.microsoft.com/en-us/azure/storage/common/storage-import-export-service)\ +*Examples:* + +##### List locations to which you can ship the disks + +``` +az import-export location list +``` + +##### Show locations to which you can ship the disks + +``` +az import-export location show --location "West US" +``` + +##### Create an Import Job + +``` +az import-export create \ + --resource-group groupName \ + --name jobName \ + --location localtionName \ + --type Import \ + --log-level Verbose \ + --storage-account storageAccountID \ + --backup-drive-manifest true \ + --diagnostics-path waimportexport \ + --drive-list \ + drive-id=00000001 \ + bit-locker-key=000000-000000-000000-000000-000000-000000-000000-000000 \ + drive-header-hash="" \ + manifest-file=\\DriveManifest.xml \ + manifest-hash=109B21108597EF36D5785F08303F3638 \ + --return-address \ + city=Redmond \ + country-or-region=USA \ + email=Test@contoso.com \ + phone=4250000000 \ + postal-code=98007 \ + recipient-name=Tests \ + state-or-province=wa \ + street-address1=Street1 \ + street-address2=street2 +``` + +##### Update an Import Job + +``` +az import-export update \ + --resource-group groupName \ + --name jobName \ + --cancel-requested true +``` + +##### List Import Export Jobs + +``` +az import-export list \ + --resource-group groupName +``` + +##### Delete a Job + +``` +az import-export delete \ + --resource-group groupName \ + --name jobName +``` + +##### List bit locker keys of a Job + +``` +az import-export bit-locker-key list \ + --resource-group groupName \ + --job-name jobName +``` + + +If you have issues, please give feedback by opening an issue at https://github.com/Azure/azure-cli-extensions/issues. + diff --git a/src/import-export/azext_import_export/__init__.py b/src/import-export/azext_import_export/__init__.py new file mode 100644 index 00000000000..3832f03c25c --- /dev/null +++ b/src/import-export/azext_import_export/__init__.py @@ -0,0 +1,30 @@ +# -------------------------------------------------------------------------------------------- +# 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 .generated._help import helps # pylint: disable=unused-import + + +class ImportExportCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from .generated._client_factory import cf_import_export + import_export_custom = CliCommandType( + operations_tmpl='azext_import_export.custom#{}', + client_factory=cf_import_export) + super(ImportExportCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=import_export_custom) + + def load_command_table(self, args): + from .generated.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from .generated._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = ImportExportCommandsLoader diff --git a/src/import-export/azext_import_export/action.py b/src/import-export/azext_import_export/action.py new file mode 100644 index 00000000000..d66d3c5d0d7 --- /dev/null +++ b/src/import-export/azext_import_export/action.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/import-export/azext_import_export/azext_metadata.json b/src/import-export/azext_import_export/azext_metadata.json new file mode 100644 index 00000000000..13025150393 --- /dev/null +++ b/src/import-export/azext_import_export/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1" +} \ No newline at end of file diff --git a/src/import-export/azext_import_export/commands.py b/src/import-export/azext_import_export/commands.py new file mode 100644 index 00000000000..42f0c1a991e --- /dev/null +++ b/src/import-export/azext_import_export/commands.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.commands import * # noqa: F403 +try: + from .manual.commands import * # noqa: F403 +except ImportError: + pass diff --git a/src/import-export/azext_import_export/custom.py b/src/import-export/azext_import_export/custom.py new file mode 100644 index 00000000000..d1fd3543ed0 --- /dev/null +++ b/src/import-export/azext_import_export/custom.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/import-export/azext_import_export/generated/__init__.py b/src/import-export/azext_import_export/generated/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/import-export/azext_import_export/generated/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/import-export/azext_import_export/generated/_client_factory.py b/src/import-export/azext_import_export/generated/_client_factory.py new file mode 100644 index 00000000000..18f0b6e946b --- /dev/null +++ b/src/import-export/azext_import_export/generated/_client_factory.py @@ -0,0 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def cf_import_export(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from ..vendored_sdks.storageimportexport import StorageImportExport + return get_mgmt_service_client(cli_ctx, StorageImportExport) + + +def cf_job(cli_ctx, *_): + return cf_import_export(cli_ctx).job + + +def cf_bit_locker_key(cli_ctx, *_): + return cf_import_export(cli_ctx).bit_locker_key + + +def cf_location(cli_ctx, *_): + return cf_import_export(cli_ctx).location diff --git a/src/import-export/azext_import_export/generated/_help.py b/src/import-export/azext_import_export/generated/_help.py new file mode 100644 index 00000000000..078bdb6eb31 --- /dev/null +++ b/src/import-export/azext_import_export/generated/_help.py @@ -0,0 +1,108 @@ +# -------------------------------------------------------------------------------------------- +# 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 + +from knack.help_files import helps + + +helps['import-export'] = """ + type: group + short-summary: Manage Import Export +""" + +helps['import-export list'] = """ + type: command + short-summary: Returns all active and completed jobs in a subscription. + examples: + - name: List jobs in a resource group + text: |- + az import-export list --resource-group "myResourceGroup" + - name: List jobs in current subscription + text: |- + az import-export list +""" + +helps['import-export show'] = """ + type: command + short-summary: Gets information about an existing job. + examples: + - name: Get job + text: |- + az import-export show --resource-group "myResourceGroup" --name "myJob" +""" + +helps['import-export create'] = """ + type: command + short-summary: Creates a new job or updates an existing job in the specified subscription. + examples: + - name: Create an import job + text: |- + az import-export create --resource-group "myResourceGroup" --name "myJob" + --location "West US" --backup-drive-manifest true --diagnostics-path "waimportexport" + --drive-list bit-locker-key=238810-662376-448998-450120-652806-203390-606320-483076 + drive-header-hash= drive-id=9CA995BB manifest-file=\\\\DriveManifest.xml + manifest-hash=109B21108597EF36D5785F08303F3638 --type "Import" --log-level "Verbose" + --return-address city=Redmond country-or-region=USA email=Test@contoso.com phone=4250000000 + postal-code=98007 recipient-name=Tests state-or-province=wa street-address1=Street1 + street-address2=street2 --storage-account "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-\\ + xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.ClassicStorage/storageAccounts/test" +""" + +helps['import-export update'] = """ + type: command + short-summary: Updates specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing job. + examples: + - name: Update job + text: |- + az import-export update --resource-group "myResourceGroup" --name "myJob" + --backup-drive-manifest true --log-level "Verbose" --state "" +""" + +helps['import-export delete'] = """ + type: command + short-summary: Deletes an existing job. Only jobs in the Creating or Completed states can be deleted. + examples: + - name: Delete job + text: |- + az import-export delete --resource-group "myResourceGroup" --name "myJob" +""" + +helps['import-export bit-locker-key'] = """ + type: group + short-summary: import-export bit-locker-key +""" + +helps['import-export bit-locker-key list'] = """ + type: command + short-summary: Returns the BitLocker Keys for all drives in the specified job. + examples: + - name: List BitLocker Keys for drives in a job + text: |- + az import-export bit-locker-key list --resource-group "myResourceGroup" --job-name "myJob" +""" + +helps['import-export location'] = """ + type: group + short-summary: import-export location +""" + +helps['import-export location list'] = """ + type: command + short-summary: Returns a list of locations to which you can ship the disks associated with an import or export job. A location is a Microsoft data center region. + examples: + - name: List locations to which you can ship the disks + text: |- + az import-export location list +""" + +helps['import-export location show'] = """ + type: command + short-summary: Returns the details about a location to which you can ship the disks associated with an import or export job. A location is an Azure region. + examples: + - name: Show details about a location + text: |- + az import-export location show --location "West US 2" +""" diff --git a/src/import-export/azext_import_export/generated/_params.py b/src/import-export/azext_import_export/generated/_params.py new file mode 100644 index 00000000000..42e8d0db3f1 --- /dev/null +++ b/src/import-export/azext_import_export/generated/_params.py @@ -0,0 +1,76 @@ +# -------------------------------------------------------------------------------------------- +# 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 knack.arguments import CLIArgumentType +from azure.cli.core.commands.parameters import ( + tags_type, + get_three_state_flag, + get_location_type +) +from azure.cli.core.commands.validators import get_default_location_from_resource_group +from azext_import_export.action import ( + AddReturnAddress, + AddReturnShipping, + AddShippingInformation, + AddDeliveryPackage, + AddReturnPackage, + AddDriveList, + AddExport +) + + +def load_arguments(self, _): + + with self.argument_context('import-export list') as c: + pass + + with self.argument_context('import-export show') as c: + c.argument('name', options_list=['--name', '-n'], help='The name of the import/export job.') + + with self.argument_context('import-export create') as c: + c.argument('name', options_list=['--name', '-n'], help='The name of the import/export job.') + c.argument('client_tenant_id', help='The tenant ID of the client making the request.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('storage_account', help='Name or ID of the storage account where data will be imported to or exported from.') + c.argument('type', help='The type of job') + c.argument('return_address', action=AddReturnAddress, nargs='+', help='Specifies the return address information for the job.') + c.argument('return_shipping', action=AddReturnShipping, nargs='+', help='Specifies the return carrier and customer\'s account with the carrier.') + c.argument('shipping_information', action=AddShippingInformation, nargs='+', help='Contains information about the Microsoft datacenter to which the drives should be shipped.') + c.argument('delivery_package', action=AddDeliveryPackage, nargs='+', help='Contains information about the package being shipped by the customer to the Microsoft data center.') + c.argument('return_package', action=AddReturnPackage, nargs='+', help='Contains information about the package being shipped by the customer to the Microsoft data center.') + c.argument('diagnostics_path', help='The virtual blob directory to which the copy logs and backups of drive manifest files (if enabled) will be stored.') + c.argument('log_level', help='Default value is Error. Indicates whether error logging or verbose logging will be enabled.') + c.argument('backup_drive_manifest', arg_type=get_three_state_flag(), help='Default value is false. Indicates whether the manifest files on the drives should be copied to block blobs.') + c.argument('state', help='Current state of the job.') + c.argument('cancel_requested', arg_type=get_three_state_flag(), help='Indicates whether a request has been submitted to cancel the job.') + c.argument('percent_complete', help='Overall percentage completed for the job.') + c.argument('incomplete_blob_list_uri', help='A blob path that points to a block blob containing a list of blob names that were not exported due to insufficient drive space. If all blobs were exported successfully, then this element is not included in the response.') + c.argument('drive_list', action=AddDriveList, nargs='+', help='List of up to ten drives that comprise the job. The drive list is a required element for an import job; it is not specified for export jobs.') + c.argument('export', action=AddExport, nargs='+', help='A property containing information about the blobs to be exported for an export job. This property is required for export jobs, but must not be specified for import jobs.') + + with self.argument_context('import-export update') as c: + c.argument('name', options_list=['--name', '-n'], help='The name of the import/export job.') + c.argument('tags', tags_type) + c.argument('cancel_requested', arg_type=get_three_state_flag(), help='If specified, the value must be true. The service will attempt to cancel the job.') + c.argument('state', help='If specified, the value must be Shipping, which tells the Import/Export service that the package for the job has been shipped. The ReturnAddress and DeliveryPackage properties must have been set either in this request or in a previous request, otherwise the request will fail.') + c.argument('return_address', action=AddReturnAddress, nargs='+', help='Specifies the return address information for the job.') + c.argument('return_shipping', action=AddReturnShipping, nargs='+', help='Specifies the return carrier and customer\'s account with the carrier.') + c.argument('delivery_package', action=AddDeliveryPackage, nargs='+', help='Contains information about the package being shipped by the customer to the Microsoft data center.') + c.argument('log_level', help='Indicates whether error logging or verbose logging is enabled.') + c.argument('backup_drive_manifest', arg_type=get_three_state_flag(), help='Indicates whether the manifest files on the drives should be copied to block blobs.') + c.argument('drive_list', action=AddDriveList, nargs='+', help='List of drives that comprise the job.') + + with self.argument_context('import-export delete') as c: + c.argument('name', options_list=['--name', '-n'], help='The name of the import/export job.') + + with self.argument_context('import-export bit-locker-key list') as c: + c.argument('job_name', help='The name of the import/export job.') + + with self.argument_context('import-export location show') as c: + c.argument('location', help='Location. Values from: `az import-export location list`.') diff --git a/src/import-export/azext_import_export/generated/_validators.py b/src/import-export/azext_import_export/generated/_validators.py new file mode 100644 index 00000000000..34913fb394d --- /dev/null +++ b/src/import-export/azext_import_export/generated/_validators.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/import-export/azext_import_export/generated/action.py b/src/import-export/azext_import_export/generated/action.py new file mode 100644 index 00000000000..7525687650f --- /dev/null +++ b/src/import-export/azext_import_export/generated/action.py @@ -0,0 +1,211 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=protected-access + +import argparse +from knack.util import CLIError + + +class AddReturnAddress(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.return_address = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = dict(x.split('=', 1) for x in values) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'recipient-name': + d['recipient_name'] = v + elif kl == 'street-address1': + d['street_address1'] = v + elif kl == 'street-address2': + d['street_address2'] = v + elif kl == 'city': + d['city'] = v + elif kl == 'state-or-province': + d['state_or_province'] = v + elif kl == 'postal-code': + d['postal_code'] = v + elif kl == 'country-or-region': + d['country_or_region'] = v + elif kl == 'phone': + d['phone'] = v + elif kl == 'email': + d['email'] = v + return d + + +class AddReturnShipping(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.return_shipping = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = dict(x.split('=', 1) for x in values) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'carrier-name': + d['carrier_name'] = v + elif kl == 'carrier-account-number': + d['carrier_account_number'] = v + return d + + +class AddShippingInformation(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.shipping_information = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = dict(x.split('=', 1) for x in values) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'recipient-name': + d['recipient_name'] = v + elif kl == 'street-address1': + d['street_address1'] = v + elif kl == 'street-address2': + d['street_address2'] = v + elif kl == 'city': + d['city'] = v + elif kl == 'state-or-province': + d['state_or_province'] = v + elif kl == 'postal-code': + d['postal_code'] = v + elif kl == 'country-or-region': + d['country_or_region'] = v + elif kl == 'phone': + d['phone'] = v + return d + + +class AddDeliveryPackage(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.delivery_package = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = dict(x.split('=', 1) for x in values) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'carrier-name': + d['carrier_name'] = v + elif kl == 'tracking-number': + d['tracking_number'] = v + elif kl == 'drive-count': + d['drive_count'] = v + elif kl == 'ship-date': + d['ship_date'] = v + return d + + +class AddReturnPackage(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.return_package = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = dict(x.split('=', 1) for x in values) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'carrier-name': + d['carrier_name'] = v + elif kl == 'tracking-number': + d['tracking_number'] = v + elif kl == 'drive-count': + d['drive_count'] = v + elif kl == 'ship-date': + d['ship_date'] = v + return d + + +class AddDriveList(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddDriveList, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = dict(x.split('=', 1) for x in values) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'drive-id': + d['drive_id'] = v + elif kl == 'bit-locker-key': + d['bit_locker_key'] = v + elif kl == 'manifest-file': + d['manifest_file'] = v + elif kl == 'manifest-hash': + d['manifest_hash'] = v + elif kl == 'drive-header-hash': + d['drive_header_hash'] = v + elif kl == 'state': + d['state'] = v + elif kl == 'copy-status': + d['copy_status'] = v + elif kl == 'percent-complete': + d['percent_complete'] = v + elif kl == 'verbose-log-uri': + d['verbose_log_uri'] = v + elif kl == 'error-log-uri': + d['error_log_uri'] = v + elif kl == 'manifest-uri': + d['manifest_uri'] = v + elif kl == 'bytes-succeeded': + d['bytes_succeeded'] = v + return d + + +class AddExport(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.export = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = dict(x.split('=', 1) for x in values) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'blob-listblob-path': + d['blob_listblob_path'] = v + elif kl == 'blob-path': + d['blob_path'] = v + elif kl == 'blob-path-prefix': + d['blob_path_prefix'] = v + return d diff --git a/src/import-export/azext_import_export/generated/commands.py b/src/import-export/azext_import_export/generated/commands.py new file mode 100644 index 00000000000..69285b20201 --- /dev/null +++ b/src/import-export/azext_import_export/generated/commands.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# 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 + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_import_export.generated._client_factory import cf_job + import_export_job = CliCommandType( + operations_tmpl='azext_import_export.vendored_sdks.storageimportexport.operations._job_operations#JobOperations.{}', + client_factory=cf_job) + with self.command_group('import-export', import_export_job, client_factory=cf_job, is_experimental=True) as g: + g.custom_command('list', 'import_export_job_list') + g.custom_show_command('show', 'import_export_job_show') + g.custom_command('create', 'import_export_job_create') + g.custom_command('update', 'import_export_job_update') + g.custom_command('delete', 'import_export_job_delete') + + from azext_import_export.generated._client_factory import cf_bit_locker_key + import_export_bit_locker_key = CliCommandType( + operations_tmpl='azext_import_export.vendored_sdks.storageimportexport.operations._bit_locker_key_operations#BitLockerKeyOperations.{}', + client_factory=cf_bit_locker_key) + with self.command_group('import-export bit-locker-key', import_export_bit_locker_key, client_factory=cf_bit_locker_key) as g: + g.custom_command('list', 'import_export_bit_locker_key_list') + + from azext_import_export.generated._client_factory import cf_location + import_export_location = CliCommandType( + operations_tmpl='azext_import_export.vendored_sdks.storageimportexport.operations._location_operations#LocationOperations.{}', + client_factory=cf_location) + with self.command_group('import-export location', import_export_location, + client_factory=cf_location) as g: + g.custom_command('list', 'import_export_location_list') + g.custom_show_command('show', 'import_export_location_show') diff --git a/src/import-export/azext_import_export/generated/custom.py b/src/import-export/azext_import_export/generated/custom.py new file mode 100644 index 00000000000..4d9d1f23fe0 --- /dev/null +++ b/src/import-export/azext_import_export/generated/custom.py @@ -0,0 +1,66 @@ +# -------------------------------------------------------------------------------------------- +# 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 + + +def import_export_job_list(cmd, client, resource_group_name=None): + if resource_group_name is not None: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def import_export_job_show(cmd, client, name, resource_group_name): + return client.get(job_name=name, resource_group_name=resource_group_name) + + +def import_export_job_create(cmd, client, name, resource_group_name, client_tenant_id=None, location=None, tags=None, + storage_account=None, type=None, return_address=None, return_shipping=None, + shipping_information=None, delivery_package=None, + return_package=None, diagnostics_path=None, log_level=None, backup_drive_manifest=None, + state=None, cancel_requested=None, percent_complete=None, incomplete_blob_list_uri=None, + drive_list=None, export=None): + # pylint: disable=redefined-builtin + from msrestazure.tools import resource_id, is_valid_resource_id + from azure.cli.core.commands.client_factory import get_subscription_id + storage_account_id = storage_account + if not is_valid_resource_id(storage_account_id): + storage_account_id = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), resource_group=resource_group_name, + namespace='Microsoft.Storage', type='storageAccounts', name=storage_account) + + return client.create(job_name=name, resource_group_name=resource_group_name, client_tenant_id=client_tenant_id, + location=location, tags=tags, storage_account_id=storage_account_id, job_type=type, + return_address=return_address, return_shipping=return_shipping, + shipping_information=shipping_information, delivery_package=delivery_package, + return_package=return_package, diagnostics_path=diagnostics_path, log_level=log_level, + backup_drive_manifest=backup_drive_manifest, state=state, cancel_requested=cancel_requested, + percent_complete=percent_complete, incomplete_blob_list_uri=incomplete_blob_list_uri, + drive_list=drive_list, export=export) + + +def import_export_job_update(cmd, client, name, resource_group_name, tags=None, cancel_requested=None, state=None, + return_address=None, return_shipping=None, delivery_package=None, log_level=None, + backup_drive_manifest=None, drive_list=None): + return client.update(job_name=name, resource_group_name=resource_group_name, tags=tags, + cancel_requested=cancel_requested, state=state, return_address=return_address, + return_shipping=return_shipping, delivery_package=delivery_package, log_level=log_level, + backup_drive_manifest=backup_drive_manifest, drive_list=drive_list) + + +def import_export_job_delete(cmd, client, name, resource_group_name): + return client.delete(job_name=name, resource_group_name=resource_group_name) + + +def import_export_bit_locker_key_list(cmd, client, job_name, resource_group_name): + return client.list(job_name=job_name, resource_group_name=resource_group_name) + + +def import_export_location_list(cmd, client): + return client.list() + + +def import_export_location_show(cmd, client, location): + return client.get(location_name=location) diff --git a/src/import-export/azext_import_export/tests/latest/__init__.py b/src/import-export/azext_import_export/tests/latest/__init__.py new file mode 100644 index 00000000000..34913fb394d --- /dev/null +++ b/src/import-export/azext_import_export/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/import-export/azext_import_export/tests/latest/recordings/test_import_export.yaml b/src/import-export/azext_import_export/tests/latest/recordings/test_import_export.yaml new file mode 100644 index 00000000000..e0566cda5ee --- /dev/null +++ b/src/import-export/azext_import_export/tests/latest/recordings/test_import_export.yaml @@ -0,0 +1,749 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/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/resourceGroups/cli_test_import_export_000001/providers/Microsoft.Storage/storageAccounts/clitest000002?api-version=2019-06-01 + response: + body: + string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.Storage/storageAccounts/clitest000002","name":"clitest000002","type":"Microsoft.Storage/storageAccounts","location":"westus","tags":{},"properties":{"privateEndpointConnections":[],"isHnsEnabled":false,"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-21T09:42:32.0887711Z"},"blob":{"keyType":"Account","enabled":true,"lastEnabledTime":"2020-04-21T09:42:32.0887711Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-04-21T09:42:31.9950564Z","primaryEndpoints":{"blob":"https://clitest000002.blob.core.windows.net/","queue":"https://clitest000002.queue.core.windows.net/","table":"https://clitest000002.table.core.windows.net/","file":"https://clitest000002.file.core.windows.net/"},"primaryLocation":"westus","statusOfPrimary":"available"}}' + headers: + cache-control: + - no-cache + content-length: + - '1261' + content-type: + - application/json + date: + - Tue, 21 Apr 2020 09:42:53 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - import-export location list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.4.0 azsdk-python-core/1.4.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + azsdk-python-storageimportexport/unknown + method: GET + uri: https://management.azure.com/providers/Microsoft.ImportExport/locations?api-version=2016-11-01 + response: + body: + string: "{\"value\":[{\"properties\":{\"recipientName\":\"This DC has security + requirements requiring advance notification for all inbound shipments. Contact + adbops@microsoft.com specifying your order name to receive the unique inbound + ID and shipping address\",\"streetAddress1\":\" \",\"streetAddress2\":\" \",\"city\":\" + \",\"stateOrProvince\":\" \",\"postalCode\":\" \",\"countryOrRegion\":\" \",\"phone\":\" + \",\"supportedCarriers\":[\"Blue Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/australiaeast\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/australiaeast\",\"name\":\"Australia + East\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"This + DC has security requirements requiring advance notification for all inbound + shipments. Contact adbops@microsoft.com specifying your order name to receive + the unique inbound ID and shipping address\",\"streetAddress1\":\" \",\"streetAddress2\":\" + \",\"city\":\" \",\"stateOrProvince\":\" \",\"postalCode\":\" \",\"countryOrRegion\":\" + \",\"phone\":\" \",\"supportedCarriers\":[\"Blue Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/australiasoutheast\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/australiasoutheast\",\"name\":\"Australia + Southeast\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"Microsoft c/o AscentyRua + Papa Joao Paulo II 4 - Jardim Santa Izabel\",\"streetAddress2\":\"Hortol\xE2ndia\",\"city\":\"S\xE3o + Paulo\",\"stateOrProvince\":\"\",\"postalCode\":\"CEP: 13.185-252\",\"countryOrRegion\":\"Brazil\",\"supportedCarriers\":[\"Blue + Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/brazilsouth\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/brazilsouth\",\"name\":\"Brazil + South\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"Microsoft c/o Allied Properties + REIT 35 John St\",\"streetAddress2\":\"\",\"city\":\"West Toronto\",\"stateOrProvince\":\"ON\",\"postalCode\":\"M5V + 3G6\",\"countryOrRegion\":\"Canada\",\"supportedCarriers\":[\"Blue Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/canadacentral\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/canadacentral\",\"name\":\"Canada + Central\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"Microsoft c/o 4 Degrees + 2675 Boulevard du Parc-Technologique\",\"streetAddress2\":\"\",\"city\":\"Quebec + City\",\"stateOrProvince\":\"QC\",\"postalCode\":\"G1P 4S5\",\"countryOrRegion\":\"Canada\",\"supportedCarriers\":[\"Blue + Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/canadacentral\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/canadaeast\",\"name\":\"Canada + East\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"Microsoft Corp. (India) + Pvt. Ltd. c/o Tata Communications Ltd., IDC Building, 2nd floor, Alandi Road\",\"streetAddress2\":\"\",\"city\":\"Dighi, + Pune\",\"stateOrProvince\":\"Mahar\",\"postalCode\":\"411015\",\"countryOrRegion\":\"India\",\"phone\":\"+91-8956884068\",\"supportedCarriers\":[\"Blue + Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/centralindia\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/centralindia\",\"name\":\"Central + India\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"550 SE White Crane Rd\",\"streetAddress2\":\"\",\"city\":\"West + Des Moines\",\"stateOrProvince\":\"IA\",\"postalCode\":\"50265\",\"countryOrRegion\":\"USA\",\"phone\":\"5156975500\",\"supportedCarriers\":[\"Blue + Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/centralus\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/centralus\",\"name\":\"Central + US\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"\\n Microsoft c/o + NTT Comm 6 Chun Kwong Street, Tseung Kwan O Industrial Estate \",\"streetAddress2\":\"\",\"city\":\"Tseung + Kwan O\",\"stateOrProvince\":\"\",\"postalCode\":\"\",\"countryOrRegion\":\"\",\"phone\":\"+852 + 3793 0508\\n \",\"supportedCarriers\":[\"Blue Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/eastasia\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/eastasia\",\"name\":\"East + Asia\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"21625 Gresham Drive\",\"streetAddress2\":\"\",\"city\":\"Ashburn\",\"stateOrProvince\":\"VA\",\"postalCode\":\"20147\",\"countryOrRegion\":\"USA\",\"phone\":\"\",\"supportedCarriers\":[\"Blue + Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/eastus\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/eastus\",\"name\":\"East + US\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"101 Herbert Drive, BLDG + 7\",\"streetAddress2\":\"\",\"city\":\"Boydton\",\"stateOrProvince\":\"VA\",\"postalCode\":\"23917\",\"countryOrRegion\":\"USA\",\"phone\":\"\",\"supportedCarriers\":[\"Blue + Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/eastus\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/eastus2\",\"name\":\"East + US 2\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"Microsoft Agriport 570\",\"streetAddress2\":\"\",\"city\":\"Middenmeer\",\"stateOrProvince\":\"NL-NH\",\"postalCode\":\"1775TB\",\"countryOrRegion\":\"Netherlands + (NL)\",\"supportedCarriers\":[\"FedEx\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/westeurope\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/germanynorth\",\"name\":\"Germany + North\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"Microsoft Agriport 570\",\"streetAddress2\":\"\",\"city\":\"Middenmeer\",\"stateOrProvince\":\"NL-NH\",\"postalCode\":\"1775TB\",\"countryOrRegion\":\"Netherlands + (NL)\",\"supportedCarriers\":[\"FedEx\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/westeurope\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/germanywestcentral\",\"name\":\"Germany + West Central\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"Microsoft C/O NTT Communications + 2-7-5, Tabatashinmachi, Kita-ku\",\"streetAddress2\":\"\",\"city\":\"Tokyo\",\"stateOrProvince\":\"\",\"postalCode\":\"114-0012\",\"countryOrRegion\":\"Japan\",\"supportedCarriers\":[\"Blue + Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/japaneast\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/japaneast\",\"name\":\"Japan + East\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"Microsoft C/O NTT Communications3-1-21, + Dojima Kita-ku\",\"streetAddress2\":\"\",\"city\":\"Osaka City\",\"stateOrProvince\":\"Osaka\",\"postalCode\":\"553-0003\",\"countryOrRegion\":\"Japan\",\"phone\":\"+81 + (6) 7670-6655\",\"supportedCarriers\":[\"Blue Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/japanwest\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/japanwest\",\"name\":\"Japan + West\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"Microsoft c/o 29, Simindaero-327gil, + Dong An-gu\",\"streetAddress2\":\"Anyang-si\",\"city\":\"Kyeonggido\",\"stateOrProvince\":\"\",\"postalCode\":\"14055\",\"countryOrRegion\":\"Republic + of Korea\",\"supportedCarriers\":[\"Blue Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/koreacentral\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/koreacentral\",\"name\":\"Korea + Central\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"Microsoft c/o 29, Simindaero-327gil, + Dong An-gu\",\"streetAddress2\":\"Anyang-si\",\"city\":\"Kyeonggido\",\"stateOrProvince\":\"\",\"postalCode\":\"14055\",\"countryOrRegion\":\"Republic + of Korea\",\"supportedCarriers\":[\"FedEx\",\"DHL\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/australiasoutheast\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/koreasouth\",\"name\":\"Korea + South\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"601 Northwest Ave.\",\"streetAddress2\":\"\",\"city\":\"Northlake\",\"stateOrProvince\":\"IL\",\"postalCode\":\"60164\",\"countryOrRegion\":\"USA\",\"phone\":\"(708) + 836-5143\",\"supportedCarriers\":[\"Blue Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/northcentralus\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/northcentralus\",\"name\":\"North + Central US\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"Unit 74 Grange Castle Business + Park, Clondalkin\",\"streetAddress2\":\"\",\"city\":\"Dublin\",\"stateOrProvince\":\"\",\"postalCode\":\"22\",\"countryOrRegion\":\"Ireland + (IE)\",\"phone\":\"8886052200\",\"supportedCarriers\":[\"Blue Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/westeurope\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/northeurope\",\"name\":\"North + Europe\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"5150 Rogers Road\",\"streetAddress2\":\"\",\"city\":\"San + Antonio\",\"stateOrProvince\":\"TX\",\"postalCode\":\"78251\",\"countryOrRegion\":\"USA\",\"phone\":\"+1 + 210 3462528\",\"supportedCarriers\":[\"Blue Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/westus\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/southcentralus\",\"name\":\"South + Central US\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"Microsoft Corp. (India) + Pvt. Ltd. C/o Tata Communications Ltd, 226 Red Hills Road, Kallikuppam\",\"streetAddress2\":\"\",\"city\":\"Ambattur\",\"stateOrProvince\":\"Tamil + Nadu\",\"postalCode\":\"600053\",\"countryOrRegion\":\"India\",\"phone\":\"+91 + 7200090173\",\"supportedCarriers\":[\"Blue Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/southindia\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/southindia\",\"name\":\"South + India\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"21 Defu Ave 1\",\"streetAddress2\":\"\",\"city\":\"Singapore\",\"stateOrProvince\":\"539539\",\"postalCode\":\"Singapore + (SG)\",\"countryOrRegion\":\"+659017 9066\",\"supportedCarriers\":[\"Blue + Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/southeastasia\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/southeastasia\",\"name\":\"Southeast + Asia\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"This + DC has security requirements requiring advance notification for all inbound + shipments. Contact adbops@microsoft.com specifying your order name to receive + the unique inbound ID and shipping address\",\"streetAddress1\":\" \",\"streetAddress2\":\" + \",\"city\":\" \",\"stateOrProvince\":\" \",\"postalCode\":\" \",\"countryOrRegion\":\" + \",\"phone\":\" \",\"supportedCarriers\":[\"Blue Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/uksouth\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/uksouth\",\"name\":\"UK + South\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"This + DC has security requirements requiring advance notification for all inbound + shipments. Contact adbops@microsoft.com specifying your order name to receive + the unique inbound ID and shipping address\",\"streetAddress1\":\" \",\"streetAddress2\":\" + \",\"city\":\" \",\"stateOrProvince\":\" \",\"postalCode\":\" \",\"countryOrRegion\":\" + \",\"phone\":\" \",\"supportedCarriers\":[\"FedEx\",\"DHL\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/uksouth\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/ukwest\",\"name\":\"UK + West\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"Microsoft 638 Logistics + Drive\",\"streetAddress2\":\"\",\"city\":\"Cheyenne\",\"stateOrProvince\":\"WY\",\"postalCode\":\"82007\",\"countryOrRegion\":\"USA\",\"supportedCarriers\":[\"Blue + Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/centralus\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/westcentralus\",\"name\":\"West + Central US\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"Microsoft Agriport 570\",\"streetAddress2\":\"\",\"city\":\"Middenmeer\",\"stateOrProvince\":\"NL-NH\",\"postalCode\":\"1775TB\",\"countryOrRegion\":\"Netherlands + (NL)\",\"supportedCarriers\":[\"Blue Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/westeurope\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/westeurope\",\"name\":\"West + Europe\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"Microsoft c/o Tata Communications,Tower + A , 6th Floor,Plot # C21 C36, Bandra Kurla Complex, Near MTNL\",\"streetAddress2\":\"\",\"city\":\"Mumbai\",\"stateOrProvince\":\"Maharashtra\",\"postalCode\":\"400098\",\"countryOrRegion\":\"India\",\"supportedCarriers\":[\"Blue + Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/centralindia\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/westindia\",\"name\":\"West + India\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"3020 Coronado\",\"streetAddress2\":\"\",\"city\":\"Santa + Clara\",\"stateOrProvince\":\"CA\",\"postalCode\":\"95054\",\"countryOrRegion\":\"USA\",\"phone\":\"408 + 352 7600\",\"supportedCarriers\":[\"Blue Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/westus\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/westus\",\"name\":\"West + US\",\"type\":\"Microsoft.ImportExport/locations\"},{\"properties\":{\"recipientName\":\"Microsoft + Azure Import/Export Service\",\"streetAddress1\":\"1515 Port Industrial Parkway\",\"streetAddress2\":\"\",\"city\":\"Quincy\",\"stateOrProvince\":\"WA\",\"postalCode\":\"98848\",\"countryOrRegion\":\"USA\",\"supportedCarriers\":[\"Blue + Dart\",\"DHL\",\"FedEx\",\"TNT\",\"UPS\"],\"alternateLocations\":[\"/providers/Microsoft.ImportExport/locations/westus2\"]},\"id\":\"/providers/Microsoft.ImportExport/locations/westus2\",\"name\":\"West + US 2\",\"type\":\"Microsoft.ImportExport/locations\"}]}" + headers: + cache-control: + - no-cache + content-length: + - '15120' + content-type: + - application/json + date: + - Tue, 21 Apr 2020 09:42:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - import-export location list + Connection: + - keep-alive + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 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/locations?api-version=2019-06-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia","name":"eastasia","displayName":"East + Asia","longitude":"114.188","latitude":"22.267"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia","name":"southeastasia","displayName":"Southeast + Asia","longitude":"103.833","latitude":"1.283"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus","name":"centralus","displayName":"Central + US","longitude":"-93.6208","latitude":"41.5908"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus","name":"eastus","displayName":"East + US","longitude":"-79.8164","latitude":"37.3719"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2","name":"eastus2","displayName":"East + US 2","longitude":"-78.3889","latitude":"36.6681"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus","name":"westus","displayName":"West + US","longitude":"-122.417","latitude":"37.783"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus","name":"northcentralus","displayName":"North + Central US","longitude":"-87.6278","latitude":"41.8819"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus","name":"southcentralus","displayName":"South + Central US","longitude":"-98.5","latitude":"29.4167"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope","name":"northeurope","displayName":"North + Europe","longitude":"-6.2597","latitude":"53.3478"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope","name":"westeurope","displayName":"West + Europe","longitude":"4.9","latitude":"52.3667"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest","name":"japanwest","displayName":"Japan + West","longitude":"135.5022","latitude":"34.6939"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast","name":"japaneast","displayName":"Japan + East","longitude":"139.77","latitude":"35.68"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth","name":"brazilsouth","displayName":"Brazil + South","longitude":"-46.633","latitude":"-23.55"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast","name":"australiaeast","displayName":"Australia + East","longitude":"151.2094","latitude":"-33.86"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast","name":"australiasoutheast","displayName":"Australia + Southeast","longitude":"144.9631","latitude":"-37.8136"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia","name":"southindia","displayName":"South + India","longitude":"80.1636","latitude":"12.9822"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia","name":"centralindia","displayName":"Central + India","longitude":"73.9197","latitude":"18.5822"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westindia","name":"westindia","displayName":"West + India","longitude":"72.868","latitude":"19.088"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral","name":"canadacentral","displayName":"Canada + Central","longitude":"-79.383","latitude":"43.653"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast","name":"canadaeast","displayName":"Canada + East","longitude":"-71.217","latitude":"46.817"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth","name":"uksouth","displayName":"UK + South","longitude":"-0.799","latitude":"50.941"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest","name":"ukwest","displayName":"UK + West","longitude":"-3.084","latitude":"53.427"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus","name":"westcentralus","displayName":"West + Central US","longitude":"-110.234","latitude":"40.890"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2","name":"westus2","displayName":"West + US 2","longitude":"-119.852","latitude":"47.233"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral","name":"koreacentral","displayName":"Korea + Central","longitude":"126.9780","latitude":"37.5665"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth","name":"koreasouth","displayName":"Korea + South","longitude":"129.0756","latitude":"35.1796"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral","name":"francecentral","displayName":"France + Central","longitude":"2.3730","latitude":"46.3772"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth","name":"francesouth","displayName":"France + South","longitude":"2.1972","latitude":"43.8345"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral","name":"australiacentral","displayName":"Australia + Central","longitude":"149.1244","latitude":"-35.3075"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2","name":"australiacentral2","displayName":"Australia + Central 2","longitude":"149.1244","latitude":"-35.3075"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral","name":"uaecentral","displayName":"UAE + Central","longitude":"54.366669","latitude":"24.466667"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth","name":"uaenorth","displayName":"UAE + North","longitude":"55.316666","latitude":"25.266666"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth","name":"southafricanorth","displayName":"South + Africa North","longitude":"28.218370","latitude":"-25.731340"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest","name":"southafricawest","displayName":"South + Africa West","longitude":"18.843266","latitude":"-34.075691"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth","name":"switzerlandnorth","displayName":"Switzerland + North","longitude":"8.564572","latitude":"47.451542"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest","name":"switzerlandwest","displayName":"Switzerland + West","longitude":"6.143158","latitude":"46.204391"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth","name":"germanynorth","displayName":"Germany + North","longitude":"8.806422","latitude":"53.073635"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral","name":"germanywestcentral","displayName":"Germany + West Central","longitude":"8.682127","latitude":"50.110924"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest","name":"norwaywest","displayName":"Norway + West","longitude":"5.733107","latitude":"58.969975"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast","name":"norwayeast","displayName":"Norway + East","longitude":"10.752245","latitude":"59.913868"}]}' + headers: + cache-control: + - no-cache + content-length: + - '7129' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 21 Apr 2020 09:42:55 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: + - import-export location show + Connection: + - keep-alive + ParameterSetName: + - --location + User-Agent: + - AZURECLI/2.4.0 azsdk-python-core/1.4.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + azsdk-python-storageimportexport/unknown + method: GET + uri: https://management.azure.com/providers/Microsoft.ImportExport/locations/westus2?api-version=2016-11-01 + response: + body: + string: '{"properties":{"recipientName":"Microsoft Azure Import/Export Service","streetAddress1":"1515 + Port Industrial Parkway","streetAddress2":"","city":"Quincy","stateOrProvince":"WA","postalCode":"98848","countryOrRegion":"USA","supportedCarriers":["Blue + Dart","DHL","FedEx","TNT","UPS"],"alternateLocations":["/providers/Microsoft.ImportExport/locations/westus2"]},"id":"/providers/Microsoft.ImportExport/locations/westus2","name":"West + US 2","type":"Microsoft.ImportExport/locations"}' + headers: + cache-control: + - no-cache + content-length: + - '481' + content-type: + - application/json + date: + - Tue, 21 Apr 2020 09:42:56 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - import-export location show + Connection: + - keep-alive + ParameterSetName: + - --location + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 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/locations?api-version=2019-06-01 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastasia","name":"eastasia","displayName":"East + Asia","longitude":"114.188","latitude":"22.267"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southeastasia","name":"southeastasia","displayName":"Southeast + Asia","longitude":"103.833","latitude":"1.283"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralus","name":"centralus","displayName":"Central + US","longitude":"-93.6208","latitude":"41.5908"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus","name":"eastus","displayName":"East + US","longitude":"-79.8164","latitude":"37.3719"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/eastus2","name":"eastus2","displayName":"East + US 2","longitude":"-78.3889","latitude":"36.6681"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus","name":"westus","displayName":"West + US","longitude":"-122.417","latitude":"37.783"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northcentralus","name":"northcentralus","displayName":"North + Central US","longitude":"-87.6278","latitude":"41.8819"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southcentralus","name":"southcentralus","displayName":"South + Central US","longitude":"-98.5","latitude":"29.4167"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/northeurope","name":"northeurope","displayName":"North + Europe","longitude":"-6.2597","latitude":"53.3478"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westeurope","name":"westeurope","displayName":"West + Europe","longitude":"4.9","latitude":"52.3667"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japanwest","name":"japanwest","displayName":"Japan + West","longitude":"135.5022","latitude":"34.6939"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/japaneast","name":"japaneast","displayName":"Japan + East","longitude":"139.77","latitude":"35.68"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/brazilsouth","name":"brazilsouth","displayName":"Brazil + South","longitude":"-46.633","latitude":"-23.55"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiaeast","name":"australiaeast","displayName":"Australia + East","longitude":"151.2094","latitude":"-33.86"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiasoutheast","name":"australiasoutheast","displayName":"Australia + Southeast","longitude":"144.9631","latitude":"-37.8136"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southindia","name":"southindia","displayName":"South + India","longitude":"80.1636","latitude":"12.9822"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/centralindia","name":"centralindia","displayName":"Central + India","longitude":"73.9197","latitude":"18.5822"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westindia","name":"westindia","displayName":"West + India","longitude":"72.868","latitude":"19.088"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadacentral","name":"canadacentral","displayName":"Canada + Central","longitude":"-79.383","latitude":"43.653"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/canadaeast","name":"canadaeast","displayName":"Canada + East","longitude":"-71.217","latitude":"46.817"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uksouth","name":"uksouth","displayName":"UK + South","longitude":"-0.799","latitude":"50.941"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/ukwest","name":"ukwest","displayName":"UK + West","longitude":"-3.084","latitude":"53.427"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westcentralus","name":"westcentralus","displayName":"West + Central US","longitude":"-110.234","latitude":"40.890"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/westus2","name":"westus2","displayName":"West + US 2","longitude":"-119.852","latitude":"47.233"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreacentral","name":"koreacentral","displayName":"Korea + Central","longitude":"126.9780","latitude":"37.5665"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/koreasouth","name":"koreasouth","displayName":"Korea + South","longitude":"129.0756","latitude":"35.1796"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francecentral","name":"francecentral","displayName":"France + Central","longitude":"2.3730","latitude":"46.3772"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/francesouth","name":"francesouth","displayName":"France + South","longitude":"2.1972","latitude":"43.8345"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral","name":"australiacentral","displayName":"Australia + Central","longitude":"149.1244","latitude":"-35.3075"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/australiacentral2","name":"australiacentral2","displayName":"Australia + Central 2","longitude":"149.1244","latitude":"-35.3075"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaecentral","name":"uaecentral","displayName":"UAE + Central","longitude":"54.366669","latitude":"24.466667"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/uaenorth","name":"uaenorth","displayName":"UAE + North","longitude":"55.316666","latitude":"25.266666"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricanorth","name":"southafricanorth","displayName":"South + Africa North","longitude":"28.218370","latitude":"-25.731340"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/southafricawest","name":"southafricawest","displayName":"South + Africa West","longitude":"18.843266","latitude":"-34.075691"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandnorth","name":"switzerlandnorth","displayName":"Switzerland + North","longitude":"8.564572","latitude":"47.451542"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/switzerlandwest","name":"switzerlandwest","displayName":"Switzerland + West","longitude":"6.143158","latitude":"46.204391"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanynorth","name":"germanynorth","displayName":"Germany + North","longitude":"8.806422","latitude":"53.073635"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/germanywestcentral","name":"germanywestcentral","displayName":"Germany + West Central","longitude":"8.682127","latitude":"50.110924"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwaywest","name":"norwaywest","displayName":"Norway + West","longitude":"5.733107","latitude":"58.969975"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/locations/norwayeast","name":"norwayeast","displayName":"Norway + East","longitude":"10.752245","latitude":"59.913868"}]}' + headers: + cache-control: + - no-cache + content-length: + - '7129' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 21 Apr 2020 09:42:57 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: 'b''b\''{"location": "westus", "properties": {"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.Storage/storageAccounts/clitest000002", + "jobType": "Import", "returnAddress": {"recipientName": "Tests", "streetAddress1": + "Street1", "streetAddress2": "street2", "city": "Redmond", "stateOrProvince": + "wa", "postalCode": "98007", "countryOrRegion": "USA", "phone": "4250000000", + "email": "Test@contoso.com"}, "diagnosticsPath": "waimportexport", "logLevel": + "Verbose", "backupDriveManifest": true, "driveList": [{"driveId": "9CA995BF", + "bitLockerKey": "238810-662376-448998-450120-652806-203390-606320-483076", "manifestFile": + "\\\\\\\\DriveManifest.xml", "manifestHash": "109B21108597EF36D5785F08303F3638", + "driveHeaderHash": ""}]}}\''''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - import-export create + Connection: + - keep-alive + Content-Length: + - '860' + Content-Type: + - application/json + ParameterSetName: + - -g -n --location --type --log-level --storage-account --backup-drive-manifest + --diagnostics-path --drive-list --return-address + User-Agent: + - AZURECLI/2.4.0 azsdk-python-core/1.4.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + azsdk-python-storageimportexport/unknown + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.ImportExport/jobs/test-import-export-000003?api-version=2016-11-01 + response: + body: + string: '{"properties":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.Storage/storageAccounts/clitest000002","jobType":"Import","returnAddress":{"recipientName":"Tests","streetAddress1":"Street1","streetAddress2":"street2","city":"Redmond","stateOrProvince":"wa","postalCode":"98007","countryOrRegion":"USA","phone":"4250000000","email":"Test@contoso.com"},"shippingInformation":{"recipientName":"Microsoft + Azure Import/Export Service","streetAddress1":"3020 Coronado","streetAddress2":"","city":"Santa + Clara","stateOrProvince":"CA","postalCode":"95054","countryOrRegion":"USA","phone":"408 + 352 7600"},"diagnosticsPath":"waimportexport","logLevel":"Verbose","backupDriveManifest":true,"cancelRequested":false,"state":"Creating","driveList":[{"driveId":"9CA995BF","manifestFile":"\\DriveManifest.xml","manifestHash":"109B21108597EF36D5785F08303F3638","driveHeaderHash":"","state":"Specified"}],"provisioningState":"Succeeded","encryptionKey":{"kekType":"MicrosoftManaged"}},"identity":{"type":"None"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.ImportExport/jobs/test-import-export-000003","name":"test-import-export-000003","type":"Microsoft.ImportExport/jobs","location":"westus"}' + headers: + cache-control: + - no-cache + content-length: + - '1443' + content-type: + - application/json + date: + - Tue, 21 Apr 2020 09:43:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - import-export list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.4.0 azsdk-python-core/1.4.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + azsdk-python-storageimportexport/unknown + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.ImportExport/jobs?api-version=2016-11-01 + response: + body: + string: '{"value":[{"properties":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.Storage/storageAccounts/clitest000002","jobType":"Import","returnAddress":{"recipientName":"Tests","streetAddress1":"Street1","streetAddress2":"street2","city":"Redmond","stateOrProvince":"wa","postalCode":"98007","countryOrRegion":"USA","phone":"4250000000","email":"Test@contoso.com"},"shippingInformation":{"recipientName":"Microsoft + Azure Import/Export Service","streetAddress1":"3020 Coronado","streetAddress2":"","city":"Santa + Clara","stateOrProvince":"CA","postalCode":"95054","countryOrRegion":"USA","phone":"408 + 352 7600"},"diagnosticsPath":"waimportexport","logLevel":"Verbose","backupDriveManifest":true,"cancelRequested":false,"state":"Creating","provisioningState":"Succeeded","encryptionKey":{"kekType":"MicrosoftManaged"}},"identity":{"type":"None"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.ImportExport/jobs/test-import-export-000003","name":"test-import-export-000003","type":"Microsoft.ImportExport/jobs","location":"West + US"}]}' + headers: + cache-control: + - no-cache + content-length: + - '1291' + content-type: + - application/json + date: + - Tue, 21 Apr 2020 09:43:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - import-export show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.4.0 azsdk-python-core/1.4.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + azsdk-python-storageimportexport/unknown + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.ImportExport/jobs/test-import-export-000003?api-version=2016-11-01 + response: + body: + string: '{"properties":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.Storage/storageAccounts/clitest000002","jobType":"Import","returnAddress":{"recipientName":"Tests","streetAddress1":"Street1","streetAddress2":"street2","city":"Redmond","stateOrProvince":"wa","postalCode":"98007","countryOrRegion":"USA","phone":"4250000000","email":"Test@contoso.com"},"shippingInformation":{"recipientName":"Microsoft + Azure Import/Export Service","streetAddress1":"3020 Coronado","streetAddress2":"","city":"Santa + Clara","stateOrProvince":"CA","postalCode":"95054","countryOrRegion":"USA","phone":"408 + 352 7600"},"diagnosticsPath":"waimportexport","logLevel":"Verbose","backupDriveManifest":true,"cancelRequested":false,"state":"Creating","driveList":[{"driveId":"9CA995BF","manifestFile":"\\DriveManifest.xml","manifestHash":"109B21108597EF36D5785F08303F3638","driveHeaderHash":"","state":"Specified"}],"provisioningState":"Succeeded","encryptionKey":{"kekType":"MicrosoftManaged"}},"identity":{"type":"None"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.ImportExport/jobs/test-import-export-000003","name":"test-import-export-000003","type":"Microsoft.ImportExport/jobs","location":"West + US"}' + headers: + cache-control: + - no-cache + content-length: + - '1444' + content-type: + - application/json + date: + - Tue, 21 Apr 2020 09:43:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"cancelRequested": true}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - import-export update + Connection: + - keep-alive + Content-Length: + - '41' + Content-Type: + - application/json + ParameterSetName: + - -g -n --cancel-requested + User-Agent: + - AZURECLI/2.4.0 azsdk-python-core/1.4.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + azsdk-python-storageimportexport/unknown + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.ImportExport/jobs/test-import-export-000003?api-version=2016-11-01 + response: + body: + string: '{"properties":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.Storage/storageAccounts/clitest000002","jobType":"Import","returnAddress":{"recipientName":"Tests","streetAddress1":"Street1","streetAddress2":"street2","city":"Redmond","stateOrProvince":"wa","postalCode":"98007","countryOrRegion":"USA","phone":"4250000000","email":"Test@contoso.com"},"shippingInformation":{"recipientName":"Microsoft + Azure Import/Export Service","streetAddress1":"3020 Coronado","streetAddress2":"","city":"Santa + Clara","stateOrProvince":"CA","postalCode":"95054","countryOrRegion":"USA","phone":"408 + 352 7600"},"diagnosticsPath":"waimportexport","logLevel":"Verbose","backupDriveManifest":true,"cancelRequested":true,"state":"Creating","driveList":[{"driveId":"9CA995BF","manifestFile":"\\DriveManifest.xml","manifestHash":"109B21108597EF36D5785F08303F3638","driveHeaderHash":"","state":"Specified"}],"provisioningState":"Succeeded","encryptionKey":{"kekType":"MicrosoftManaged"}},"identity":{"type":"None"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.ImportExport/jobs/test-import-export-000003","name":"test-import-export-000003","type":"Microsoft.ImportExport/jobs","location":"West + US"}' + headers: + cache-control: + - no-cache + content-length: + - '1443' + content-type: + - application/json + date: + - Tue, 21 Apr 2020 09:43:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - import-export bit-locker-key list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --job-name + User-Agent: + - AZURECLI/2.4.0 azsdk-python-core/1.4.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + azsdk-python-storageimportexport/unknown + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.ImportExport/jobs/test-import-export-000003/listBitLockerKeys?api-version=2016-11-01 + response: + body: + string: '{"value":[{"driveId":"9CA995BF","bitLockerKey":"238810-662376-448998-450120-652806-203390-606320-483076"}]}' + headers: + cache-control: + - no-cache + content-length: + - '107' + content-type: + - application/json + date: + - Tue, 21 Apr 2020 09:43:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - import-export delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.4.0 azsdk-python-core/1.4.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + azsdk-python-storageimportexport/unknown + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_import_export_000001/providers/Microsoft.ImportExport/jobs/test-import-export-000003?api-version=2016-11-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 21 Apr 2020 09:43:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/import-export/azext_import_export/tests/latest/test_import_export_scenario.py b/src/import-export/azext_import_export/tests/latest/test_import_export_scenario.py new file mode 100644 index 00000000000..be675899654 --- /dev/null +++ b/src/import-export/azext_import_export/tests/latest/test_import_export_scenario.py @@ -0,0 +1,56 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os + +from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class ImportExportScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_import_export_', key='rg') + @StorageAccountPreparer(parameter_name='storage_account') + def test_import_export(self, resource_group, storage_account): + self.kwargs.update({ + 'job_name': self.create_random_name(prefix='test-import-export-', length=24), + 'storage_account': storage_account, + 'bit_locker_key': '238810-662376-448998-450120-652806-203390-606320-483076', + 'driver_id': '9CA995BF' + }) + storage_account_id = self.cmd('storage account show -g {rg} -n {storage_account}').get_output_in_json()['id'] + self.kwargs.update({ + 'storage_account_id': storage_account_id + }) + + self.cmd('import-export location list', checks=[ + self.greater_than('length(@)', 0) + ]) + self.cmd('import-export location show --location "West US 2"', checks=[ + self.check('name', 'West US 2') + ]) + + self.cmd('import-export create -g {rg} -n {job_name} --location "West US" --type Import --log-level Verbose ' + '--storage-account {storage_account_id} --backup-drive-manifest true ' + '--diagnostics-path waimportexport --drive-list drive-id={driver_id} bit-locker-key={bit_locker_key} ' + 'drive-header-hash="" manifest-file=\\\\DriveManifest.xml ' + 'manifest-hash=109B21108597EF36D5785F08303F3638 --return-address city=Redmond country-or-region=USA ' + 'email=Test@contoso.com phone=4250000000 postal-code=98007 recipient-name=Tests state-or-province=wa ' + 'street-address1=Street1 street-address2=street2', + checks=[self.check('name', '{job_name}')]) + self.cmd('import-export list -g {rg}', checks=[self.check('length(@)', 1)]) + self.cmd('import-export show -g {rg} -n {job_name}', checks=[self.check('name', '{job_name}')]) + self.cmd('import-export update -g {rg} -n {job_name} --cancel-requested true', checks=[ + self.check('name', '{job_name}'), + self.check('properties.cancelRequested', 'True') + ]) + + self.cmd('import-export bit-locker-key list -g {rg} --job-name {job_name}', checks=[ + self.check('[0].driveId', '{driver_id}'), + self.check('[0].bitLockerKey', '{bit_locker_key}') + ]) + self.cmd('import-export delete -g {rg} -n {job_name}') diff --git a/src/import-export/azext_import_export/vendored_sdks/__init__.py b/src/import-export/azext_import_export/vendored_sdks/__init__.py new file mode 100644 index 00000000000..be1a152630c --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/__init__.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/__init__.py new file mode 100644 index 00000000000..9dacfa50491 --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._storage_import_export import StorageImportExport +__all__ = ['StorageImportExport'] diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/_configuration.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/_configuration.py new file mode 100644 index 00000000000..54d3fa539f8 --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/_configuration.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +VERSION = "unknown" + +class StorageImportExportConfiguration(Configuration): + """Configuration for StorageImportExport + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The subscription ID for the Azure user. + :type subscription_id: str + :param acceptlanguage: Specifies the preferred language for the response. + :type acceptlanguage: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + acceptlanguage=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(StorageImportExportConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.acceptlanguage = acceptlanguage + self.api_version = "2016-11-01" + self._configure(**kwargs) + self.user_agent_policy.add_user_agent('azsdk-python-storageimportexport/{}'.format(VERSION)) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, **kwargs) diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/_storage_import_export.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/_storage_import_export.py new file mode 100644 index 00000000000..8f210f8ac8f --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/_storage_import_export.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.core import PipelineClient +from msrest import Deserializer, Serializer + +from ._configuration import StorageImportExportConfiguration +from .operations import LocationOperations +from .operations import JobOperations +from .operations import BitLockerKeyOperations +from .operations import OperationOperations +from . import models + + +class StorageImportExport(object): + """The Storage Import/Export Resource Provider API. + + :ivar location: LocationOperations operations + :vartype location: storage_import_export.operations.LocationOperations + :ivar job: JobOperations operations + :vartype job: storage_import_export.operations.JobOperations + :ivar bit_locker_key: BitLockerKeyOperations operations + :vartype bit_locker_key: storage_import_export.operations.BitLockerKeyOperations + :ivar operation: OperationOperations operations + :vartype operation: storage_import_export.operations.OperationOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The subscription ID for the Azure user. + :type subscription_id: str + :param acceptlanguage: Specifies the preferred language for the response. + :type acceptlanguage: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + acceptlanguage=None, # type: Optional[str] + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = StorageImportExportConfiguration(credential, subscription_id, acceptlanguage, **kwargs) + self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.location = LocationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job = JobOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bit_locker_key = BitLockerKeyOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> StorageImportExport + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/__init__.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/__init__.py new file mode 100644 index 00000000000..56cd3f49059 --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._storage_import_export_async import StorageImportExport +__all__ = ['StorageImportExport'] diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/_configuration_async.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/_configuration_async.py new file mode 100644 index 00000000000..fbab0f10c30 --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/_configuration_async.py @@ -0,0 +1,62 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +VERSION = "unknown" + +class StorageImportExportConfiguration(Configuration): + """Configuration for StorageImportExport + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The subscription ID for the Azure user. + :type subscription_id: str + :param acceptlanguage: Specifies the preferred language for the response. + :type acceptlanguage: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + acceptlanguage: Optional[str] = None, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(StorageImportExportConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.acceptlanguage = acceptlanguage + self.api_version = "2016-11-01" + self._configure(**kwargs) + self.user_agent_policy.add_user_agent('azsdk-python-storageimportexport/{}'.format(VERSION)) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, **kwargs) diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/_storage_import_export_async.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/_storage_import_export_async.py new file mode 100644 index 00000000000..1ecbc055dc1 --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/_storage_import_export_async.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.core import AsyncPipelineClient +from msrest import Deserializer, Serializer + +from ._configuration_async import StorageImportExportConfiguration +from .operations_async import LocationOperations +from .operations_async import JobOperations +from .operations_async import BitLockerKeyOperations +from .operations_async import OperationOperations +from .. import models + + +class StorageImportExport(object): + """The Storage Import/Export Resource Provider API. + + :ivar location: LocationOperations operations + :vartype location: storage_import_export.aio.operations_async.LocationOperations + :ivar job: JobOperations operations + :vartype job: storage_import_export.aio.operations_async.JobOperations + :ivar bit_locker_key: BitLockerKeyOperations operations + :vartype bit_locker_key: storage_import_export.aio.operations_async.BitLockerKeyOperations + :ivar operation: OperationOperations operations + :vartype operation: storage_import_export.aio.operations_async.OperationOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The subscription ID for the Azure user. + :type subscription_id: str + :param acceptlanguage: Specifies the preferred language for the response. + :type acceptlanguage: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + acceptlanguage: Optional[str] = None, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = StorageImportExportConfiguration(credential, subscription_id, acceptlanguage, **kwargs) + self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.location = LocationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.job = JobOperations( + self._client, self._config, self._serialize, self._deserialize) + self.bit_locker_key = BitLockerKeyOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "StorageImportExport": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/operations_async/__init__.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/operations_async/__init__.py new file mode 100644 index 00000000000..dcd0228be5a --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/operations_async/__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 ._location_operations_async import LocationOperations +from ._job_operations_async import JobOperations +from ._bit_locker_key_operations_async import BitLockerKeyOperations +from ._operation_operations_async import OperationOperations + +__all__ = [ + 'LocationOperations', + 'JobOperations', + 'BitLockerKeyOperations', + 'OperationOperations', +] diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/operations_async/_bit_locker_key_operations_async.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/operations_async/_bit_locker_key_operations_async.py new file mode 100644 index 00000000000..fbd966d7f0c --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/operations_async/_bit_locker_key_operations_async.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BitLockerKeyOperations: + """BitLockerKeyOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~storage_import_export.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + job_name: str, + resource_group_name: str, + **kwargs + ) -> "models.GetBitLockerKeysResponse": + """Returns the BitLocker Keys for all drives in the specified job. + + :param job_name: The name of the import/export job. + :type job_name: str + :param resource_group_name: The resource group name uniquely identifies the resource group + within the user subscription. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetBitLockerKeysResponse or the result of cls(response) + :rtype: ~storage_import_export.models.GetBitLockerKeysResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls: ClsType["models.GetBitLockerKeysResponse"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('GetBitLockerKeysResponse', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}/listBitLockerKeys'} diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/operations_async/_job_operations_async.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/operations_async/_job_operations_async.py new file mode 100644 index 00000000000..890b3908ab6 --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/operations_async/_job_operations_async.py @@ -0,0 +1,546 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class JobOperations: + """JobOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~storage_import_export.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs + ) -> "models.ListJobsResponse": + """Returns all active and completed jobs in a subscription. + + :param top: An integer value that specifies how many jobs at most should be returned. The value + cannot exceed 100. + :type top: int + :param filter: Can be used to restrict the results to certain conditions. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListJobsResponse or the result of cls(response) + :rtype: ~storage_import_export.models.ListJobsResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls: ClsType["models.ListJobsResponse"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + def prepare_request(next_link=None): + if not next_link: + # 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) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListJobsResponse', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ImportExport/jobs'} + + def list_by_resource_group( + self, + resource_group_name: str, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs + ) -> "models.ListJobsResponse": + """Returns all active and completed jobs in a resource group. + + :param resource_group_name: The resource group name uniquely identifies the resource group + within the user subscription. + :type resource_group_name: str + :param top: An integer value that specifies how many jobs at most should be returned. The value + cannot exceed 100. + :type top: int + :param filter: Can be used to restrict the results to certain conditions. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListJobsResponse or the result of cls(response) + :rtype: ~storage_import_export.models.ListJobsResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls: ClsType["models.ListJobsResponse"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + def prepare_request(next_link=None): + if not next_link: + # 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'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListJobsResponse', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs'} + + async def get( + self, + job_name: str, + resource_group_name: str, + **kwargs + ) -> "models.JobResponse": + """Gets information about an existing job. + + :param job_name: The name of the import/export job. + :type job_name: str + :param resource_group_name: The resource group name uniquely identifies the resource group + within the user subscription. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResponse or the result of cls(response) + :rtype: ~storage_import_export.models.JobResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls: ClsType["models.JobResponse"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + deserialized = self._deserialize('JobResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'} + + async def update( + self, + job_name: str, + resource_group_name: str, + tags: Optional["models.UpdateJobParametersTags"] = None, + cancel_requested: Optional[bool] = None, + state: Optional[str] = None, + return_address: Optional["models.ReturnAddress"] = None, + return_shipping: Optional["models.ReturnShipping"] = None, + delivery_package: Optional["models.PackageInfomation"] = None, + log_level: Optional[str] = None, + backup_drive_manifest: Optional[bool] = None, + drive_list: Optional[List["DriveStatus"]] = None, + **kwargs + ) -> "models.JobResponse": + """Updates specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing job. + + :param job_name: The name of the import/export job. + :type job_name: str + :param resource_group_name: The resource group name uniquely identifies the resource group + within the user subscription. + :type resource_group_name: str + :param tags: Specifies the tags that will be assigned to the job. + :type tags: ~storage_import_export.models.UpdateJobParametersTags + :param cancel_requested: If specified, the value must be true. The service will attempt to + cancel the job. + :type cancel_requested: bool + :param state: If specified, the value must be Shipping, which tells the Import/Export service + that the package for the job has been shipped. The ReturnAddress and DeliveryPackage properties + must have been set either in this request or in a previous request, otherwise the request will + fail. + :type state: str + :param return_address: Specifies the return address information for the job. + :type return_address: ~storage_import_export.models.ReturnAddress + :param return_shipping: Specifies the return carrier and customer's account with the carrier. + :type return_shipping: ~storage_import_export.models.ReturnShipping + :param delivery_package: Contains information about the package being shipped by the customer + to the Microsoft data center. + :type delivery_package: ~storage_import_export.models.PackageInfomation + :param log_level: Indicates whether error logging or verbose logging is enabled. + :type log_level: str + :param backup_drive_manifest: Indicates whether the manifest files on the drives should be + copied to block blobs. + :type backup_drive_manifest: bool + :param drive_list: List of drives that comprise the job. + :type drive_list: list[~storage_import_export.models.DriveStatus] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResponse or the result of cls(response) + :rtype: ~storage_import_export.models.JobResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls: ClsType["models.JobResponse"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + + body = models.UpdateJobParameters(tags=tags, cancel_requested=cancel_requested, state=state, return_address=return_address, return_shipping=return_shipping, delivery_package=delivery_package, log_level=log_level, backup_drive_manifest=backup_drive_manifest, drive_list=drive_list) + api_version = "2016-11-01" + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(body, 'UpdateJobParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + deserialized = self._deserialize('JobResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'} + + async def create( + self, + job_name: str, + resource_group_name: str, + client_tenant_id: Optional[str] = None, + location: Optional[str] = None, + tags: Optional["models.PutJobParametersTags"] = None, + storage_account_id: Optional[str] = None, + job_type: Optional[str] = None, + return_address: Optional["models.ReturnAddress"] = None, + return_shipping: Optional["models.ReturnShipping"] = None, + shipping_information: Optional["models.ShippingInformation"] = None, + delivery_package: Optional["models.PackageInfomation"] = None, + return_package: Optional["models.PackageInfomation"] = None, + diagnostics_path: Optional[str] = None, + log_level: Optional[str] = None, + backup_drive_manifest: Optional[bool] = None, + state: Optional[str] = None, + cancel_requested: Optional[bool] = None, + percent_complete: Optional[int] = None, + incomplete_blob_list_uri: Optional[str] = None, + drive_list: Optional[List["DriveStatus"]] = None, + export: Optional["models.Export"] = None, + provisioning_state: Optional[str] = None, + **kwargs + ) -> "models.JobResponse": + """Creates a new job or updates an existing job in the specified subscription. + + :param job_name: The name of the import/export job. + :type job_name: str + :param resource_group_name: The resource group name uniquely identifies the resource group + within the user subscription. + :type resource_group_name: str + :param client_tenant_id: The tenant ID of the client making the request. + :type client_tenant_id: str + :param location: Specifies the supported Azure location where the job should be created. + :type location: str + :param tags: Specifies the tags that will be assigned to the job. + :type tags: ~storage_import_export.models.PutJobParametersTags + :param storage_account_id: The resource identifier of the storage account where data will be + imported to or exported from. + :type storage_account_id: str + :param job_type: The type of job. + :type job_type: str + :param return_address: Specifies the return address information for the job. + :type return_address: ~storage_import_export.models.ReturnAddress + :param return_shipping: Specifies the return carrier and customer's account with the carrier. + :type return_shipping: ~storage_import_export.models.ReturnShipping + :param shipping_information: Contains information about the Microsoft datacenter to which the + drives should be shipped. + :type shipping_information: ~storage_import_export.models.ShippingInformation + :param delivery_package: Contains information about the package being shipped by the customer + to the Microsoft data center. + :type delivery_package: ~storage_import_export.models.PackageInfomation + :param return_package: Contains information about the package being shipped by the customer to + the Microsoft data center. + :type return_package: ~storage_import_export.models.PackageInfomation + :param diagnostics_path: The virtual blob directory to which the copy logs and backups of drive + manifest files (if enabled) will be stored. + :type diagnostics_path: str + :param log_level: Default value is Error. Indicates whether error logging or verbose logging + will be enabled. + :type log_level: str + :param backup_drive_manifest: Default value is false. Indicates whether the manifest files on + the drives should be copied to block blobs. + :type backup_drive_manifest: bool + :param state: Current state of the job. + :type state: str + :param cancel_requested: Indicates whether a request has been submitted to cancel the job. + :type cancel_requested: bool + :param percent_complete: Overall percentage completed for the job. + :type percent_complete: int + :param incomplete_blob_list_uri: A blob path that points to a block blob containing a list of + blob names that were not exported due to insufficient drive space. If all blobs were exported + successfully, then this element is not included in the response. + :type incomplete_blob_list_uri: str + :param drive_list: List of up to ten drives that comprise the job. The drive list is a required + element for an import job; it is not specified for export jobs. + :type drive_list: list[~storage_import_export.models.DriveStatus] + :param export: A property containing information about the blobs to be exported for an export + job. This property is required for export jobs, but must not be specified for import jobs. + :type export: ~storage_import_export.models.Export + :param provisioning_state: Specifies the provisioning state of the job. + :type provisioning_state: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResponse or JobResponse or the result of cls(response) + :rtype: ~storage_import_export.models.JobResponse or ~storage_import_export.models.JobResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls: ClsType["models.JobResponse"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + + body = models.PutJobParameters(location=location, tags=tags, storage_account_id=storage_account_id, job_type=job_type, return_address=return_address, return_shipping=return_shipping, shipping_information=shipping_information, delivery_package=delivery_package, return_package=return_package, diagnostics_path=diagnostics_path, log_level=log_level, backup_drive_manifest=backup_drive_manifest, state=state, cancel_requested=cancel_requested, percent_complete=percent_complete, incomplete_blob_list_uri=incomplete_blob_list_uri, drive_list=drive_list, export=export, provisioning_state=provisioning_state) + api_version = "2016-11-01" + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + if client_tenant_id is not None: + header_parameters['x-ms-client-tenant-id'] = self._serialize.header("client_tenant_id", client_tenant_id, 'str') + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(body, 'PutJobParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResponse', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('JobResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'} + + async def delete( + self, + job_name: str, + resource_group_name: str, + **kwargs + ) -> None: + """Deletes an existing job. Only jobs in the Creating or Completed states can be deleted. + + :param job_name: The name of the import/export job. + :type job_name: str + :param resource_group_name: The resource group name uniquely identifies the resource group + within the user subscription. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'} diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/operations_async/_location_operations_async.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/operations_async/_location_operations_async.py new file mode 100644 index 00000000000..26e0ecd3617 --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/operations_async/_location_operations_async.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LocationOperations: + """LocationOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~storage_import_export.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> "models.LocationsResponse": + """Returns a list of locations to which you can ship the disks associated with an import or export job. A location is a Microsoft data center region. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LocationsResponse or the result of cls(response) + :rtype: ~storage_import_export.models.LocationsResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls: ClsType["models.LocationsResponse"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('LocationsResponse', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.ImportExport/locations'} + + async def get( + self, + location_name: str, + **kwargs + ) -> "models.Location": + """Returns the details about a location to which you can ship the disks associated with an import or export job. A location is an Azure region. + + :param location_name: The name of the location. For example, West US or westus. + :type location_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Location or the result of cls(response) + :rtype: ~storage_import_export.models.Location + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls: ClsType["models.Location"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'locationName': self._serialize.url("location_name", location_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + deserialized = self._deserialize('Location', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/providers/Microsoft.ImportExport/locations/{locationName}'} diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/operations_async/_operation_operations_async.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/operations_async/_operation_operations_async.py new file mode 100644 index 00000000000..41528257a21 --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/aio/operations_async/_operation_operations_async.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations: + """OperationOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~storage_import_export.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> "models.ListOperationsResponse": + """Returns the list of operations supported by the import/export resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListOperationsResponse or the result of cls(response) + :rtype: ~storage_import_export.models.ListOperationsResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls: ClsType["models.ListOperationsResponse"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListOperationsResponse', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.ImportExport/operations'} diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/models/__init__.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/models/__init__.py new file mode 100644 index 00000000000..84af98470af --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/models/__init__.py @@ -0,0 +1,101 @@ +# 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 DriveBitLockerKey + from ._models_py3 import DriveStatus + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import ErrorResponseError + from ._models_py3 import ErrorResponseErrorDetailsItem + from ._models_py3 import ErrorResponseErrorInnererror + from ._models_py3 import Export + from ._models_py3 import ExportBlobList + from ._models_py3 import GetBitLockerKeysResponse + from ._models_py3 import JobDetails + from ._models_py3 import JobResponse + from ._models_py3 import JobResponseTags + from ._models_py3 import ListJobsResponse + from ._models_py3 import ListOperationsResponse + from ._models_py3 import Location + from ._models_py3 import LocationProperties + from ._models_py3 import LocationsResponse + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import PackageInfomation + from ._models_py3 import PutJobParameters + from ._models_py3 import PutJobParametersTags + from ._models_py3 import ReturnAddress + from ._models_py3 import ReturnShipping + from ._models_py3 import ShippingInformation + from ._models_py3 import UpdateJobParameters + from ._models_py3 import UpdateJobParametersProperties + from ._models_py3 import UpdateJobParametersTags +except (SyntaxError, ImportError): + from ._models import DriveBitLockerKey # type: ignore + from ._models import DriveStatus # type: ignore + from ._models import ErrorResponse, ErrorResponseException # type: ignore + from ._models import ErrorResponseError # type: ignore + from ._models import ErrorResponseErrorDetailsItem # type: ignore + from ._models import ErrorResponseErrorInnererror # type: ignore + from ._models import Export # type: ignore + from ._models import ExportBlobList # type: ignore + from ._models import GetBitLockerKeysResponse # type: ignore + from ._models import JobDetails # type: ignore + from ._models import JobResponse # type: ignore + from ._models import JobResponseTags # type: ignore + from ._models import ListJobsResponse # type: ignore + from ._models import ListOperationsResponse # type: ignore + from ._models import Location # type: ignore + from ._models import LocationProperties # type: ignore + from ._models import LocationsResponse # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import PackageInfomation # type: ignore + from ._models import PutJobParameters # type: ignore + from ._models import PutJobParametersTags # type: ignore + from ._models import ReturnAddress # type: ignore + from ._models import ReturnShipping # type: ignore + from ._models import ShippingInformation # type: ignore + from ._models import UpdateJobParameters # type: ignore + from ._models import UpdateJobParametersProperties # type: ignore + from ._models import UpdateJobParametersTags # type: ignore +from ._storage_import_export_enums import ( + DriveState, +) + +__all__ = [ + 'DriveBitLockerKey', + 'DriveStatus', + 'ErrorResponse', 'ErrorResponseException', + 'ErrorResponseError', + 'ErrorResponseErrorDetailsItem', + 'ErrorResponseErrorInnererror', + 'Export', + 'ExportBlobList', + 'GetBitLockerKeysResponse', + 'JobDetails', + 'JobResponse', + 'JobResponseTags', + 'ListJobsResponse', + 'ListOperationsResponse', + 'Location', + 'LocationProperties', + 'LocationsResponse', + 'Operation', + 'OperationDisplay', + 'PackageInfomation', + 'PutJobParameters', + 'PutJobParametersTags', + 'ReturnAddress', + 'ReturnShipping', + 'ShippingInformation', + 'UpdateJobParameters', + 'UpdateJobParametersProperties', + 'UpdateJobParametersTags', + 'DriveState', +] diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/models/_models.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/models/_models.py new file mode 100644 index 00000000000..065c998a993 --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/models/_models.py @@ -0,0 +1,1175 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class DriveBitLockerKey(msrest.serialization.Model): + """BitLocker recovery key or password to the specified drive. + + :param bit_locker_key: BitLocker recovery key or password. + :type bit_locker_key: str + :param drive_id: Drive ID. + :type drive_id: str + """ + + _attribute_map = { + 'bit_locker_key': {'key': 'bitLockerKey', 'type': 'str'}, + 'drive_id': {'key': 'driveId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DriveBitLockerKey, self).__init__(**kwargs) + self.bit_locker_key = kwargs.get('bit_locker_key', None) + self.drive_id = kwargs.get('drive_id', None) + + +class DriveStatus(msrest.serialization.Model): + """Provides information about the drive's status. + + :param drive_id: The drive's hardware serial number, without spaces. + :type drive_id: str + :param bit_locker_key: The BitLocker key used to encrypt the drive. + :type bit_locker_key: str + :param manifest_file: The relative path of the manifest file on the drive. + :type manifest_file: str + :param manifest_hash: The Base16-encoded MD5 hash of the manifest file on the drive. + :type manifest_hash: str + :param drive_header_hash: The drive header hash value. + :type drive_header_hash: str + :param state: The drive's current state. Possible values include: 'Specified', 'Received', + 'NeverReceived', 'Transferring', 'Completed', 'CompletedMoreInfo', 'ShippedBack'. + :type state: str or ~storage_import_export.models.DriveState + :param copy_status: Detailed status about the data transfer process. This field is not returned + in the response until the drive is in the Transferring state. + :type copy_status: str + :param percent_complete: Percentage completed for the drive. + :type percent_complete: int + :param verbose_log_uri: A URI that points to the blob containing the verbose log for the data + transfer operation. + :type verbose_log_uri: str + :param error_log_uri: A URI that points to the blob containing the error log for the data + transfer operation. + :type error_log_uri: str + :param manifest_uri: A URI that points to the blob containing the drive manifest file. + :type manifest_uri: str + :param bytes_succeeded: Bytes successfully transferred for the drive. + :type bytes_succeeded: long + """ + + _attribute_map = { + 'drive_id': {'key': 'driveId', 'type': 'str'}, + 'bit_locker_key': {'key': 'bitLockerKey', 'type': 'str'}, + 'manifest_file': {'key': 'manifestFile', 'type': 'str'}, + 'manifest_hash': {'key': 'manifestHash', 'type': 'str'}, + 'drive_header_hash': {'key': 'driveHeaderHash', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'copy_status': {'key': 'copyStatus', 'type': 'str'}, + 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, + 'verbose_log_uri': {'key': 'verboseLogUri', 'type': 'str'}, + 'error_log_uri': {'key': 'errorLogUri', 'type': 'str'}, + 'manifest_uri': {'key': 'manifestUri', 'type': 'str'}, + 'bytes_succeeded': {'key': 'bytesSucceeded', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(DriveStatus, self).__init__(**kwargs) + self.drive_id = kwargs.get('drive_id', None) + self.bit_locker_key = kwargs.get('bit_locker_key', None) + self.manifest_file = kwargs.get('manifest_file', None) + self.manifest_hash = kwargs.get('manifest_hash', None) + self.drive_header_hash = kwargs.get('drive_header_hash', None) + self.state = kwargs.get('state', None) + self.copy_status = kwargs.get('copy_status', None) + self.percent_complete = kwargs.get('percent_complete', None) + self.verbose_log_uri = kwargs.get('verbose_log_uri', None) + self.error_log_uri = kwargs.get('error_log_uri', None) + self.manifest_uri = kwargs.get('manifest_uri', None) + self.bytes_succeeded = kwargs.get('bytes_succeeded', None) + + +class ErrorResponseException(HttpResponseError): + """Server responded with exception of type: 'ErrorResponse'. + + :param response: Server response to be deserialized. + :param error_model: A deserialized model of the response body as model. + """ + + def __init__(self, response, error_model): + self.error = error_model + super(ErrorResponseException, self).__init__(response=response, error_model=error_model) + + @classmethod + def from_response(cls, response, deserialize): + """Deserialize this response as this exception, or a subclass of this exception. + + :param response: Server response to be deserialized. + :param deserialize: A deserializer + """ + model_name = 'ErrorResponse' + error = deserialize(model_name, response) + if error is None: + error = deserialize.dependencies[model_name]() + return error._EXCEPTION_TYPE(response, error) + + +class ErrorResponse(msrest.serialization.Model): + """Response when errors occurred. + + :param code: Provides information about the error code. + :type code: str + :param message: Provides information about the error message. + :type message: str + :param target: Provides information about the error target. + :type target: str + :param details: Describes the error details if present. + :type details: list[~storage_import_export.models.ErrorResponseErrorDetailsItem] + :param innererror: Inner error object if present. + :type innererror: ~storage_import_export.models.ErrorResponseErrorInnererror + """ + _EXCEPTION_TYPE = ErrorResponseException + + _attribute_map = { + 'code': {'key': 'error.code', 'type': 'str'}, + 'message': {'key': 'error.message', 'type': 'str'}, + 'target': {'key': 'error.target', 'type': 'str'}, + 'details': {'key': 'error.details', 'type': '[ErrorResponseErrorDetailsItem]'}, + 'innererror': {'key': 'error.innererror', 'type': 'ErrorResponseErrorInnererror'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + + +class ErrorResponseError(msrest.serialization.Model): + """Describes the error information. + + :param code: Provides information about the error code. + :type code: str + :param message: Provides information about the error message. + :type message: str + :param target: Provides information about the error target. + :type target: str + :param details: Describes the error details if present. + :type details: list[~storage_import_export.models.ErrorResponseErrorDetailsItem] + :param innererror: Inner error object if present. + :type innererror: ~storage_import_export.models.ErrorResponseErrorInnererror + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponseErrorDetailsItem]'}, + 'innererror': {'key': 'innererror', 'type': 'ErrorResponseErrorInnererror'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + + +class ErrorResponseErrorDetailsItem(msrest.serialization.Model): + """ErrorResponseErrorDetailsItem. + + :param code: Provides information about the error code. + :type code: str + :param target: Provides information about the error target. + :type target: str + :param message: Provides information about the error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseErrorDetailsItem, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.target = kwargs.get('target', None) + self.message = kwargs.get('message', None) + + +class ErrorResponseErrorInnererror(msrest.serialization.Model): + """Inner error object if present. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseErrorInnererror, self).__init__(**kwargs) + + +class Export(msrest.serialization.Model): + """A property containing information about the blobs to be exported for an export job. This property is required for export jobs, but must not be specified for import jobs. + + :param blob_listblob_path: The relative URI to the block blob that contains the list of blob + paths or blob path prefixes as defined above, beginning with the container name. If the blob is + in root container, the URI must begin with $root. + :type blob_listblob_path: str + :param blob_path: A collection of blob-path strings. + :type blob_path: list[str] + :param blob_path_prefix: A collection of blob-prefix strings. + :type blob_path_prefix: list[str] + """ + + _attribute_map = { + 'blob_listblob_path': {'key': 'blobListblobPath', 'type': 'str'}, + 'blob_path': {'key': 'blobList.blobPath', 'type': '[str]'}, + 'blob_path_prefix': {'key': 'blobList.blobPathPrefix', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(Export, self).__init__(**kwargs) + self.blob_listblob_path = kwargs.get('blob_listblob_path', None) + self.blob_path = kwargs.get('blob_path', None) + self.blob_path_prefix = kwargs.get('blob_path_prefix', None) + + +class ExportBlobList(msrest.serialization.Model): + """A list of the blobs to be exported. + + :param blob_path: A collection of blob-path strings. + :type blob_path: list[str] + :param blob_path_prefix: A collection of blob-prefix strings. + :type blob_path_prefix: list[str] + """ + + _attribute_map = { + 'blob_path': {'key': 'blobPath', 'type': '[str]'}, + 'blob_path_prefix': {'key': 'blobPathPrefix', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ExportBlobList, self).__init__(**kwargs) + self.blob_path = kwargs.get('blob_path', None) + self.blob_path_prefix = kwargs.get('blob_path_prefix', None) + + +class GetBitLockerKeysResponse(msrest.serialization.Model): + """GetBitLockerKeys response. + + :param value: drive status. + :type value: list[~storage_import_export.models.DriveBitLockerKey] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DriveBitLockerKey]'}, + } + + def __init__( + self, + **kwargs + ): + super(GetBitLockerKeysResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class JobDetails(msrest.serialization.Model): + """Specifies the job properties. + + :param storage_account_id: The resource identifier of the storage account where data will be + imported to or exported from. + :type storage_account_id: str + :param job_type: The type of job. + :type job_type: str + :param return_address: Specifies the return address information for the job. + :type return_address: ~storage_import_export.models.ReturnAddress + :param return_shipping: Specifies the return carrier and customer's account with the carrier. + :type return_shipping: ~storage_import_export.models.ReturnShipping + :param shipping_information: Contains information about the Microsoft datacenter to which the + drives should be shipped. + :type shipping_information: ~storage_import_export.models.ShippingInformation + :param delivery_package: Contains information about the package being shipped by the customer + to the Microsoft data center. + :type delivery_package: ~storage_import_export.models.PackageInfomation + :param return_package: Contains information about the package being shipped by the customer to + the Microsoft data center. + :type return_package: ~storage_import_export.models.PackageInfomation + :param diagnostics_path: The virtual blob directory to which the copy logs and backups of drive + manifest files (if enabled) will be stored. + :type diagnostics_path: str + :param log_level: Default value is Error. Indicates whether error logging or verbose logging + will be enabled. + :type log_level: str + :param backup_drive_manifest: Default value is false. Indicates whether the manifest files on + the drives should be copied to block blobs. + :type backup_drive_manifest: bool + :param state: Current state of the job. + :type state: str + :param cancel_requested: Indicates whether a request has been submitted to cancel the job. + :type cancel_requested: bool + :param percent_complete: Overall percentage completed for the job. + :type percent_complete: int + :param incomplete_blob_list_uri: A blob path that points to a block blob containing a list of + blob names that were not exported due to insufficient drive space. If all blobs were exported + successfully, then this element is not included in the response. + :type incomplete_blob_list_uri: str + :param drive_list: List of up to ten drives that comprise the job. The drive list is a required + element for an import job; it is not specified for export jobs. + :type drive_list: list[~storage_import_export.models.DriveStatus] + :param export: A property containing information about the blobs to be exported for an export + job. This property is required for export jobs, but must not be specified for import jobs. + :type export: ~storage_import_export.models.Export + :param provisioning_state: Specifies the provisioning state of the job. + :type provisioning_state: str + """ + + _attribute_map = { + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + 'return_address': {'key': 'returnAddress', 'type': 'ReturnAddress'}, + 'return_shipping': {'key': 'returnShipping', 'type': 'ReturnShipping'}, + 'shipping_information': {'key': 'shippingInformation', 'type': 'ShippingInformation'}, + 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageInfomation'}, + 'return_package': {'key': 'returnPackage', 'type': 'PackageInfomation'}, + 'diagnostics_path': {'key': 'diagnosticsPath', 'type': 'str'}, + 'log_level': {'key': 'logLevel', 'type': 'str'}, + 'backup_drive_manifest': {'key': 'backupDriveManifest', 'type': 'bool'}, + 'state': {'key': 'state', 'type': 'str'}, + 'cancel_requested': {'key': 'cancelRequested', 'type': 'bool'}, + 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, + 'incomplete_blob_list_uri': {'key': 'incompleteBlobListUri', 'type': 'str'}, + 'drive_list': {'key': 'driveList', 'type': '[DriveStatus]'}, + 'export': {'key': 'export', 'type': 'Export'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JobDetails, self).__init__(**kwargs) + self.storage_account_id = kwargs.get('storage_account_id', None) + self.job_type = kwargs.get('job_type', None) + self.return_address = kwargs.get('return_address', None) + self.return_shipping = kwargs.get('return_shipping', None) + self.shipping_information = kwargs.get('shipping_information', None) + self.delivery_package = kwargs.get('delivery_package', None) + self.return_package = kwargs.get('return_package', None) + self.diagnostics_path = kwargs.get('diagnostics_path', None) + self.log_level = kwargs.get('log_level', None) + self.backup_drive_manifest = kwargs.get('backup_drive_manifest', None) + self.state = kwargs.get('state', None) + self.cancel_requested = kwargs.get('cancel_requested', None) + self.percent_complete = kwargs.get('percent_complete', None) + self.incomplete_blob_list_uri = kwargs.get('incomplete_blob_list_uri', None) + self.drive_list = kwargs.get('drive_list', None) + self.export = kwargs.get('export', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class JobResponse(msrest.serialization.Model): + """Contains the job information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Specifies the resource identifier of the job. + :vartype id: str + :ivar name: Specifies the name of the job. + :vartype name: str + :ivar type: Specifies the type of the job resource. + :vartype type: str + :param location: Specifies the Azure location where the job is created. + :type location: str + :param tags: A set of tags. Specifies the tags that are assigned to the job. + :type tags: ~storage_import_export.models.JobResponseTags + :param properties: Specifies the job properties. + :type properties: ~storage_import_export.models.JobDetails + """ + + _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': 'JobResponseTags'}, + 'properties': {'key': 'properties', 'type': 'JobDetails'}, + } + + def __init__( + self, + **kwargs + ): + super(JobResponse, 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.properties = kwargs.get('properties', None) + + +class JobResponseTags(msrest.serialization.Model): + """Specifies the tags that are assigned to the job. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(JobResponseTags, self).__init__(**kwargs) + + +class ListJobsResponse(msrest.serialization.Model): + """List jobs response. + + :param next_link: link to next batch of jobs. + :type next_link: str + :param value: Job list. + :type value: list[~storage_import_export.models.JobResponse] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[JobResponse]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListJobsResponse, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class ListOperationsResponse(msrest.serialization.Model): + """List operations response. + + :param value: operations. + :type value: list[~storage_import_export.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListOperationsResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class Location(msrest.serialization.Model): + """Provides information about an Azure data center location. + + :param id: Specifies the resource identifier of the location. + :type id: str + :param name: Specifies the name of the location. Use List Locations to get all supported + locations. + :type name: str + :param type: Specifies the type of the location. + :type type: str + :param recipient_name: The recipient name to use when shipping the drives to the Azure data + center. + :type recipient_name: str + :param street_address1: The first line of the street address to use when shipping the drives to + the Azure data center. + :type street_address1: str + :param street_address2: The first line of the street address to use when shipping the drives to + the Azure data center. + :type street_address2: str + :param city: The city name to use when shipping the drives to the Azure data center. + :type city: str + :param state_or_province: The state or province to use when shipping the drives to the Azure + data center. + :type state_or_province: str + :param postal_code: The postal code to use when shipping the drives to the Azure data center. + :type postal_code: str + :param country_or_region: The country or region to use when shipping the drives to the Azure + data center. + :type country_or_region: str + :param phone: The phone number for the Azure data center. + :type phone: str + :param supported_carriers: A list of carriers that are supported at this location. + :type supported_carriers: list[str] + :param alternate_locations: A list of location IDs that should be used to ship shipping drives + to for jobs created against the current location. If the current location is active, it will be + part of the list. If it is temporarily closed due to maintenance, this list may contain other + locations. + :type alternate_locations: list[str] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recipient_name': {'key': 'properties.recipientName', 'type': 'str'}, + 'street_address1': {'key': 'properties.streetAddress1', 'type': 'str'}, + 'street_address2': {'key': 'properties.streetAddress2', 'type': 'str'}, + 'city': {'key': 'properties.city', 'type': 'str'}, + 'state_or_province': {'key': 'properties.stateOrProvince', 'type': 'str'}, + 'postal_code': {'key': 'properties.postalCode', 'type': 'str'}, + 'country_or_region': {'key': 'properties.countryOrRegion', 'type': 'str'}, + 'phone': {'key': 'properties.phone', 'type': 'str'}, + 'supported_carriers': {'key': 'properties.supportedCarriers', 'type': '[str]'}, + 'alternate_locations': {'key': 'properties.alternateLocations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(Location, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.recipient_name = kwargs.get('recipient_name', None) + self.street_address1 = kwargs.get('street_address1', None) + self.street_address2 = kwargs.get('street_address2', None) + self.city = kwargs.get('city', None) + self.state_or_province = kwargs.get('state_or_province', None) + self.postal_code = kwargs.get('postal_code', None) + self.country_or_region = kwargs.get('country_or_region', None) + self.phone = kwargs.get('phone', None) + self.supported_carriers = kwargs.get('supported_carriers', None) + self.alternate_locations = kwargs.get('alternate_locations', None) + + +class LocationProperties(msrest.serialization.Model): + """location properties. + + :param recipient_name: The recipient name to use when shipping the drives to the Azure data + center. + :type recipient_name: str + :param street_address1: The first line of the street address to use when shipping the drives to + the Azure data center. + :type street_address1: str + :param street_address2: The first line of the street address to use when shipping the drives to + the Azure data center. + :type street_address2: str + :param city: The city name to use when shipping the drives to the Azure data center. + :type city: str + :param state_or_province: The state or province to use when shipping the drives to the Azure + data center. + :type state_or_province: str + :param postal_code: The postal code to use when shipping the drives to the Azure data center. + :type postal_code: str + :param country_or_region: The country or region to use when shipping the drives to the Azure + data center. + :type country_or_region: str + :param phone: The phone number for the Azure data center. + :type phone: str + :param supported_carriers: A list of carriers that are supported at this location. + :type supported_carriers: list[str] + :param alternate_locations: A list of location IDs that should be used to ship shipping drives + to for jobs created against the current location. If the current location is active, it will be + part of the list. If it is temporarily closed due to maintenance, this list may contain other + locations. + :type alternate_locations: list[str] + """ + + _attribute_map = { + 'recipient_name': {'key': 'recipientName', 'type': 'str'}, + 'street_address1': {'key': 'streetAddress1', 'type': 'str'}, + 'street_address2': {'key': 'streetAddress2', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state_or_province': {'key': 'stateOrProvince', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'country_or_region': {'key': 'countryOrRegion', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'supported_carriers': {'key': 'supportedCarriers', 'type': '[str]'}, + 'alternate_locations': {'key': 'alternateLocations', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(LocationProperties, self).__init__(**kwargs) + self.recipient_name = kwargs.get('recipient_name', None) + self.street_address1 = kwargs.get('street_address1', None) + self.street_address2 = kwargs.get('street_address2', None) + self.city = kwargs.get('city', None) + self.state_or_province = kwargs.get('state_or_province', None) + self.postal_code = kwargs.get('postal_code', None) + self.country_or_region = kwargs.get('country_or_region', None) + self.phone = kwargs.get('phone', None) + self.supported_carriers = kwargs.get('supported_carriers', None) + self.alternate_locations = kwargs.get('alternate_locations', None) + + +class LocationsResponse(msrest.serialization.Model): + """Locations response. + + :param value: locations. + :type value: list[~storage_import_export.models.Location] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Location]'}, + } + + def __init__( + self, + **kwargs + ): + super(LocationsResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class Operation(msrest.serialization.Model): + """Describes a supported operation by the Storage Import/Export job API. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the operation. + :type name: str + :param provider: The resource provider name to which the operation belongs. + :type provider: str + :param resource: The name of the resource to which the operation belongs. + :type resource: str + :param operation: The display name of the operation. + :type operation: str + :param description: Short description of the operation. + :type description: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'provider': {'key': 'display.provider', 'type': 'str'}, + 'resource': {'key': 'display.resource', 'type': 'str'}, + 'operation': {'key': 'display.operation', 'type': 'str'}, + 'description': {'key': 'display.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationDisplay(msrest.serialization.Model): + """operation display properties. + + :param provider: The resource provider name to which the operation belongs. + :type provider: str + :param resource: The name of the resource to which the operation belongs. + :type resource: str + :param operation: The display name of the operation. + :type operation: str + :param description: Short description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class PackageInfomation(msrest.serialization.Model): + """Contains information about the package being shipped by the customer to the Microsoft data center. + + All required parameters must be populated in order to send to Azure. + + :param carrier_name: Required. The name of the carrier that is used to ship the import or + export drives. + :type carrier_name: str + :param tracking_number: Required. The tracking number of the package. + :type tracking_number: str + :param drive_count: Required. The number of drives included in the package. + :type drive_count: int + :param ship_date: Required. The date when the package is shipped. + :type ship_date: str + """ + + _validation = { + 'carrier_name': {'required': True}, + 'tracking_number': {'required': True}, + 'drive_count': {'required': True}, + 'ship_date': {'required': True}, + } + + _attribute_map = { + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'tracking_number': {'key': 'trackingNumber', 'type': 'str'}, + 'drive_count': {'key': 'driveCount', 'type': 'int'}, + 'ship_date': {'key': 'shipDate', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PackageInfomation, self).__init__(**kwargs) + self.carrier_name = kwargs.get('carrier_name', None) + self.tracking_number = kwargs.get('tracking_number', None) + self.drive_count = kwargs.get('drive_count', None) + self.ship_date = kwargs.get('ship_date', None) + + +class PutJobParameters(msrest.serialization.Model): + """Put Job parameters. + + :param location: Specifies the supported Azure location where the job should be created. + :type location: str + :param tags: A set of tags. Specifies the tags that will be assigned to the job. + :type tags: ~storage_import_export.models.PutJobParametersTags + :param storage_account_id: The resource identifier of the storage account where data will be + imported to or exported from. + :type storage_account_id: str + :param job_type: The type of job. + :type job_type: str + :param return_address: Specifies the return address information for the job. + :type return_address: ~storage_import_export.models.ReturnAddress + :param return_shipping: Specifies the return carrier and customer's account with the carrier. + :type return_shipping: ~storage_import_export.models.ReturnShipping + :param shipping_information: Contains information about the Microsoft datacenter to which the + drives should be shipped. + :type shipping_information: ~storage_import_export.models.ShippingInformation + :param delivery_package: Contains information about the package being shipped by the customer + to the Microsoft data center. + :type delivery_package: ~storage_import_export.models.PackageInfomation + :param return_package: Contains information about the package being shipped by the customer to + the Microsoft data center. + :type return_package: ~storage_import_export.models.PackageInfomation + :param diagnostics_path: The virtual blob directory to which the copy logs and backups of drive + manifest files (if enabled) will be stored. + :type diagnostics_path: str + :param log_level: Default value is Error. Indicates whether error logging or verbose logging + will be enabled. + :type log_level: str + :param backup_drive_manifest: Default value is false. Indicates whether the manifest files on + the drives should be copied to block blobs. + :type backup_drive_manifest: bool + :param state: Current state of the job. + :type state: str + :param cancel_requested: Indicates whether a request has been submitted to cancel the job. + :type cancel_requested: bool + :param percent_complete: Overall percentage completed for the job. + :type percent_complete: int + :param incomplete_blob_list_uri: A blob path that points to a block blob containing a list of + blob names that were not exported due to insufficient drive space. If all blobs were exported + successfully, then this element is not included in the response. + :type incomplete_blob_list_uri: str + :param drive_list: List of up to ten drives that comprise the job. The drive list is a required + element for an import job; it is not specified for export jobs. + :type drive_list: list[~storage_import_export.models.DriveStatus] + :param export: A property containing information about the blobs to be exported for an export + job. This property is required for export jobs, but must not be specified for import jobs. + :type export: ~storage_import_export.models.Export + :param provisioning_state: Specifies the provisioning state of the job. + :type provisioning_state: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': 'PutJobParametersTags'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + 'job_type': {'key': 'properties.jobType', 'type': 'str'}, + 'return_address': {'key': 'properties.returnAddress', 'type': 'ReturnAddress'}, + 'return_shipping': {'key': 'properties.returnShipping', 'type': 'ReturnShipping'}, + 'shipping_information': {'key': 'properties.shippingInformation', 'type': 'ShippingInformation'}, + 'delivery_package': {'key': 'properties.deliveryPackage', 'type': 'PackageInfomation'}, + 'return_package': {'key': 'properties.returnPackage', 'type': 'PackageInfomation'}, + 'diagnostics_path': {'key': 'properties.diagnosticsPath', 'type': 'str'}, + 'log_level': {'key': 'properties.logLevel', 'type': 'str'}, + 'backup_drive_manifest': {'key': 'properties.backupDriveManifest', 'type': 'bool'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'cancel_requested': {'key': 'properties.cancelRequested', 'type': 'bool'}, + 'percent_complete': {'key': 'properties.percentComplete', 'type': 'int'}, + 'incomplete_blob_list_uri': {'key': 'properties.incompleteBlobListUri', 'type': 'str'}, + 'drive_list': {'key': 'properties.driveList', 'type': '[DriveStatus]'}, + 'export': {'key': 'properties.export', 'type': 'Export'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PutJobParameters, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.storage_account_id = kwargs.get('storage_account_id', None) + self.job_type = kwargs.get('job_type', None) + self.return_address = kwargs.get('return_address', None) + self.return_shipping = kwargs.get('return_shipping', None) + self.shipping_information = kwargs.get('shipping_information', None) + self.delivery_package = kwargs.get('delivery_package', None) + self.return_package = kwargs.get('return_package', None) + self.diagnostics_path = kwargs.get('diagnostics_path', None) + self.log_level = kwargs.get('log_level', None) + self.backup_drive_manifest = kwargs.get('backup_drive_manifest', None) + self.state = kwargs.get('state', None) + self.cancel_requested = kwargs.get('cancel_requested', None) + self.percent_complete = kwargs.get('percent_complete', None) + self.incomplete_blob_list_uri = kwargs.get('incomplete_blob_list_uri', None) + self.drive_list = kwargs.get('drive_list', None) + self.export = kwargs.get('export', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class PutJobParametersTags(msrest.serialization.Model): + """Specifies the tags that will be assigned to the job. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(PutJobParametersTags, self).__init__(**kwargs) + + +class ReturnAddress(msrest.serialization.Model): + """Specifies the return address information for the job. + + All required parameters must be populated in order to send to Azure. + + :param recipient_name: Required. The name of the recipient who will receive the hard drives + when they are returned. + :type recipient_name: str + :param street_address1: Required. The first line of the street address to use when returning + the drives. + :type street_address1: str + :param street_address2: The first line of the street address to use when returning the drives. + :type street_address2: str + :param city: Required. The city name to use when returning the drives. + :type city: str + :param state_or_province: The state or province to use when returning the drives. + :type state_or_province: str + :param postal_code: Required. The postal code to use when returning the drives. + :type postal_code: str + :param country_or_region: Required. The country or region to use when returning the drives. + :type country_or_region: str + :param phone: Required. Phone number of the recipient of the returned drives. + :type phone: str + :param email: Required. Email address of the recipient of the returned drives. + :type email: str + """ + + _validation = { + 'recipient_name': {'required': True}, + 'street_address1': {'required': True}, + 'city': {'required': True}, + 'postal_code': {'required': True}, + 'country_or_region': {'required': True}, + 'phone': {'required': True}, + 'email': {'required': True}, + } + + _attribute_map = { + 'recipient_name': {'key': 'recipientName', 'type': 'str'}, + 'street_address1': {'key': 'streetAddress1', 'type': 'str'}, + 'street_address2': {'key': 'streetAddress2', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state_or_province': {'key': 'stateOrProvince', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'country_or_region': {'key': 'countryOrRegion', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReturnAddress, self).__init__(**kwargs) + self.recipient_name = kwargs.get('recipient_name', None) + self.street_address1 = kwargs.get('street_address1', None) + self.street_address2 = kwargs.get('street_address2', None) + self.city = kwargs.get('city', None) + self.state_or_province = kwargs.get('state_or_province', None) + self.postal_code = kwargs.get('postal_code', None) + self.country_or_region = kwargs.get('country_or_region', None) + self.phone = kwargs.get('phone', None) + self.email = kwargs.get('email', None) + + +class ReturnShipping(msrest.serialization.Model): + """Specifies the return carrier and customer's account with the carrier. + + All required parameters must be populated in order to send to Azure. + + :param carrier_name: Required. The carrier's name. + :type carrier_name: str + :param carrier_account_number: Required. The customer's account number with the carrier. + :type carrier_account_number: str + """ + + _validation = { + 'carrier_name': {'required': True}, + 'carrier_account_number': {'required': True}, + } + + _attribute_map = { + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'carrier_account_number': {'key': 'carrierAccountNumber', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReturnShipping, self).__init__(**kwargs) + self.carrier_name = kwargs.get('carrier_name', None) + self.carrier_account_number = kwargs.get('carrier_account_number', None) + + +class ShippingInformation(msrest.serialization.Model): + """Contains information about the Microsoft datacenter to which the drives should be shipped. + + All required parameters must be populated in order to send to Azure. + + :param recipient_name: Required. The name of the recipient who will receive the hard drives + when they are returned. + :type recipient_name: str + :param street_address1: Required. The first line of the street address to use when returning + the drives. + :type street_address1: str + :param street_address2: The first line of the street address to use when returning the drives. + :type street_address2: str + :param city: Required. The city name to use when returning the drives. + :type city: str + :param state_or_province: Required. The state or province to use when returning the drives. + :type state_or_province: str + :param postal_code: Required. The postal code to use when returning the drives. + :type postal_code: str + :param country_or_region: Required. The country or region to use when returning the drives. + :type country_or_region: str + :param phone: Phone number of the recipient of the returned drives. + :type phone: str + """ + + _validation = { + 'recipient_name': {'required': True}, + 'street_address1': {'required': True}, + 'city': {'required': True}, + 'state_or_province': {'required': True}, + 'postal_code': {'required': True}, + 'country_or_region': {'required': True}, + } + + _attribute_map = { + 'recipient_name': {'key': 'recipientName', 'type': 'str'}, + 'street_address1': {'key': 'streetAddress1', 'type': 'str'}, + 'street_address2': {'key': 'streetAddress2', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state_or_province': {'key': 'stateOrProvince', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'country_or_region': {'key': 'countryOrRegion', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ShippingInformation, self).__init__(**kwargs) + self.recipient_name = kwargs.get('recipient_name', None) + self.street_address1 = kwargs.get('street_address1', None) + self.street_address2 = kwargs.get('street_address2', None) + self.city = kwargs.get('city', None) + self.state_or_province = kwargs.get('state_or_province', None) + self.postal_code = kwargs.get('postal_code', None) + self.country_or_region = kwargs.get('country_or_region', None) + self.phone = kwargs.get('phone', None) + + +class UpdateJobParameters(msrest.serialization.Model): + """Update Job parameters. + + :param tags: A set of tags. Specifies the tags that will be assigned to the job. + :type tags: ~storage_import_export.models.UpdateJobParametersTags + :param cancel_requested: If specified, the value must be true. The service will attempt to + cancel the job. + :type cancel_requested: bool + :param state: If specified, the value must be Shipping, which tells the Import/Export service + that the package for the job has been shipped. The ReturnAddress and DeliveryPackage properties + must have been set either in this request or in a previous request, otherwise the request will + fail. + :type state: str + :param return_address: Specifies the return address information for the job. + :type return_address: ~storage_import_export.models.ReturnAddress + :param return_shipping: Specifies the return carrier and customer's account with the carrier. + :type return_shipping: ~storage_import_export.models.ReturnShipping + :param delivery_package: Contains information about the package being shipped by the customer + to the Microsoft data center. + :type delivery_package: ~storage_import_export.models.PackageInfomation + :param log_level: Indicates whether error logging or verbose logging is enabled. + :type log_level: str + :param backup_drive_manifest: Indicates whether the manifest files on the drives should be + copied to block blobs. + :type backup_drive_manifest: bool + :param drive_list: List of drives that comprise the job. + :type drive_list: list[~storage_import_export.models.DriveStatus] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': 'UpdateJobParametersTags'}, + 'cancel_requested': {'key': 'properties.cancelRequested', 'type': 'bool'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'return_address': {'key': 'properties.returnAddress', 'type': 'ReturnAddress'}, + 'return_shipping': {'key': 'properties.returnShipping', 'type': 'ReturnShipping'}, + 'delivery_package': {'key': 'properties.deliveryPackage', 'type': 'PackageInfomation'}, + 'log_level': {'key': 'properties.logLevel', 'type': 'str'}, + 'backup_drive_manifest': {'key': 'properties.backupDriveManifest', 'type': 'bool'}, + 'drive_list': {'key': 'properties.driveList', 'type': '[DriveStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateJobParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.cancel_requested = kwargs.get('cancel_requested', None) + self.state = kwargs.get('state', None) + self.return_address = kwargs.get('return_address', None) + self.return_shipping = kwargs.get('return_shipping', None) + self.delivery_package = kwargs.get('delivery_package', None) + self.log_level = kwargs.get('log_level', None) + self.backup_drive_manifest = kwargs.get('backup_drive_manifest', None) + self.drive_list = kwargs.get('drive_list', None) + + +class UpdateJobParametersProperties(msrest.serialization.Model): + """Specifies the properties of a UpdateJob. + + :param cancel_requested: If specified, the value must be true. The service will attempt to + cancel the job. + :type cancel_requested: bool + :param state: If specified, the value must be Shipping, which tells the Import/Export service + that the package for the job has been shipped. The ReturnAddress and DeliveryPackage properties + must have been set either in this request or in a previous request, otherwise the request will + fail. + :type state: str + :param return_address: Specifies the return address information for the job. + :type return_address: ~storage_import_export.models.ReturnAddress + :param return_shipping: Specifies the return carrier and customer's account with the carrier. + :type return_shipping: ~storage_import_export.models.ReturnShipping + :param delivery_package: Contains information about the package being shipped by the customer + to the Microsoft data center. + :type delivery_package: ~storage_import_export.models.PackageInfomation + :param log_level: Indicates whether error logging or verbose logging is enabled. + :type log_level: str + :param backup_drive_manifest: Indicates whether the manifest files on the drives should be + copied to block blobs. + :type backup_drive_manifest: bool + :param drive_list: List of drives that comprise the job. + :type drive_list: list[~storage_import_export.models.DriveStatus] + """ + + _attribute_map = { + 'cancel_requested': {'key': 'cancelRequested', 'type': 'bool'}, + 'state': {'key': 'state', 'type': 'str'}, + 'return_address': {'key': 'returnAddress', 'type': 'ReturnAddress'}, + 'return_shipping': {'key': 'returnShipping', 'type': 'ReturnShipping'}, + 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageInfomation'}, + 'log_level': {'key': 'logLevel', 'type': 'str'}, + 'backup_drive_manifest': {'key': 'backupDriveManifest', 'type': 'bool'}, + 'drive_list': {'key': 'driveList', 'type': '[DriveStatus]'}, + } + + def __init__( + self, + **kwargs + ): + super(UpdateJobParametersProperties, self).__init__(**kwargs) + self.cancel_requested = kwargs.get('cancel_requested', None) + self.state = kwargs.get('state', None) + self.return_address = kwargs.get('return_address', None) + self.return_shipping = kwargs.get('return_shipping', None) + self.delivery_package = kwargs.get('delivery_package', None) + self.log_level = kwargs.get('log_level', None) + self.backup_drive_manifest = kwargs.get('backup_drive_manifest', None) + self.drive_list = kwargs.get('drive_list', None) + + +class UpdateJobParametersTags(msrest.serialization.Model): + """Specifies the tags that will be assigned to the job. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(UpdateJobParametersTags, self).__init__(**kwargs) diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/models/_models_py3.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/models/_models_py3.py new file mode 100644 index 00000000000..2c04169486e --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/models/_models_py3.py @@ -0,0 +1,1349 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class DriveBitLockerKey(msrest.serialization.Model): + """BitLocker recovery key or password to the specified drive. + + :param bit_locker_key: BitLocker recovery key or password. + :type bit_locker_key: str + :param drive_id: Drive ID. + :type drive_id: str + """ + + _attribute_map = { + 'bit_locker_key': {'key': 'bitLockerKey', 'type': 'str'}, + 'drive_id': {'key': 'driveId', 'type': 'str'}, + } + + def __init__( + self, + *, + bit_locker_key: Optional[str] = None, + drive_id: Optional[str] = None, + **kwargs + ): + super(DriveBitLockerKey, self).__init__(**kwargs) + self.bit_locker_key = bit_locker_key + self.drive_id = drive_id + + +class DriveStatus(msrest.serialization.Model): + """Provides information about the drive's status. + + :param drive_id: The drive's hardware serial number, without spaces. + :type drive_id: str + :param bit_locker_key: The BitLocker key used to encrypt the drive. + :type bit_locker_key: str + :param manifest_file: The relative path of the manifest file on the drive. + :type manifest_file: str + :param manifest_hash: The Base16-encoded MD5 hash of the manifest file on the drive. + :type manifest_hash: str + :param drive_header_hash: The drive header hash value. + :type drive_header_hash: str + :param state: The drive's current state. Possible values include: 'Specified', 'Received', + 'NeverReceived', 'Transferring', 'Completed', 'CompletedMoreInfo', 'ShippedBack'. + :type state: str or ~storage_import_export.models.DriveState + :param copy_status: Detailed status about the data transfer process. This field is not returned + in the response until the drive is in the Transferring state. + :type copy_status: str + :param percent_complete: Percentage completed for the drive. + :type percent_complete: int + :param verbose_log_uri: A URI that points to the blob containing the verbose log for the data + transfer operation. + :type verbose_log_uri: str + :param error_log_uri: A URI that points to the blob containing the error log for the data + transfer operation. + :type error_log_uri: str + :param manifest_uri: A URI that points to the blob containing the drive manifest file. + :type manifest_uri: str + :param bytes_succeeded: Bytes successfully transferred for the drive. + :type bytes_succeeded: long + """ + + _attribute_map = { + 'drive_id': {'key': 'driveId', 'type': 'str'}, + 'bit_locker_key': {'key': 'bitLockerKey', 'type': 'str'}, + 'manifest_file': {'key': 'manifestFile', 'type': 'str'}, + 'manifest_hash': {'key': 'manifestHash', 'type': 'str'}, + 'drive_header_hash': {'key': 'driveHeaderHash', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'copy_status': {'key': 'copyStatus', 'type': 'str'}, + 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, + 'verbose_log_uri': {'key': 'verboseLogUri', 'type': 'str'}, + 'error_log_uri': {'key': 'errorLogUri', 'type': 'str'}, + 'manifest_uri': {'key': 'manifestUri', 'type': 'str'}, + 'bytes_succeeded': {'key': 'bytesSucceeded', 'type': 'long'}, + } + + def __init__( + self, + *, + drive_id: Optional[str] = None, + bit_locker_key: Optional[str] = None, + manifest_file: Optional[str] = None, + manifest_hash: Optional[str] = None, + drive_header_hash: Optional[str] = None, + state: Optional[Union[str, "DriveState"]] = None, + copy_status: Optional[str] = None, + percent_complete: Optional[int] = None, + verbose_log_uri: Optional[str] = None, + error_log_uri: Optional[str] = None, + manifest_uri: Optional[str] = None, + bytes_succeeded: Optional[int] = None, + **kwargs + ): + super(DriveStatus, self).__init__(**kwargs) + self.drive_id = drive_id + self.bit_locker_key = bit_locker_key + self.manifest_file = manifest_file + self.manifest_hash = manifest_hash + self.drive_header_hash = drive_header_hash + self.state = state + self.copy_status = copy_status + self.percent_complete = percent_complete + self.verbose_log_uri = verbose_log_uri + self.error_log_uri = error_log_uri + self.manifest_uri = manifest_uri + self.bytes_succeeded = bytes_succeeded + + +class ErrorResponseException(HttpResponseError): + """Server responded with exception of type: 'ErrorResponse'. + + :param response: Server response to be deserialized. + :param error_model: A deserialized model of the response body as model. + """ + + def __init__(self, response, error_model): + self.error = error_model + super(ErrorResponseException, self).__init__(response=response, error_model=error_model) + + @classmethod + def from_response(cls, response, deserialize): + """Deserialize this response as this exception, or a subclass of this exception. + + :param response: Server response to be deserialized. + :param deserialize: A deserializer + """ + model_name = 'ErrorResponse' + error = deserialize(model_name, response) + if error is None: + error = deserialize.dependencies[model_name]() + return error._EXCEPTION_TYPE(response, error) + + +class ErrorResponse(msrest.serialization.Model): + """Response when errors occurred. + + :param code: Provides information about the error code. + :type code: str + :param message: Provides information about the error message. + :type message: str + :param target: Provides information about the error target. + :type target: str + :param details: Describes the error details if present. + :type details: list[~storage_import_export.models.ErrorResponseErrorDetailsItem] + :param innererror: Inner error object if present. + :type innererror: ~storage_import_export.models.ErrorResponseErrorInnererror + """ + _EXCEPTION_TYPE = ErrorResponseException + + _attribute_map = { + 'code': {'key': 'error.code', 'type': 'str'}, + 'message': {'key': 'error.message', 'type': 'str'}, + 'target': {'key': 'error.target', 'type': 'str'}, + 'details': {'key': 'error.details', 'type': '[ErrorResponseErrorDetailsItem]'}, + 'innererror': {'key': 'error.innererror', 'type': 'ErrorResponseErrorInnererror'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["ErrorResponseErrorDetailsItem"]] = None, + innererror: Optional["ErrorResponseErrorInnererror"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.innererror = innererror + + +class ErrorResponseError(msrest.serialization.Model): + """Describes the error information. + + :param code: Provides information about the error code. + :type code: str + :param message: Provides information about the error message. + :type message: str + :param target: Provides information about the error target. + :type target: str + :param details: Describes the error details if present. + :type details: list[~storage_import_export.models.ErrorResponseErrorDetailsItem] + :param innererror: Inner error object if present. + :type innererror: ~storage_import_export.models.ErrorResponseErrorInnererror + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponseErrorDetailsItem]'}, + 'innererror': {'key': 'innererror', 'type': 'ErrorResponseErrorInnererror'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["ErrorResponseErrorDetailsItem"]] = None, + innererror: Optional["ErrorResponseErrorInnererror"] = None, + **kwargs + ): + super(ErrorResponseError, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.innererror = innererror + + +class ErrorResponseErrorDetailsItem(msrest.serialization.Model): + """ErrorResponseErrorDetailsItem. + + :param code: Provides information about the error code. + :type code: str + :param target: Provides information about the error target. + :type target: str + :param message: Provides information about the error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + target: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorResponseErrorDetailsItem, self).__init__(**kwargs) + self.code = code + self.target = target + self.message = message + + +class ErrorResponseErrorInnererror(msrest.serialization.Model): + """Inner error object if present. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseErrorInnererror, self).__init__(**kwargs) + + +class Export(msrest.serialization.Model): + """A property containing information about the blobs to be exported for an export job. This property is required for export jobs, but must not be specified for import jobs. + + :param blob_listblob_path: The relative URI to the block blob that contains the list of blob + paths or blob path prefixes as defined above, beginning with the container name. If the blob is + in root container, the URI must begin with $root. + :type blob_listblob_path: str + :param blob_path: A collection of blob-path strings. + :type blob_path: list[str] + :param blob_path_prefix: A collection of blob-prefix strings. + :type blob_path_prefix: list[str] + """ + + _attribute_map = { + 'blob_listblob_path': {'key': 'blobListblobPath', 'type': 'str'}, + 'blob_path': {'key': 'blobList.blobPath', 'type': '[str]'}, + 'blob_path_prefix': {'key': 'blobList.blobPathPrefix', 'type': '[str]'}, + } + + def __init__( + self, + *, + blob_listblob_path: Optional[str] = None, + blob_path: Optional[List[str]] = None, + blob_path_prefix: Optional[List[str]] = None, + **kwargs + ): + super(Export, self).__init__(**kwargs) + self.blob_listblob_path = blob_listblob_path + self.blob_path = blob_path + self.blob_path_prefix = blob_path_prefix + + +class ExportBlobList(msrest.serialization.Model): + """A list of the blobs to be exported. + + :param blob_path: A collection of blob-path strings. + :type blob_path: list[str] + :param blob_path_prefix: A collection of blob-prefix strings. + :type blob_path_prefix: list[str] + """ + + _attribute_map = { + 'blob_path': {'key': 'blobPath', 'type': '[str]'}, + 'blob_path_prefix': {'key': 'blobPathPrefix', 'type': '[str]'}, + } + + def __init__( + self, + *, + blob_path: Optional[List[str]] = None, + blob_path_prefix: Optional[List[str]] = None, + **kwargs + ): + super(ExportBlobList, self).__init__(**kwargs) + self.blob_path = blob_path + self.blob_path_prefix = blob_path_prefix + + +class GetBitLockerKeysResponse(msrest.serialization.Model): + """GetBitLockerKeys response. + + :param value: drive status. + :type value: list[~storage_import_export.models.DriveBitLockerKey] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DriveBitLockerKey]'}, + } + + def __init__( + self, + *, + value: Optional[List["DriveBitLockerKey"]] = None, + **kwargs + ): + super(GetBitLockerKeysResponse, self).__init__(**kwargs) + self.value = value + + +class JobDetails(msrest.serialization.Model): + """Specifies the job properties. + + :param storage_account_id: The resource identifier of the storage account where data will be + imported to or exported from. + :type storage_account_id: str + :param job_type: The type of job. + :type job_type: str + :param return_address: Specifies the return address information for the job. + :type return_address: ~storage_import_export.models.ReturnAddress + :param return_shipping: Specifies the return carrier and customer's account with the carrier. + :type return_shipping: ~storage_import_export.models.ReturnShipping + :param shipping_information: Contains information about the Microsoft datacenter to which the + drives should be shipped. + :type shipping_information: ~storage_import_export.models.ShippingInformation + :param delivery_package: Contains information about the package being shipped by the customer + to the Microsoft data center. + :type delivery_package: ~storage_import_export.models.PackageInfomation + :param return_package: Contains information about the package being shipped by the customer to + the Microsoft data center. + :type return_package: ~storage_import_export.models.PackageInfomation + :param diagnostics_path: The virtual blob directory to which the copy logs and backups of drive + manifest files (if enabled) will be stored. + :type diagnostics_path: str + :param log_level: Default value is Error. Indicates whether error logging or verbose logging + will be enabled. + :type log_level: str + :param backup_drive_manifest: Default value is false. Indicates whether the manifest files on + the drives should be copied to block blobs. + :type backup_drive_manifest: bool + :param state: Current state of the job. + :type state: str + :param cancel_requested: Indicates whether a request has been submitted to cancel the job. + :type cancel_requested: bool + :param percent_complete: Overall percentage completed for the job. + :type percent_complete: int + :param incomplete_blob_list_uri: A blob path that points to a block blob containing a list of + blob names that were not exported due to insufficient drive space. If all blobs were exported + successfully, then this element is not included in the response. + :type incomplete_blob_list_uri: str + :param drive_list: List of up to ten drives that comprise the job. The drive list is a required + element for an import job; it is not specified for export jobs. + :type drive_list: list[~storage_import_export.models.DriveStatus] + :param export: A property containing information about the blobs to be exported for an export + job. This property is required for export jobs, but must not be specified for import jobs. + :type export: ~storage_import_export.models.Export + :param provisioning_state: Specifies the provisioning state of the job. + :type provisioning_state: str + """ + + _attribute_map = { + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'job_type': {'key': 'jobType', 'type': 'str'}, + 'return_address': {'key': 'returnAddress', 'type': 'ReturnAddress'}, + 'return_shipping': {'key': 'returnShipping', 'type': 'ReturnShipping'}, + 'shipping_information': {'key': 'shippingInformation', 'type': 'ShippingInformation'}, + 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageInfomation'}, + 'return_package': {'key': 'returnPackage', 'type': 'PackageInfomation'}, + 'diagnostics_path': {'key': 'diagnosticsPath', 'type': 'str'}, + 'log_level': {'key': 'logLevel', 'type': 'str'}, + 'backup_drive_manifest': {'key': 'backupDriveManifest', 'type': 'bool'}, + 'state': {'key': 'state', 'type': 'str'}, + 'cancel_requested': {'key': 'cancelRequested', 'type': 'bool'}, + 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, + 'incomplete_blob_list_uri': {'key': 'incompleteBlobListUri', 'type': 'str'}, + 'drive_list': {'key': 'driveList', 'type': '[DriveStatus]'}, + 'export': {'key': 'export', 'type': 'Export'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_account_id: Optional[str] = None, + job_type: Optional[str] = None, + return_address: Optional["ReturnAddress"] = None, + return_shipping: Optional["ReturnShipping"] = None, + shipping_information: Optional["ShippingInformation"] = None, + delivery_package: Optional["PackageInfomation"] = None, + return_package: Optional["PackageInfomation"] = None, + diagnostics_path: Optional[str] = None, + log_level: Optional[str] = None, + backup_drive_manifest: Optional[bool] = None, + state: Optional[str] = None, + cancel_requested: Optional[bool] = None, + percent_complete: Optional[int] = None, + incomplete_blob_list_uri: Optional[str] = None, + drive_list: Optional[List["DriveStatus"]] = None, + export: Optional["Export"] = None, + provisioning_state: Optional[str] = None, + **kwargs + ): + super(JobDetails, self).__init__(**kwargs) + self.storage_account_id = storage_account_id + self.job_type = job_type + self.return_address = return_address + self.return_shipping = return_shipping + self.shipping_information = shipping_information + self.delivery_package = delivery_package + self.return_package = return_package + self.diagnostics_path = diagnostics_path + self.log_level = log_level + self.backup_drive_manifest = backup_drive_manifest + self.state = state + self.cancel_requested = cancel_requested + self.percent_complete = percent_complete + self.incomplete_blob_list_uri = incomplete_blob_list_uri + self.drive_list = drive_list + self.export = export + self.provisioning_state = provisioning_state + + +class JobResponse(msrest.serialization.Model): + """Contains the job information. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Specifies the resource identifier of the job. + :vartype id: str + :ivar name: Specifies the name of the job. + :vartype name: str + :ivar type: Specifies the type of the job resource. + :vartype type: str + :param location: Specifies the Azure location where the job is created. + :type location: str + :param tags: A set of tags. Specifies the tags that are assigned to the job. + :type tags: dict[str, str] + :param properties: Specifies the job properties. + :type properties: ~storage_import_export.models.JobDetails + """ + + _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}'}, + 'properties': {'key': 'properties', 'type': 'JobDetails'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["JobDetails"] = None, + **kwargs + ): + super(JobResponse, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.properties = properties + + +class JobResponseTags(msrest.serialization.Model): + """Specifies the tags that are assigned to the job. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(JobResponseTags, self).__init__(**kwargs) + + +class ListJobsResponse(msrest.serialization.Model): + """List jobs response. + + :param next_link: link to next batch of jobs. + :type next_link: str + :param value: Job list. + :type value: list[~storage_import_export.models.JobResponse] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[JobResponse]'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["JobResponse"]] = None, + **kwargs + ): + super(ListJobsResponse, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class ListOperationsResponse(msrest.serialization.Model): + """List operations response. + + :param value: operations. + :type value: list[~storage_import_export.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + *, + value: Optional[List["Operation"]] = None, + **kwargs + ): + super(ListOperationsResponse, self).__init__(**kwargs) + self.value = value + + +class Location(msrest.serialization.Model): + """Provides information about an Azure data center location. + + :param id: Specifies the resource identifier of the location. + :type id: str + :param name: Specifies the name of the location. Use List Locations to get all supported + locations. + :type name: str + :param type: Specifies the type of the location. + :type type: str + :param recipient_name: The recipient name to use when shipping the drives to the Azure data + center. + :type recipient_name: str + :param street_address1: The first line of the street address to use when shipping the drives to + the Azure data center. + :type street_address1: str + :param street_address2: The first line of the street address to use when shipping the drives to + the Azure data center. + :type street_address2: str + :param city: The city name to use when shipping the drives to the Azure data center. + :type city: str + :param state_or_province: The state or province to use when shipping the drives to the Azure + data center. + :type state_or_province: str + :param postal_code: The postal code to use when shipping the drives to the Azure data center. + :type postal_code: str + :param country_or_region: The country or region to use when shipping the drives to the Azure + data center. + :type country_or_region: str + :param phone: The phone number for the Azure data center. + :type phone: str + :param supported_carriers: A list of carriers that are supported at this location. + :type supported_carriers: list[str] + :param alternate_locations: A list of location IDs that should be used to ship shipping drives + to for jobs created against the current location. If the current location is active, it will be + part of the list. If it is temporarily closed due to maintenance, this list may contain other + locations. + :type alternate_locations: list[str] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'recipient_name': {'key': 'properties.recipientName', 'type': 'str'}, + 'street_address1': {'key': 'properties.streetAddress1', 'type': 'str'}, + 'street_address2': {'key': 'properties.streetAddress2', 'type': 'str'}, + 'city': {'key': 'properties.city', 'type': 'str'}, + 'state_or_province': {'key': 'properties.stateOrProvince', 'type': 'str'}, + 'postal_code': {'key': 'properties.postalCode', 'type': 'str'}, + 'country_or_region': {'key': 'properties.countryOrRegion', 'type': 'str'}, + 'phone': {'key': 'properties.phone', 'type': 'str'}, + 'supported_carriers': {'key': 'properties.supportedCarriers', 'type': '[str]'}, + 'alternate_locations': {'key': 'properties.alternateLocations', 'type': '[str]'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + type: Optional[str] = None, + recipient_name: Optional[str] = None, + street_address1: Optional[str] = None, + street_address2: Optional[str] = None, + city: Optional[str] = None, + state_or_province: Optional[str] = None, + postal_code: Optional[str] = None, + country_or_region: Optional[str] = None, + phone: Optional[str] = None, + supported_carriers: Optional[List[str]] = None, + alternate_locations: Optional[List[str]] = None, + **kwargs + ): + super(Location, self).__init__(**kwargs) + self.id = id + self.name = name + self.type = type + self.recipient_name = recipient_name + self.street_address1 = street_address1 + self.street_address2 = street_address2 + self.city = city + self.state_or_province = state_or_province + self.postal_code = postal_code + self.country_or_region = country_or_region + self.phone = phone + self.supported_carriers = supported_carriers + self.alternate_locations = alternate_locations + + +class LocationProperties(msrest.serialization.Model): + """location properties. + + :param recipient_name: The recipient name to use when shipping the drives to the Azure data + center. + :type recipient_name: str + :param street_address1: The first line of the street address to use when shipping the drives to + the Azure data center. + :type street_address1: str + :param street_address2: The first line of the street address to use when shipping the drives to + the Azure data center. + :type street_address2: str + :param city: The city name to use when shipping the drives to the Azure data center. + :type city: str + :param state_or_province: The state or province to use when shipping the drives to the Azure + data center. + :type state_or_province: str + :param postal_code: The postal code to use when shipping the drives to the Azure data center. + :type postal_code: str + :param country_or_region: The country or region to use when shipping the drives to the Azure + data center. + :type country_or_region: str + :param phone: The phone number for the Azure data center. + :type phone: str + :param supported_carriers: A list of carriers that are supported at this location. + :type supported_carriers: list[str] + :param alternate_locations: A list of location IDs that should be used to ship shipping drives + to for jobs created against the current location. If the current location is active, it will be + part of the list. If it is temporarily closed due to maintenance, this list may contain other + locations. + :type alternate_locations: list[str] + """ + + _attribute_map = { + 'recipient_name': {'key': 'recipientName', 'type': 'str'}, + 'street_address1': {'key': 'streetAddress1', 'type': 'str'}, + 'street_address2': {'key': 'streetAddress2', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state_or_province': {'key': 'stateOrProvince', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'country_or_region': {'key': 'countryOrRegion', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'supported_carriers': {'key': 'supportedCarriers', 'type': '[str]'}, + 'alternate_locations': {'key': 'alternateLocations', 'type': '[str]'}, + } + + def __init__( + self, + *, + recipient_name: Optional[str] = None, + street_address1: Optional[str] = None, + street_address2: Optional[str] = None, + city: Optional[str] = None, + state_or_province: Optional[str] = None, + postal_code: Optional[str] = None, + country_or_region: Optional[str] = None, + phone: Optional[str] = None, + supported_carriers: Optional[List[str]] = None, + alternate_locations: Optional[List[str]] = None, + **kwargs + ): + super(LocationProperties, self).__init__(**kwargs) + self.recipient_name = recipient_name + self.street_address1 = street_address1 + self.street_address2 = street_address2 + self.city = city + self.state_or_province = state_or_province + self.postal_code = postal_code + self.country_or_region = country_or_region + self.phone = phone + self.supported_carriers = supported_carriers + self.alternate_locations = alternate_locations + + +class LocationsResponse(msrest.serialization.Model): + """Locations response. + + :param value: locations. + :type value: list[~storage_import_export.models.Location] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Location]'}, + } + + def __init__( + self, + *, + value: Optional[List["Location"]] = None, + **kwargs + ): + super(LocationsResponse, self).__init__(**kwargs) + self.value = value + + +class Operation(msrest.serialization.Model): + """Describes a supported operation by the Storage Import/Export job API. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the operation. + :type name: str + :param provider: The resource provider name to which the operation belongs. + :type provider: str + :param resource: The name of the resource to which the operation belongs. + :type resource: str + :param operation: The display name of the operation. + :type operation: str + :param description: Short description of the operation. + :type description: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'provider': {'key': 'display.provider', 'type': 'str'}, + 'resource': {'key': 'display.resource', 'type': 'str'}, + 'operation': {'key': 'display.operation', 'type': 'str'}, + 'description': {'key': 'display.description', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationDisplay(msrest.serialization.Model): + """operation display properties. + + :param provider: The resource provider name to which the operation belongs. + :type provider: str + :param resource: The name of the resource to which the operation belongs. + :type resource: str + :param operation: The display name of the operation. + :type operation: str + :param description: Short description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class PackageInfomation(msrest.serialization.Model): + """Contains information about the package being shipped by the customer to the Microsoft data center. + + All required parameters must be populated in order to send to Azure. + + :param carrier_name: Required. The name of the carrier that is used to ship the import or + export drives. + :type carrier_name: str + :param tracking_number: Required. The tracking number of the package. + :type tracking_number: str + :param drive_count: Required. The number of drives included in the package. + :type drive_count: int + :param ship_date: Required. The date when the package is shipped. + :type ship_date: str + """ + + _validation = { + 'carrier_name': {'required': True}, + 'tracking_number': {'required': True}, + 'drive_count': {'required': True}, + 'ship_date': {'required': True}, + } + + _attribute_map = { + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'tracking_number': {'key': 'trackingNumber', 'type': 'str'}, + 'drive_count': {'key': 'driveCount', 'type': 'int'}, + 'ship_date': {'key': 'shipDate', 'type': 'str'}, + } + + def __init__( + self, + *, + carrier_name: str, + tracking_number: str, + drive_count: int, + ship_date: str, + **kwargs + ): + super(PackageInfomation, self).__init__(**kwargs) + self.carrier_name = carrier_name + self.tracking_number = tracking_number + self.drive_count = drive_count + self.ship_date = ship_date + + +class PutJobParameters(msrest.serialization.Model): + """Put Job parameters. + + :param location: Specifies the supported Azure location where the job should be created. + :type location: str + :param tags: A set of tags. Specifies the tags that will be assigned to the job. + :type tags: dict[str, str] + :param storage_account_id: The resource identifier of the storage account where data will be + imported to or exported from. + :type storage_account_id: str + :param job_type: The type of job. + :type job_type: str + :param return_address: Specifies the return address information for the job. + :type return_address: ~storage_import_export.models.ReturnAddress + :param return_shipping: Specifies the return carrier and customer's account with the carrier. + :type return_shipping: ~storage_import_export.models.ReturnShipping + :param shipping_information: Contains information about the Microsoft datacenter to which the + drives should be shipped. + :type shipping_information: ~storage_import_export.models.ShippingInformation + :param delivery_package: Contains information about the package being shipped by the customer + to the Microsoft data center. + :type delivery_package: ~storage_import_export.models.PackageInfomation + :param return_package: Contains information about the package being shipped by the customer to + the Microsoft data center. + :type return_package: ~storage_import_export.models.PackageInfomation + :param diagnostics_path: The virtual blob directory to which the copy logs and backups of drive + manifest files (if enabled) will be stored. + :type diagnostics_path: str + :param log_level: Default value is Error. Indicates whether error logging or verbose logging + will be enabled. + :type log_level: str + :param backup_drive_manifest: Default value is false. Indicates whether the manifest files on + the drives should be copied to block blobs. + :type backup_drive_manifest: bool + :param state: Current state of the job. + :type state: str + :param cancel_requested: Indicates whether a request has been submitted to cancel the job. + :type cancel_requested: bool + :param percent_complete: Overall percentage completed for the job. + :type percent_complete: int + :param incomplete_blob_list_uri: A blob path that points to a block blob containing a list of + blob names that were not exported due to insufficient drive space. If all blobs were exported + successfully, then this element is not included in the response. + :type incomplete_blob_list_uri: str + :param drive_list: List of up to ten drives that comprise the job. The drive list is a required + element for an import job; it is not specified for export jobs. + :type drive_list: list[~storage_import_export.models.DriveStatus] + :param export: A property containing information about the blobs to be exported for an export + job. This property is required for export jobs, but must not be specified for import jobs. + :type export: ~storage_import_export.models.Export + :param provisioning_state: Specifies the provisioning state of the job. + :type provisioning_state: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + 'job_type': {'key': 'properties.jobType', 'type': 'str'}, + 'return_address': {'key': 'properties.returnAddress', 'type': 'ReturnAddress'}, + 'return_shipping': {'key': 'properties.returnShipping', 'type': 'ReturnShipping'}, + 'shipping_information': {'key': 'properties.shippingInformation', 'type': 'ShippingInformation'}, + 'delivery_package': {'key': 'properties.deliveryPackage', 'type': 'PackageInfomation'}, + 'return_package': {'key': 'properties.returnPackage', 'type': 'PackageInfomation'}, + 'diagnostics_path': {'key': 'properties.diagnosticsPath', 'type': 'str'}, + 'log_level': {'key': 'properties.logLevel', 'type': 'str'}, + 'backup_drive_manifest': {'key': 'properties.backupDriveManifest', 'type': 'bool'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'cancel_requested': {'key': 'properties.cancelRequested', 'type': 'bool'}, + 'percent_complete': {'key': 'properties.percentComplete', 'type': 'int'}, + 'incomplete_blob_list_uri': {'key': 'properties.incompleteBlobListUri', 'type': 'str'}, + 'drive_list': {'key': 'properties.driveList', 'type': '[DriveStatus]'}, + 'export': {'key': 'properties.export', 'type': 'Export'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + storage_account_id: Optional[str] = None, + job_type: Optional[str] = None, + return_address: Optional["ReturnAddress"] = None, + return_shipping: Optional["ReturnShipping"] = None, + shipping_information: Optional["ShippingInformation"] = None, + delivery_package: Optional["PackageInfomation"] = None, + return_package: Optional["PackageInfomation"] = None, + diagnostics_path: Optional[str] = None, + log_level: Optional[str] = None, + backup_drive_manifest: Optional[bool] = None, + state: Optional[str] = None, + cancel_requested: Optional[bool] = None, + percent_complete: Optional[int] = None, + incomplete_blob_list_uri: Optional[str] = None, + drive_list: Optional[List["DriveStatus"]] = None, + export: Optional["Export"] = None, + provisioning_state: Optional[str] = None, + **kwargs + ): + super(PutJobParameters, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.storage_account_id = storage_account_id + self.job_type = job_type + self.return_address = return_address + self.return_shipping = return_shipping + self.shipping_information = shipping_information + self.delivery_package = delivery_package + self.return_package = return_package + self.diagnostics_path = diagnostics_path + self.log_level = log_level + self.backup_drive_manifest = backup_drive_manifest + self.state = state + self.cancel_requested = cancel_requested + self.percent_complete = percent_complete + self.incomplete_blob_list_uri = incomplete_blob_list_uri + self.drive_list = drive_list + self.export = export + self.provisioning_state = provisioning_state + + +class PutJobParametersTags(msrest.serialization.Model): + """Specifies the tags that will be assigned to the job. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(PutJobParametersTags, self).__init__(**kwargs) + + +class ReturnAddress(msrest.serialization.Model): + """Specifies the return address information for the job. + + All required parameters must be populated in order to send to Azure. + + :param recipient_name: Required. The name of the recipient who will receive the hard drives + when they are returned. + :type recipient_name: str + :param street_address1: Required. The first line of the street address to use when returning + the drives. + :type street_address1: str + :param street_address2: The first line of the street address to use when returning the drives. + :type street_address2: str + :param city: Required. The city name to use when returning the drives. + :type city: str + :param state_or_province: The state or province to use when returning the drives. + :type state_or_province: str + :param postal_code: Required. The postal code to use when returning the drives. + :type postal_code: str + :param country_or_region: Required. The country or region to use when returning the drives. + :type country_or_region: str + :param phone: Required. Phone number of the recipient of the returned drives. + :type phone: str + :param email: Required. Email address of the recipient of the returned drives. + :type email: str + """ + + _validation = { + 'recipient_name': {'required': True}, + 'street_address1': {'required': True}, + 'city': {'required': True}, + 'postal_code': {'required': True}, + 'country_or_region': {'required': True}, + 'phone': {'required': True}, + 'email': {'required': True}, + } + + _attribute_map = { + 'recipient_name': {'key': 'recipientName', 'type': 'str'}, + 'street_address1': {'key': 'streetAddress1', 'type': 'str'}, + 'street_address2': {'key': 'streetAddress2', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state_or_province': {'key': 'stateOrProvince', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'country_or_region': {'key': 'countryOrRegion', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + } + + def __init__( + self, + *, + recipient_name: str, + street_address1: str, + city: str, + postal_code: str, + country_or_region: str, + phone: str, + email: str, + street_address2: Optional[str] = None, + state_or_province: Optional[str] = None, + **kwargs + ): + super(ReturnAddress, self).__init__(**kwargs) + self.recipient_name = recipient_name + self.street_address1 = street_address1 + self.street_address2 = street_address2 + self.city = city + self.state_or_province = state_or_province + self.postal_code = postal_code + self.country_or_region = country_or_region + self.phone = phone + self.email = email + + +class ReturnShipping(msrest.serialization.Model): + """Specifies the return carrier and customer's account with the carrier. + + All required parameters must be populated in order to send to Azure. + + :param carrier_name: Required. The carrier's name. + :type carrier_name: str + :param carrier_account_number: Required. The customer's account number with the carrier. + :type carrier_account_number: str + """ + + _validation = { + 'carrier_name': {'required': True}, + 'carrier_account_number': {'required': True}, + } + + _attribute_map = { + 'carrier_name': {'key': 'carrierName', 'type': 'str'}, + 'carrier_account_number': {'key': 'carrierAccountNumber', 'type': 'str'}, + } + + def __init__( + self, + *, + carrier_name: str, + carrier_account_number: str, + **kwargs + ): + super(ReturnShipping, self).__init__(**kwargs) + self.carrier_name = carrier_name + self.carrier_account_number = carrier_account_number + + +class ShippingInformation(msrest.serialization.Model): + """Contains information about the Microsoft datacenter to which the drives should be shipped. + + All required parameters must be populated in order to send to Azure. + + :param recipient_name: Required. The name of the recipient who will receive the hard drives + when they are returned. + :type recipient_name: str + :param street_address1: Required. The first line of the street address to use when returning + the drives. + :type street_address1: str + :param street_address2: The first line of the street address to use when returning the drives. + :type street_address2: str + :param city: Required. The city name to use when returning the drives. + :type city: str + :param state_or_province: Required. The state or province to use when returning the drives. + :type state_or_province: str + :param postal_code: Required. The postal code to use when returning the drives. + :type postal_code: str + :param country_or_region: Required. The country or region to use when returning the drives. + :type country_or_region: str + :param phone: Phone number of the recipient of the returned drives. + :type phone: str + """ + + _validation = { + 'recipient_name': {'required': True}, + 'street_address1': {'required': True}, + 'city': {'required': True}, + 'state_or_province': {'required': True}, + 'postal_code': {'required': True}, + 'country_or_region': {'required': True}, + } + + _attribute_map = { + 'recipient_name': {'key': 'recipientName', 'type': 'str'}, + 'street_address1': {'key': 'streetAddress1', 'type': 'str'}, + 'street_address2': {'key': 'streetAddress2', 'type': 'str'}, + 'city': {'key': 'city', 'type': 'str'}, + 'state_or_province': {'key': 'stateOrProvince', 'type': 'str'}, + 'postal_code': {'key': 'postalCode', 'type': 'str'}, + 'country_or_region': {'key': 'countryOrRegion', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__( + self, + *, + recipient_name: str, + street_address1: str, + city: str, + state_or_province: str, + postal_code: str, + country_or_region: str, + street_address2: Optional[str] = None, + phone: Optional[str] = None, + **kwargs + ): + super(ShippingInformation, self).__init__(**kwargs) + self.recipient_name = recipient_name + self.street_address1 = street_address1 + self.street_address2 = street_address2 + self.city = city + self.state_or_province = state_or_province + self.postal_code = postal_code + self.country_or_region = country_or_region + self.phone = phone + + +class UpdateJobParameters(msrest.serialization.Model): + """Update Job parameters. + + :param tags: A set of tags. Specifies the tags that will be assigned to the job. + :type tags: dict[str, str] + :param cancel_requested: If specified, the value must be true. The service will attempt to + cancel the job. + :type cancel_requested: bool + :param state: If specified, the value must be Shipping, which tells the Import/Export service + that the package for the job has been shipped. The ReturnAddress and DeliveryPackage properties + must have been set either in this request or in a previous request, otherwise the request will + fail. + :type state: str + :param return_address: Specifies the return address information for the job. + :type return_address: ~storage_import_export.models.ReturnAddress + :param return_shipping: Specifies the return carrier and customer's account with the carrier. + :type return_shipping: ~storage_import_export.models.ReturnShipping + :param delivery_package: Contains information about the package being shipped by the customer + to the Microsoft data center. + :type delivery_package: ~storage_import_export.models.PackageInfomation + :param log_level: Indicates whether error logging or verbose logging is enabled. + :type log_level: str + :param backup_drive_manifest: Indicates whether the manifest files on the drives should be + copied to block blobs. + :type backup_drive_manifest: bool + :param drive_list: List of drives that comprise the job. + :type drive_list: list[~storage_import_export.models.DriveStatus] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'cancel_requested': {'key': 'properties.cancelRequested', 'type': 'bool'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'return_address': {'key': 'properties.returnAddress', 'type': 'ReturnAddress'}, + 'return_shipping': {'key': 'properties.returnShipping', 'type': 'ReturnShipping'}, + 'delivery_package': {'key': 'properties.deliveryPackage', 'type': 'PackageInfomation'}, + 'log_level': {'key': 'properties.logLevel', 'type': 'str'}, + 'backup_drive_manifest': {'key': 'properties.backupDriveManifest', 'type': 'bool'}, + 'drive_list': {'key': 'properties.driveList', 'type': '[DriveStatus]'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + cancel_requested: Optional[bool] = None, + state: Optional[str] = None, + return_address: Optional["ReturnAddress"] = None, + return_shipping: Optional["ReturnShipping"] = None, + delivery_package: Optional["PackageInfomation"] = None, + log_level: Optional[str] = None, + backup_drive_manifest: Optional[bool] = None, + drive_list: Optional[List["DriveStatus"]] = None, + **kwargs + ): + super(UpdateJobParameters, self).__init__(**kwargs) + self.tags = tags + self.cancel_requested = cancel_requested + self.state = state + self.return_address = return_address + self.return_shipping = return_shipping + self.delivery_package = delivery_package + self.log_level = log_level + self.backup_drive_manifest = backup_drive_manifest + self.drive_list = drive_list + + +class UpdateJobParametersProperties(msrest.serialization.Model): + """Specifies the properties of a UpdateJob. + + :param cancel_requested: If specified, the value must be true. The service will attempt to + cancel the job. + :type cancel_requested: bool + :param state: If specified, the value must be Shipping, which tells the Import/Export service + that the package for the job has been shipped. The ReturnAddress and DeliveryPackage properties + must have been set either in this request or in a previous request, otherwise the request will + fail. + :type state: str + :param return_address: Specifies the return address information for the job. + :type return_address: ~storage_import_export.models.ReturnAddress + :param return_shipping: Specifies the return carrier and customer's account with the carrier. + :type return_shipping: ~storage_import_export.models.ReturnShipping + :param delivery_package: Contains information about the package being shipped by the customer + to the Microsoft data center. + :type delivery_package: ~storage_import_export.models.PackageInfomation + :param log_level: Indicates whether error logging or verbose logging is enabled. + :type log_level: str + :param backup_drive_manifest: Indicates whether the manifest files on the drives should be + copied to block blobs. + :type backup_drive_manifest: bool + :param drive_list: List of drives that comprise the job. + :type drive_list: list[~storage_import_export.models.DriveStatus] + """ + + _attribute_map = { + 'cancel_requested': {'key': 'cancelRequested', 'type': 'bool'}, + 'state': {'key': 'state', 'type': 'str'}, + 'return_address': {'key': 'returnAddress', 'type': 'ReturnAddress'}, + 'return_shipping': {'key': 'returnShipping', 'type': 'ReturnShipping'}, + 'delivery_package': {'key': 'deliveryPackage', 'type': 'PackageInfomation'}, + 'log_level': {'key': 'logLevel', 'type': 'str'}, + 'backup_drive_manifest': {'key': 'backupDriveManifest', 'type': 'bool'}, + 'drive_list': {'key': 'driveList', 'type': '[DriveStatus]'}, + } + + def __init__( + self, + *, + cancel_requested: Optional[bool] = None, + state: Optional[str] = None, + return_address: Optional["ReturnAddress"] = None, + return_shipping: Optional["ReturnShipping"] = None, + delivery_package: Optional["PackageInfomation"] = None, + log_level: Optional[str] = None, + backup_drive_manifest: Optional[bool] = None, + drive_list: Optional[List["DriveStatus"]] = None, + **kwargs + ): + super(UpdateJobParametersProperties, self).__init__(**kwargs) + self.cancel_requested = cancel_requested + self.state = state + self.return_address = return_address + self.return_shipping = return_shipping + self.delivery_package = delivery_package + self.log_level = log_level + self.backup_drive_manifest = backup_drive_manifest + self.drive_list = drive_list + + +class UpdateJobParametersTags(msrest.serialization.Model): + """Specifies the tags that will be assigned to the job. + + """ + + _attribute_map = { + } + + def __init__( + self, + **kwargs + ): + super(UpdateJobParametersTags, self).__init__(**kwargs) diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/models/_storage_import_export_enums.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/models/_storage_import_export_enums.py new file mode 100644 index 00000000000..15d2d4f7186 --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/models/_storage_import_export_enums.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 enum import Enum + +class DriveState(str, Enum): + + specified = "Specified" + received = "Received" + never_received = "NeverReceived" + transferring = "Transferring" + completed = "Completed" + completed_more_info = "CompletedMoreInfo" + shipped_back = "ShippedBack" diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/operations/__init__.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/operations/__init__.py new file mode 100644 index 00000000000..199c96e7a99 --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/operations/__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 ._location_operations import LocationOperations +from ._job_operations import JobOperations +from ._bit_locker_key_operations import BitLockerKeyOperations +from ._operation_operations import OperationOperations + +__all__ = [ + 'LocationOperations', + 'JobOperations', + 'BitLockerKeyOperations', + 'OperationOperations', +] diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/operations/_bit_locker_key_operations.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/operations/_bit_locker_key_operations.py new file mode 100644 index 00000000000..900125234da --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/operations/_bit_locker_key_operations.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BitLockerKeyOperations(object): + """BitLockerKeyOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~storage_import_export.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + job_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.GetBitLockerKeysResponse" + """Returns the BitLocker Keys for all drives in the specified job. + + :param job_name: The name of the import/export job. + :type job_name: str + :param resource_group_name: The resource group name uniquely identifies the resource group + within the user subscription. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetBitLockerKeysResponse or the result of cls(response) + :rtype: ~storage_import_export.models.GetBitLockerKeysResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.GetBitLockerKeysResponse"] + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('GetBitLockerKeysResponse', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}/listBitLockerKeys'} diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/operations/_job_operations.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/operations/_job_operations.py new file mode 100644 index 00000000000..a9654641626 --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/operations/_job_operations.py @@ -0,0 +1,555 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class JobOperations(object): + """JobOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~storage_import_export.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + top=None, # type: Optional[int] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.ListJobsResponse" + """Returns all active and completed jobs in a subscription. + + :param top: An integer value that specifies how many jobs at most should be returned. The value + cannot exceed 100. + :type top: int + :param filter: Can be used to restrict the results to certain conditions. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListJobsResponse or the result of cls(response) + :rtype: ~storage_import_export.models.ListJobsResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.ListJobsResponse"] + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + def prepare_request(next_link=None): + if not next_link: + # 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 = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListJobsResponse', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ImportExport/jobs'} + + def list_by_resource_group( + self, + resource_group_name, # type: str + top=None, # type: Optional[int] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.ListJobsResponse" + """Returns all active and completed jobs in a resource group. + + :param resource_group_name: The resource group name uniquely identifies the resource group + within the user subscription. + :type resource_group_name: str + :param top: An integer value that specifies how many jobs at most should be returned. The value + cannot exceed 100. + :type top: int + :param filter: Can be used to restrict the results to certain conditions. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListJobsResponse or the result of cls(response) + :rtype: ~storage_import_export.models.ListJobsResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.ListJobsResponse"] + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + def prepare_request(next_link=None): + if not next_link: + # 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'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListJobsResponse', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs'} + + def get( + self, + job_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.JobResponse" + """Gets information about an existing job. + + :param job_name: The name of the import/export job. + :type job_name: str + :param resource_group_name: The resource group name uniquely identifies the resource group + within the user subscription. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResponse or the result of cls(response) + :rtype: ~storage_import_export.models.JobResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.JobResponse"] + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + deserialized = self._deserialize('JobResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'} + + def update( + self, + job_name, # type: str + resource_group_name, # type: str + tags=None, # type: Optional["models.UpdateJobParametersTags"] + cancel_requested=None, # type: Optional[bool] + state=None, # type: Optional[str] + return_address=None, # type: Optional["models.ReturnAddress"] + return_shipping=None, # type: Optional["models.ReturnShipping"] + delivery_package=None, # type: Optional["models.PackageInfomation"] + log_level=None, # type: Optional[str] + backup_drive_manifest=None, # type: Optional[bool] + drive_list=None, # type: Optional[List["DriveStatus"]] + **kwargs # type: Any + ): + # type: (...) -> "models.JobResponse" + """Updates specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing job. + + :param job_name: The name of the import/export job. + :type job_name: str + :param resource_group_name: The resource group name uniquely identifies the resource group + within the user subscription. + :type resource_group_name: str + :param tags: Specifies the tags that will be assigned to the job. + :type tags: ~storage_import_export.models.UpdateJobParametersTags + :param cancel_requested: If specified, the value must be true. The service will attempt to + cancel the job. + :type cancel_requested: bool + :param state: If specified, the value must be Shipping, which tells the Import/Export service + that the package for the job has been shipped. The ReturnAddress and DeliveryPackage properties + must have been set either in this request or in a previous request, otherwise the request will + fail. + :type state: str + :param return_address: Specifies the return address information for the job. + :type return_address: ~storage_import_export.models.ReturnAddress + :param return_shipping: Specifies the return carrier and customer's account with the carrier. + :type return_shipping: ~storage_import_export.models.ReturnShipping + :param delivery_package: Contains information about the package being shipped by the customer + to the Microsoft data center. + :type delivery_package: ~storage_import_export.models.PackageInfomation + :param log_level: Indicates whether error logging or verbose logging is enabled. + :type log_level: str + :param backup_drive_manifest: Indicates whether the manifest files on the drives should be + copied to block blobs. + :type backup_drive_manifest: bool + :param drive_list: List of drives that comprise the job. + :type drive_list: list[~storage_import_export.models.DriveStatus] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResponse or the result of cls(response) + :rtype: ~storage_import_export.models.JobResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.JobResponse"] + error_map = kwargs.pop('error_map', {}) + + body = models.UpdateJobParameters(tags=tags, cancel_requested=cancel_requested, state=state, return_address=return_address, return_shipping=return_shipping, delivery_package=delivery_package, log_level=log_level, backup_drive_manifest=backup_drive_manifest, drive_list=drive_list) + api_version = "2016-11-01" + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(body, 'UpdateJobParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + deserialized = self._deserialize('JobResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'} + + def create( + self, + job_name, # type: str + resource_group_name, # type: str + client_tenant_id=None, # type: Optional[str] + location=None, # type: Optional[str] + tags=None, # type: Optional["models.PutJobParametersTags"] + storage_account_id=None, # type: Optional[str] + job_type=None, # type: Optional[str] + return_address=None, # type: Optional["models.ReturnAddress"] + return_shipping=None, # type: Optional["models.ReturnShipping"] + shipping_information=None, # type: Optional["models.ShippingInformation"] + delivery_package=None, # type: Optional["models.PackageInfomation"] + return_package=None, # type: Optional["models.PackageInfomation"] + diagnostics_path=None, # type: Optional[str] + log_level=None, # type: Optional[str] + backup_drive_manifest=None, # type: Optional[bool] + state=None, # type: Optional[str] + cancel_requested=None, # type: Optional[bool] + percent_complete=None, # type: Optional[int] + incomplete_blob_list_uri=None, # type: Optional[str] + drive_list=None, # type: Optional[List["DriveStatus"]] + export=None, # type: Optional["models.Export"] + provisioning_state=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.JobResponse" + """Creates a new job or updates an existing job in the specified subscription. + + :param job_name: The name of the import/export job. + :type job_name: str + :param resource_group_name: The resource group name uniquely identifies the resource group + within the user subscription. + :type resource_group_name: str + :param client_tenant_id: The tenant ID of the client making the request. + :type client_tenant_id: str + :param location: Specifies the supported Azure location where the job should be created. + :type location: str + :param tags: Specifies the tags that will be assigned to the job. + :type tags: ~storage_import_export.models.PutJobParametersTags + :param storage_account_id: The resource identifier of the storage account where data will be + imported to or exported from. + :type storage_account_id: str + :param job_type: The type of job. + :type job_type: str + :param return_address: Specifies the return address information for the job. + :type return_address: ~storage_import_export.models.ReturnAddress + :param return_shipping: Specifies the return carrier and customer's account with the carrier. + :type return_shipping: ~storage_import_export.models.ReturnShipping + :param shipping_information: Contains information about the Microsoft datacenter to which the + drives should be shipped. + :type shipping_information: ~storage_import_export.models.ShippingInformation + :param delivery_package: Contains information about the package being shipped by the customer + to the Microsoft data center. + :type delivery_package: ~storage_import_export.models.PackageInfomation + :param return_package: Contains information about the package being shipped by the customer to + the Microsoft data center. + :type return_package: ~storage_import_export.models.PackageInfomation + :param diagnostics_path: The virtual blob directory to which the copy logs and backups of drive + manifest files (if enabled) will be stored. + :type diagnostics_path: str + :param log_level: Default value is Error. Indicates whether error logging or verbose logging + will be enabled. + :type log_level: str + :param backup_drive_manifest: Default value is false. Indicates whether the manifest files on + the drives should be copied to block blobs. + :type backup_drive_manifest: bool + :param state: Current state of the job. + :type state: str + :param cancel_requested: Indicates whether a request has been submitted to cancel the job. + :type cancel_requested: bool + :param percent_complete: Overall percentage completed for the job. + :type percent_complete: int + :param incomplete_blob_list_uri: A blob path that points to a block blob containing a list of + blob names that were not exported due to insufficient drive space. If all blobs were exported + successfully, then this element is not included in the response. + :type incomplete_blob_list_uri: str + :param drive_list: List of up to ten drives that comprise the job. The drive list is a required + element for an import job; it is not specified for export jobs. + :type drive_list: list[~storage_import_export.models.DriveStatus] + :param export: A property containing information about the blobs to be exported for an export + job. This property is required for export jobs, but must not be specified for import jobs. + :type export: ~storage_import_export.models.Export + :param provisioning_state: Specifies the provisioning state of the job. + :type provisioning_state: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobResponse or JobResponse or the result of cls(response) + :rtype: ~storage_import_export.models.JobResponse or ~storage_import_export.models.JobResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.JobResponse"] + error_map = kwargs.pop('error_map', {}) + + body = models.PutJobParameters(location=location, tags=tags, storage_account_id=storage_account_id, job_type=job_type, return_address=return_address, return_shipping=return_shipping, shipping_information=shipping_information, delivery_package=delivery_package, return_package=return_package, diagnostics_path=diagnostics_path, log_level=log_level, backup_drive_manifest=backup_drive_manifest, state=state, cancel_requested=cancel_requested, percent_complete=percent_complete, incomplete_blob_list_uri=incomplete_blob_list_uri, drive_list=drive_list, export=export, provisioning_state=provisioning_state) + api_version = "2016-11-01" + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + if client_tenant_id is not None: + header_parameters['x-ms-client-tenant-id'] = self._serialize.header("client_tenant_id", client_tenant_id, 'str') + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(body, 'PutJobParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('JobResponse', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('JobResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'} + + def delete( + self, + job_name, # type: str + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an existing job. Only jobs in the Creating or Completed states can be deleted. + + :param job_name: The name of the import/export job. + :type job_name: str + :param resource_group_name: The resource group name uniquely identifies the resource group + within the user subscription. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'jobName': self._serialize.url("job_name", job_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'} diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/operations/_location_operations.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/operations/_location_operations.py new file mode 100644 index 00000000000..746c1301657 --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/operations/_location_operations.py @@ -0,0 +1,154 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LocationOperations(object): + """LocationOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~storage_import_export.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.LocationsResponse" + """Returns a list of locations to which you can ship the disks associated with an import or export job. A location is a Microsoft data center region. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LocationsResponse or the result of cls(response) + :rtype: ~storage_import_export.models.LocationsResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.LocationsResponse"] + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('LocationsResponse', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.ImportExport/locations'} + + def get( + self, + location_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Location" + """Returns the details about a location to which you can ship the disks associated with an import or export job. A location is an Azure region. + + :param location_name: The name of the location. For example, West US or westus. + :type location_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Location or the result of cls(response) + :rtype: ~storage_import_export.models.Location + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.Location"] + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'locationName': self._serialize.url("location_name", location_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + deserialized = self._deserialize('Location', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/providers/Microsoft.ImportExport/locations/{locationName}'} diff --git a/src/import-export/azext_import_export/vendored_sdks/storageimportexport/operations/_operation_operations.py b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/operations/_operation_operations.py new file mode 100644 index 00000000000..f93c99d47c8 --- /dev/null +++ b/src/import-export/azext_import_export/vendored_sdks/storageimportexport/operations/_operation_operations.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations(object): + """OperationOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~storage_import_export.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.ListOperationsResponse" + """Returns the list of operations supported by the import/export resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListOperationsResponse or the result of cls(response) + :rtype: ~storage_import_export.models.ListOperationsResponse + :raises: ~storage_import_export.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.ListOperationsResponse"] + error_map = kwargs.pop('error_map', {}) + api_version = "2016-11-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + if self._config.acceptlanguage is not None: + header_parameters['Accept-Language'] = self._serialize.header("self._config.acceptlanguage", self._config.acceptlanguage, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListOperationsResponse', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.ImportExport/operations'} diff --git a/src/import-export/setup.cfg b/src/import-export/setup.cfg new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/import-export/setup.py b/src/import-export/setup.py new file mode 100644 index 00000000000..ee52331e233 --- /dev/null +++ b/src/import-export/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.1' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +# 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='import_export', + version=VERSION, + description='Microsoft Azure Command-Line Tools StorageImportExport 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_import_export': ['azext_metadata.json']}, +) diff --git a/src/index.json b/src/index.json index 7b363957e6b..25dc65fdbcf 100644 --- a/src/index.json +++ b/src/index.json @@ -578,6 +578,92 @@ "version": "0.4.43" }, "sha256Digest": "d351dc69bac520400beffaa571dccdd1fd37534c28309fa703ae59802d25cad5" + }, + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/aks_preview-0.4.44-py2.py3-none-any.whl", + "filename": "aks_preview-0.4.44-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.49", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions/tree/master/src/aks-preview" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "aks-preview", + "summary": "Provides a preview for upcoming AKS features", + "version": "0.4.44" + }, + "sha256Digest": "544d8dbab694fd5a2e04a1cac310e36881682e309c5df772f037451e3d7da51c" + }, + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/aks_preview-0.4.45-py2.py3-none-any.whl", + "filename": "aks_preview-0.4.45-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.49", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions/tree/master/src/aks-preview" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "aks-preview", + "summary": "Provides a preview for upcoming AKS features", + "version": "0.4.45" + }, + "sha256Digest": "78b8536cf5b4349d47a3d1742d36514f99780ef8eff31336d8cb5dfc2e5c6080" } ], "alertsmanagement": [ @@ -919,6 +1005,51 @@ "version": "0.1.6" }, "sha256Digest": "271db7f2036eb245d3d00d5010468330e4ed97e7ed9756598e61a1960d37ac44" + }, + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/application_insights-0.1.7-py2.py3-none-any.whl", + "filename": "application_insights-0.1.7-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.79", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "aleldeib@microsoft.com", + "name": "Ace Eldeib", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions/tree/master/src/application-insights" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "application-insights", + "summary": "Support for managing Application Insights components and querying metrics, events, and logs from such components.", + "version": "0.1.7" + }, + "sha256Digest": "6cb8c879d0960e6f41e1273c309253d7d7ca42089694fcf5e500d0a27ae89b59" } ], "azure-batch-cli-extensions": [ @@ -1212,8 +1343,8 @@ ], "azure-cli-ml": [ { - "downloadUrl": "https://azurecliext.blob.core.windows.net/release/azure_cli_ml-1.3.0-py2.py3-none-any.whl", - "filename": "azure_cli_ml-1.3.0-py2.py3-none-any.whl", + "downloadUrl": "https://azurecliext.blob.core.windows.net/release/azure_cli_ml-1.5.0-py2.py3-none-any.whl", + "filename": "azure_cli_ml-1.5.0-py2.py3-none-any.whl", "metadata": { "azext.minCliCoreVersion": "2.0.28", "classifiers": [ @@ -1254,7 +1385,7 @@ { "requires": [ "adal (>=1.2.1)", - "azureml-cli-common (~=1.3.0)", + "azureml-cli-common (~=1.5.0)", "docker (>=3.7.2)", "msrest (>=0.6.6)", "pyyaml (>=5.1.0)", @@ -1273,9 +1404,9 @@ ] } ], - "version": "1.3.0" + "version": "1.5.0" }, - "sha256Digest": "964d9affffb281101bf5b9e3838e4ee2839a818581d00fa7610e764d3b3ea4d4" + "sha256Digest": "a535f01501a06f70d26a75f5ccde2d32640d3c7efec302fc2fc454bfb867e946" } ], "azure-devops": [ @@ -1669,8 +1800,8 @@ ], "azure-iot": [ { - "downloadUrl": "https://github.com/Azure/azure-iot-cli-extension/releases/download/v0.9.1/azure_iot-0.9.1-py2.py3-none-any.whl", - "filename": "azure_iot-0.9.1-py2.py3-none-any.whl", + "downloadUrl": "https://github.com/Azure/azure-iot-cli-extension/releases/download/v0.9.2/azure_iot-0.9.2-py2.py3-none-any.whl", + "filename": "azure_iot-0.9.2-py2.py3-none-any.whl", "metadata": { "azext.minCliCoreVersion": "2.0.70", "classifiers": [ @@ -1678,10 +1809,7 @@ "Intended Audience :: Developers", "Intended Audience :: System Administrators", "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", @@ -1720,9 +1848,9 @@ } ], "summary": "The Azure IoT extension for Azure CLI.", - "version": "0.9.1" + "version": "0.9.2" }, - "sha256Digest": "97e5ddd2ddef1ec829e112bc5e6d46ec34df930b528fdf591c6201f7d89b9119" + "sha256Digest": "1eabba803d443fc922733c239101ab0aa50c614cb819572ef96cb4c973bbb698" } ], "blueprint": [ @@ -1770,6 +1898,112 @@ "sha256Digest": "98c1874110e2c77c62cf0d180133ea0b29ed08a86189ee292b909369597e694b" } ], + "connectedk8s": [ + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/connectedk8s-0.1.5-py3-none-any.whl", + "filename": "connectedk8s-0.1.5-py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.67", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "k8connect@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "extras": [], + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "connectedk8s", + "run_requires": [ + { + "requires": [ + "kubernetes", + "pycryptodome" + ] + } + ], + "summary": "Microsoft Azure Command-Line Tools Connectedk8s Extension", + "version": "0.1.5" + }, + "sha256Digest": "1b529c1fedb5db9dee3dc877ca036f5373d307ca8a07c278d07126531b1c55b6" + }, + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/connectedk8s-0.2.0-py3-none-any.whl", + "filename": "connectedk8s-0.2.0-py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.67", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "k8connect@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "extras": [], + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "connectedk8s", + "run_requires": [ + { + "requires": [ + "kubernetes", + "pycryptodome" + ] + } + ], + "summary": "Microsoft Azure Command-Line Tools Connectedk8s Extension", + "version": "0.2.0" + }, + "sha256Digest": "d306355d5568f9f5b201db9f5bda28fc0b142c6b70164a87bf56974239749ebd" + } + ], "connectedmachine": [ { "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/connectedmachine-0.1.1-py2.py3-none-any.whl", @@ -1841,7 +2075,7 @@ ], "csvmware": [ { - "downloadUrl": "https://github.com/Azure/az-vmware-cli/releases/download/0.3.0/csvmware-0.3.0-py2.py3-none-any.whl", + "downloadUrl": "https://github.com/Azure/az-csvmware-cli/releases/download/0.3.0/csvmware-0.3.0-py2.py3-none-any.whl", "filename": "csvmware-0.3.0-py2.py3-none-any.whl", "metadata": { "azext.isPreview": true, @@ -1886,6 +2120,51 @@ "sha256Digest": "dfb9767f05ac13c762ea9dc4327169e63a5c11879123544b200edb9a2c9a8a42" } ], + "custom-providers": [ + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/custom_providers-0.1.0-py2.py3-none-any.whl", + "filename": "custom_providers-0.1.0-py2.py3-none-any.whl", + "metadata": { + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1", + "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" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "custom-providers", + "summary": "Microsoft Azure Command-Line Tools Custom Providers Extension", + "version": "0.1.0" + }, + "sha256Digest": "7da462aaa336184b53d7b0b831c0fa77c4239dabe4e70fa4e500e250cf11a8ec" + } + ], "databox": [ { "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/databox-0.1.0-py2.py3-none-any.whl", @@ -2021,14 +2300,59 @@ "sha256Digest": "229272c5b6abcfc37abe86600db356c54ef664b6681b2f8b705aa50be472b1bc" } ], - "db-up": [ + "datashare": [ { - "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/db_up-0.1.13-py2.py3-none-any.whl", - "filename": "db_up-0.1.13-py2.py3-none-any.whl", + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/datashare-0.1.0-py3-none-any.whl", + "filename": "datashare-0.1.0-py3-none-any.whl", "metadata": { - "azext.isPreview": true, - "azext.minCliCoreVersion": "2.0.46", - "classifiers": [ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "datashare", + "summary": "Microsoft Azure Command-Line Tools DataShareManagementClient Extension", + "version": "0.1.0" + }, + "sha256Digest": "803c3637f752b0fb77eb5272a544abafe44942ff920a020ff7ea179ace329342" + } + ], + "db-up": [ + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/db_up-0.1.13-py2.py3-none-any.whl", + "filename": "db_up-0.1.13-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.46", + "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: System Administrators", @@ -2971,6 +3295,136 @@ "version": "0.2.3" }, "sha256Digest": "8a88c2600f9dad5f38ca6128ab8efaa38a974fbb7fe8c875fc50b7bb7d37bd54" + }, + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/image_copy_extension-0.2.4-py2.py3-none-any.whl", + "filename": "image_copy_extension-0.2.4-py2.py3-none-any.whl", + "metadata": { + "azext.minCliCoreVersion": "2.0.24", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "tamir.kamara@microsoft.com", + "name": "Tamir Kamara", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "image-copy-extension", + "summary": "Support for copying managed vm images between regions", + "version": "0.2.4" + }, + "sha256Digest": "174e2437b20a979257a93017209ba1ff5d1969ea1eca7f3cbe57e8d11c75f4f4" + } + ], + "import-export": [ + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/import_export-0.1.0-py3-none-any.whl", + "filename": "import_export-0.1.0-py3-none-any.whl", + "metadata": { + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "import-export", + "summary": "Microsoft Azure Command-Line Tools StorageImportExport Extension", + "version": "0.1.0" + }, + "sha256Digest": "6a5a1a1a23c7ff90e01b1f0a33d04874d750845e6cda56badce4ce99a518ef55" + }, + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/import_export-0.1.1-py3-none-any.whl", + "filename": "import_export-0.1.1-py3-none-any.whl", + "metadata": { + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "import-export", + "summary": "Microsoft Azure Command-Line Tools StorageImportExport Extension", + "version": "0.1.1" + }, + "sha256Digest": "0680948362e12138c9582e68e471533482749bd660bfe3c8c2a4d856e90927b0" } ], "interactive": [ @@ -3174,31 +3628,30 @@ "sha256Digest": "477d7f58fe44a4ecb0ced3497262d7ccd8bb7677d70582b6fccf645e91d25ad4" } ], - "keyvault-preview": [ + "k8sconfiguration": [ { - "downloadUrl": "https://github.com/Azure/azure-keyvault-cli-extension/releases/download/keyvault-preview_0.1.3/keyvault_preview-0.1.3-py2.py3-none-any.whl", - "filename": "keyvault_preview-0.1.3-py2.py3-none-any.whl", + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/k8sconfiguration-0.1.7-py2.py3-none-any.whl", + "filename": "k8sconfiguration-0.1.7-py2.py3-none-any.whl", "metadata": { "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.67", "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", "License :: OSI Approved :: MIT License" ], "extensions": { "python.details": { "contacts": [ { - "email": "azurekeyvault@microsoft.com", - "name": "Azure Key Vault", + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", "role": "author" } ], @@ -3206,32 +3659,42 @@ "description": "DESCRIPTION.rst" }, "project_urls": { - "Home": "https://github.com/Azure/azure-keyvault-cli-extension" + "Home": "https://github.com/Azure/azure-cli-extensions" } } }, "generator": "bdist_wheel (0.30.0)", "license": "MIT", "metadata_version": "2.0", - "name": "keyvault-preview", - "summary": "Preview Azure Key Vault commands.", - "version": "0.1.3" + "name": "k8sconfiguration", + "summary": "Microsoft Azure Command-Line Tools K8sconfiguration Extension", + "version": "0.1.7" }, - "sha256Digest": "5d80ceaac45576bfd9cb7f2bd5714183d9f88711b4aa415940b4b393a7591069" - } - ], - "log-analytics": [ + "sha256Digest": "6440f1f1bebda0b3288ab95654a107e3f803d1ad2a23276cd5e27abe6a71dd60" + }, { - "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/log_analytics-0.1.4-py2.py3-none-any.whl", - "filename": "log_analytics-0.1.4-py2.py3-none-any.whl", + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/k8sconfiguration-0.1.8-py2.py3-none-any.whl", + "filename": "k8sconfiguration-0.1.8-py2.py3-none-any.whl", "metadata": { "azext.isPreview": true, + "azext.minCliCoreVersion": "2.3.1", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], "extensions": { "python.details": { "contacts": [ { - "email": "aleldeib@microsoft.com", - "name": "Ace Eldeib", + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", "role": "author" } ], @@ -3239,26 +3702,26 @@ "description": "DESCRIPTION.rst" }, "project_urls": { - "Home": "https://github.com/Azure/azure-cli-extensions/tree/master/src/log-analytics" + "Home": "https://github.com/Azure/azure-cli-extensions" } } }, "generator": "bdist_wheel (0.30.0)", "license": "MIT", "metadata_version": "2.0", - "name": "log-analytics", - "summary": "Support for Azure Log Analytics query capabilities.", - "version": "0.1.4" + "name": "k8sconfiguration", + "summary": "Microsoft Azure Command-Line Tools K8sconfiguration Extension", + "version": "0.1.8" }, - "sha256Digest": "6f4789fff8581a52e13bcf8f13fdc16b47662fac69e1fc3ea49280de1a8e65bc" + "sha256Digest": "9d4b9d9dfcd8793297af670de10254804f5ce6d1bac6b0ad8e872cc5fdc5f761" } ], - "maintenance": [ + "keyvault-preview": [ { - "downloadUrl": "https://mrpcliextensionrelease.blob.core.windows.net/cliextension/maintenance-1.0.1-py2.py3-none-any.whl", - "filename": "maintenance-1.0.1-py2.py3-none-any.whl", + "downloadUrl": "https://github.com/Azure/azure-keyvault-cli-extension/releases/download/keyvault-preview_0.1.3/keyvault_preview-0.1.3-py2.py3-none-any.whl", + "filename": "keyvault_preview-0.1.3-py2.py3-none-any.whl", "metadata": { - "azext.minCliCoreVersion": "2.0.47", + "azext.isPreview": true, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", @@ -3276,8 +3739,8 @@ "python.details": { "contacts": [ { - "email": "abkmr@microsoft.com", - "name": "Abhishek Kumar", + "email": "azurekeyvault@microsoft.com", + "name": "Azure Key Vault", "role": "author" } ], @@ -3285,44 +3748,44 @@ "description": "DESCRIPTION.rst" }, "project_urls": { - "Home": "https://github.com/Azure/azure-cli-extensions" + "Home": "https://github.com/Azure/azure-keyvault-cli-extension" } } }, "generator": "bdist_wheel (0.30.0)", "license": "MIT", "metadata_version": "2.0", - "name": "maintenance", - "summary": "Support for Azure maintenance management.", - "version": "1.0.1" + "name": "keyvault-preview", + "summary": "Preview Azure Key Vault commands.", + "version": "0.1.3" }, - "sha256Digest": "3e0fb5392bd29e53e7afde543d1a0ef5d33a6032f01322fd75b7afe7016c34fc" + "sha256Digest": "5d80ceaac45576bfd9cb7f2bd5714183d9f88711b4aa415940b4b393a7591069" } ], - "managementpartner": [ + "kusto": [ { - "downloadUrl": "https://files.pythonhosted.org/packages/28/08/0fde582cf50eaf1ef304b35674b9b22f6731d95b2e41339eba4d35583b18/managementpartner-0.1.2-py2.py3-none-any.whl", - "filename": "managementpartner-0.1.2-py2.py3-none-any.whl", + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/kusto-0.1.0-py3-none-any.whl", + "filename": "kusto-0.1.0-py3-none-any.whl", "metadata": { + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1", "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", "License :: OSI Approved :: MIT License" ], "extensions": { "python.details": { "contacts": [ { - "email": "jefl@microsoft.com", - "name": "Jeffrey Li", + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", "role": "author" } ], @@ -3334,20 +3797,234 @@ } } }, - "generator": "bdist_wheel (0.29.0)", + "generator": "bdist_wheel (0.30.0)", "license": "MIT", "metadata_version": "2.0", - "name": "managementpartner", - "summary": "Support for Management Partner preview", - "version": "0.1.2" + "name": "kusto", + "summary": "Microsoft Azure Command-Line Tools KustoManagementClient Extension", + "version": "0.1.0" }, - "sha256Digest": "f7ec0984b4d5a4c9192aa3ab6b78c867fc38cf620effef1804d89c9d1d9f204f" + "sha256Digest": "ffa47cb6f8f850e75412dffa6a5e52f857d5e7ca217322ce176eea81d24768e8" } ], - "mesh": [ + "log-analytics": [ { - "downloadUrl": "https://meshcli.blob.core.windows.net/cli/mesh-0.10.6-py2.py3-none-any.whl", - "filename": "mesh-0.10.6-py2.py3-none-any.whl", + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/log_analytics-0.1.4-py2.py3-none-any.whl", + "filename": "log_analytics-0.1.4-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "extensions": { + "python.details": { + "contacts": [ + { + "email": "aleldeib@microsoft.com", + "name": "Ace Eldeib", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions/tree/master/src/log-analytics" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "log-analytics", + "summary": "Support for Azure Log Analytics query capabilities.", + "version": "0.1.4" + }, + "sha256Digest": "6f4789fff8581a52e13bcf8f13fdc16b47662fac69e1fc3ea49280de1a8e65bc" + } + ], + "log-analytics-solution": [ + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/log_analytics_solution-0.1.0-py2.py3-none-any.whl", + "filename": "log_analytics_solution-0.1.0-py2.py3-none-any.whl", + "metadata": { + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.0", + "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" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "log-analytics-solution", + "summary": "Microsoft Azure Command-Line Tools Operations Extension", + "version": "0.1.0" + }, + "sha256Digest": "844bf0a063b4e244bfe14e215c82d7d70327540b7bf446b7cb1d97ebb8a98119" + } + ], + "logic": [ + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/logic-0.1.0-py3-none-any.whl", + "filename": "logic-0.1.0-py3-none-any.whl", + "metadata": { + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "logic", + "summary": "Microsoft Azure Command-Line Tools LogicManagementClient Extension", + "version": "0.1.0" + }, + "sha256Digest": "b02dea64e03adb7cf17a7afafc28844949c0f3a030f4eb005059452f0ac68040" + } + ], + "maintenance": [ + { + "downloadUrl": "https://mrpcliextensionrelease.blob.core.windows.net/cliextension/maintenance-1.0.1-py2.py3-none-any.whl", + "filename": "maintenance-1.0.1-py2.py3-none-any.whl", + "metadata": { + "azext.minCliCoreVersion": "2.0.47", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "abkmr@microsoft.com", + "name": "Abhishek Kumar", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "maintenance", + "summary": "Support for Azure maintenance management.", + "version": "1.0.1" + }, + "sha256Digest": "3e0fb5392bd29e53e7afde543d1a0ef5d33a6032f01322fd75b7afe7016c34fc" + } + ], + "managementpartner": [ + { + "downloadUrl": "https://files.pythonhosted.org/packages/28/08/0fde582cf50eaf1ef304b35674b9b22f6731d95b2e41339eba4d35583b18/managementpartner-0.1.2-py2.py3-none-any.whl", + "filename": "managementpartner-0.1.2-py2.py3-none-any.whl", + "metadata": { + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "jefl@microsoft.com", + "name": "Jeffrey Li", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.29.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "managementpartner", + "summary": "Support for Management Partner preview", + "version": "0.1.2" + }, + "sha256Digest": "f7ec0984b4d5a4c9192aa3ab6b78c867fc38cf620effef1804d89c9d1d9f204f" + } + ], + "mesh": [ + { + "downloadUrl": "https://meshcli.blob.core.windows.net/cli/mesh-0.10.6-py2.py3-none-any.whl", + "filename": "mesh-0.10.6-py2.py3-none-any.whl", "metadata": { "azext.isPreview": true, "azext.minCliCoreVersion": "2.0.67", @@ -3597,6 +4274,94 @@ "sha256Digest": "1b73d60427e5e84971e244a5884b7f14e0e05e65792e9ecc7483695d1b596992" } ], + "portal": [ + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/portal-0.1.0-py3-none-any.whl", + "filename": "portal-0.1.0-py3-none-any.whl", + "metadata": { + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "portal", + "summary": "Microsoft Azure Command-Line Tools Portal Extension", + "version": "0.1.0" + }, + "sha256Digest": "89fdc138db22055fc09cf30a46050205a9e842d8fe386a3d8773ea563b074083" + }, + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/portal-0.1.1-py3-none-any.whl", + "filename": "portal-0.1.1-py3-none-any.whl", + "metadata": { + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "portal", + "summary": "Microsoft Azure Command-Line Tools Portal Extension", + "version": "0.1.1" + }, + "sha256Digest": "a3fc71fd6f0390850a60947cc1bff31d6346fc3f79e3ac8947add577c10c31a3" + } + ], "powerbidedicated": [ { "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/powerbidedicated-0.1.1-py2.py3-none-any.whl", @@ -3782,8 +4547,8 @@ ], "sap-hana": [ { - "downloadUrl": "https://github.com/Azure/azure-hanaonazure-cli-extension/releases/download/0.5.9/sap_hana-0.5.9-py2.py3-none-any.whl", - "filename": "sap_hana-0.5.9-py2.py3-none-any.whl", + "downloadUrl": "https://github.com/Azure/azure-hanaonazure-cli-extension/releases/download/0.6.1/sap_hana-0.6.1-py2.py3-none-any.whl", + "filename": "sap_hana-0.6.1-py2.py3-none-any.whl", "metadata": { "azext.minCliCoreVersion": "2.0.46", "classifiers": [ @@ -3821,9 +4586,9 @@ "metadata_version": "2.0", "name": "sap-hana", "summary": "Additional commands for working with SAP HanaOnAzure instances.", - "version": "0.5.9" + "version": "0.6.1" }, - "sha256Digest": "ad15a6c99fcb631c08c4b6b7c95d3520ee21e02164822a1272dac448350173cf" + "sha256Digest": "c94ae024e88ccf2c42c1d2f73f4295adeea567078be6eb51f892e9f982487bf0" } ], "spring-cloud": [ @@ -3869,17 +4634,160 @@ "metadata_version": "2.0", "name": "spring-cloud", "summary": "Microsoft Azure Command-Line Tools spring-cloud Extension", - "version": "0.1.0" + "version": "0.1.0" + }, + "sha256Digest": "1042caa1c3b6c85c2e5360bf57de4d26f71afd80ecae6b14cf45fbfe73b5cf0e" + }, + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/spring_cloud-0.1.1-py2.py3-none-any.whl", + "filename": "spring_cloud-0.1.1-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.maxCliCoreVersion": "2.1.0", + "azext.minCliCoreVersion": "2.0.67", + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "spring-cloud", + "summary": "Microsoft Azure Command-Line Tools spring-cloud Extension", + "version": "0.1.1" + }, + "sha256Digest": "f42d8c99ace9b4df29eea79ac7a588b1fcaecd381b1a80c7dbdd920756f8d209" + }, + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/spring_cloud-0.2.0-py2.py3-none-any.whl", + "filename": "spring_cloud-0.2.0-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.maxCliCoreVersion": "2.1.0", + "azext.minCliCoreVersion": "2.0.67", + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "spring-cloud", + "summary": "Microsoft Azure Command-Line Tools spring-cloud Extension", + "version": "0.2.0" + }, + "sha256Digest": "b39aa8c49b316b1870e79db0526be2db772b179f9f517f72af898d9c3cc3310d" + }, + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/spring_cloud-0.2.1-py2.py3-none-any.whl", + "filename": "spring_cloud-0.2.1-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.maxCliCoreVersion": "2.1.0", + "azext.minCliCoreVersion": "2.0.67", + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "spring-cloud", + "summary": "Microsoft Azure Command-Line Tools spring-cloud Extension", + "version": "0.2.1" + }, + "sha256Digest": "dfb974346cf9f62d8f9564756d6661cd758904d1e7035ca61c7227d6b0fc6cf1" + }, + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/spring_cloud-0.2.2-py2.py3-none-any.whl", + "filename": "spring_cloud-0.2.2-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.67", + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "spring-cloud", + "summary": "Microsoft Azure Command-Line Tools spring-cloud Extension", + "version": "0.2.2" }, - "sha256Digest": "1042caa1c3b6c85c2e5360bf57de4d26f71afd80ecae6b14cf45fbfe73b5cf0e" + "sha256Digest": "ab81ea74ecb86edaa1b4e5938e1136dbf6788b237b141c5905b121646edd9f5b" }, { - "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/spring_cloud-0.1.1-py2.py3-none-any.whl", - "filename": "spring_cloud-0.1.1-py2.py3-none-any.whl", + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/spring_cloud-0.2.3-py2.py3-none-any.whl", + "filename": "spring_cloud-0.2.3-py2.py3-none-any.whl", "metadata": { "azext.isPreview": true, - "azext.maxCliCoreVersion": "2.1.0", "azext.minCliCoreVersion": "2.0.67", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "License :: OSI Approved :: MIT License" + ], "extensions": { "python.details": { "contacts": [ @@ -3902,17 +4810,31 @@ "metadata_version": "2.0", "name": "spring-cloud", "summary": "Microsoft Azure Command-Line Tools spring-cloud Extension", - "version": "0.1.1" + "version": "0.2.3" }, - "sha256Digest": "f42d8c99ace9b4df29eea79ac7a588b1fcaecd381b1a80c7dbdd920756f8d209" - }, + "sha256Digest": "c4af1e193256ae2b04fc9c46a414c3203944b458b2a8959654c55450ec9ea76d" + } + ], + "storage-or-preview": [ { - "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/spring_cloud-0.2.0-py2.py3-none-any.whl", - "filename": "spring_cloud-0.2.0-py2.py3-none-any.whl", + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/storage_or_preview-0.4.0-py2.py3-none-any.whl", + "filename": "storage_or_preview-0.4.0-py2.py3-none-any.whl", "metadata": { "azext.isPreview": true, - "azext.maxCliCoreVersion": "2.1.0", "azext.minCliCoreVersion": "2.0.67", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "License :: OSI Approved :: MIT License" + ], "extensions": { "python.details": { "contacts": [ @@ -3933,19 +4855,31 @@ "generator": "bdist_wheel (0.30.0)", "license": "MIT", "metadata_version": "2.0", - "name": "spring-cloud", - "summary": "Microsoft Azure Command-Line Tools spring-cloud Extension", - "version": "0.2.0" + "name": "storage-or-preview", + "summary": "Microsoft Azure Command-Line Tools Storage-ors-preview Extension", + "version": "0.4.0" }, - "sha256Digest": "b39aa8c49b316b1870e79db0526be2db772b179f9f517f72af898d9c3cc3310d" - }, + "sha256Digest": "29abde58f44f084cd9e8491c3124392bf4436895f428246e3f42c7cd76691b7e" + } + ], + "storage-ors-preview": [ { - "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/spring_cloud-0.2.1-py2.py3-none-any.whl", - "filename": "spring_cloud-0.2.1-py2.py3-none-any.whl", + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/storage_ors_preview-0.3.0-py2.py3-none-any.whl", + "filename": "storage_ors_preview-0.3.0-py2.py3-none-any.whl", "metadata": { - "azext.isPreview": true, - "azext.maxCliCoreVersion": "2.1.0", - "azext.minCliCoreVersion": "2.0.67", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "License :: OSI Approved :: MIT License" + ], "extensions": { "python.details": { "contacts": [ @@ -3966,18 +4900,31 @@ "generator": "bdist_wheel (0.30.0)", "license": "MIT", "metadata_version": "2.0", - "name": "spring-cloud", - "summary": "Microsoft Azure Command-Line Tools spring-cloud Extension", - "version": "0.2.1" + "name": "storage-ors-preview", + "summary": "Microsoft Azure Command-Line Tools Storage-ors-preview Extension", + "version": "0.3.0" }, - "sha256Digest": "dfb974346cf9f62d8f9564756d6661cd758904d1e7035ca61c7227d6b0fc6cf1" + "sha256Digest": "149d1303defc18e198c98da6351d2d389ebdfc3543e28816f04dac2d5f7f53fa" }, { - "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/spring_cloud-0.2.2-py2.py3-none-any.whl", - "filename": "spring_cloud-0.2.2-py2.py3-none-any.whl", + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/storage_ors_preview-0.3.1-py2.py3-none-any.whl", + "filename": "storage_ors_preview-0.3.1-py2.py3-none-any.whl", "metadata": { "azext.isPreview": true, "azext.minCliCoreVersion": "2.0.67", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "License :: OSI Approved :: MIT License" + ], "extensions": { "python.details": { "contacts": [ @@ -3998,11 +4945,11 @@ "generator": "bdist_wheel (0.30.0)", "license": "MIT", "metadata_version": "2.0", - "name": "spring-cloud", - "summary": "Microsoft Azure Command-Line Tools spring-cloud Extension", - "version": "0.2.2" + "name": "storage-ors-preview", + "summary": "Microsoft Azure Command-Line Tools Storage-ors-preview Extension", + "version": "0.3.1" }, - "sha256Digest": "ab81ea74ecb86edaa1b4e5938e1136dbf6788b237b141c5905b121646edd9f5b" + "sha256Digest": "d790044844482abcb21a7cfa8b7b90137681eec2e70c98c245ed0b0c0a8f7fcf" } ], "storage-preview": [ @@ -4402,6 +5349,51 @@ "version": "1.0.1" }, "sha256Digest": "5490c5dbe52b0457b51a327426cad741005f8afc24c13cefefb9fe8694a558f7" + }, + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/support-1.0.2-py2.py3-none-any.whl", + "filename": "support-1.0.2-py2.py3-none-any.whl", + "metadata": { + "azext.isPreview": false, + "azext.minCliCoreVersion": "2.0.81", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/azure/azure-cli-extensions/tree/master/src/support" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "support", + "summary": "Microsoft Azure Command-Line Tools Support Extension", + "version": "1.0.2" + }, + "sha256Digest": "815e9ed05789f4cd00eb00cbae0e6339e7519c0c6d816bf3aa302af534acef5b" } ], "synapse": [ @@ -4451,6 +5443,92 @@ "sha256Digest": "bdeb2f4830fc35ff15b4ec473927619ed6a5ab46e4c797f2cb7605e59a32aa36" } ], + "timeseriesinsights": [ + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/timeseriesinsights-0.1.0-py3-none-any.whl", + "filename": "timeseriesinsights-0.1.0-py3-none-any.whl", + "metadata": { + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions/src/timeseriesinsights" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "timeseriesinsights", + "summary": "Microsoft Azure Command-Line Tools TimeSeriesInsightsClient Extension", + "version": "0.1.0" + }, + "sha256Digest": "a1cd9f9177ff31010638048d3737dc39fac144d9ca107fe4eafc4339386d71cd" + }, + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/timeseriesinsights-0.1.1-py3-none-any.whl", + "filename": "timeseriesinsights-0.1.1-py3-none-any.whl", + "metadata": { + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1", + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "azpycli@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions/src/timeseriesinsights" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "timeseriesinsights", + "summary": "Microsoft Azure Command-Line Tools TimeSeriesInsightsClient Extension", + "version": "0.1.1" + }, + "sha256Digest": "3276b876cad87ef8b29e6af58294fc7ff20b9d2d0187ce84e2b15ba8917b00d9" + } + ], "virtual-network-tap": [ { "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/virtual_network_tap-0.1.0-py2.py3-none-any.whl", @@ -4633,12 +5711,55 @@ "version": "0.2.6" }, "sha256Digest": "3556adeb1053262aa1aa0203b53423252afbd89b3e455255c2a2964a3be9a78e" + }, + { + "downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/vm_repair-0.2.7-py2.py3-none-any.whl", + "filename": "vm_repair-0.2.7-py2.py3-none-any.whl", + "metadata": { + "classifiers": [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "License :: OSI Approved :: MIT License" + ], + "extensions": { + "python.details": { + "contacts": [ + { + "email": "caiddev@microsoft.com", + "name": "Microsoft Corporation", + "role": "author" + } + ], + "document_names": { + "description": "DESCRIPTION.rst" + }, + "project_urls": { + "Home": "https://github.com/Azure/azure-cli-extensions/tree/master/src/vm-repair" + } + } + }, + "generator": "bdist_wheel (0.30.0)", + "license": "MIT", + "metadata_version": "2.0", + "name": "vm-repair", + "summary": "Auto repair commands to fix VMs.", + "version": "0.2.7" + }, + "sha256Digest": "4949871a99d5ef62ffdad72d35bfa75a483f1a714bf8d7ca84f134f86a5e9578" } ], "vmware": [ { - "downloadUrl": "https://github.com/virtustream/azure-vmware-virtustream-cli-extension/releases/download/0.5.5/vmware-0.5.5-py2.py3-none-any.whl", - "filename": "vmware-0.5.5-py2.py3-none-any.whl", + "downloadUrl": "https://github.com/virtustream/az-vmware-cli/releases/download/0.6.0/vmware-0.6.0-py2.py3-none-any.whl", + "filename": "vmware-0.6.0-py2.py3-none-any.whl", "metadata": { "azext.isPreview": true, "azext.minCliCoreVersion": "2.0.66", @@ -4646,8 +5767,8 @@ "python.details": { "contacts": [ { - "email": "azpycli@virtustream.com", - "name": "Virtustream", + "email": "azpycli@microsoft.com", + "name": "Microsoft", "role": "author" } ], @@ -4663,10 +5784,10 @@ "license": "MIT", "metadata_version": "2.0", "name": "vmware", - "summary": "Preview Azure VMware Solution by Virtustream commands.", - "version": "0.5.5" + "summary": "Preview Azure VMware Solution commands.", + "version": "0.6.0" }, - "sha256Digest": "89c5c09ee859b4b03c57cf2d2c477054aef97a5cca6f9a67da8a19d792572b02" + "sha256Digest": "517b737a0f812ae8520297836c16318d7d04357002e578e49befb7e5974d0d79" } ], "webapp": [ diff --git a/src/k8sconfiguration/HISTORY.rst b/src/k8sconfiguration/HISTORY.rst new file mode 100644 index 00000000000..f4ccafdcc4c --- /dev/null +++ b/src/k8sconfiguration/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.7 +++++++ +* Initial release (for Public Preview) \ No newline at end of file diff --git a/src/k8sconfiguration/README.rst b/src/k8sconfiguration/README.rst new file mode 100644 index 00000000000..8bdd3fb3e12 --- /dev/null +++ b/src/k8sconfiguration/README.rst @@ -0,0 +1,74 @@ +Microsoft Azure CLI 'k8sconfiguration' Extension +========================================== + +This package is for the 'k8sconfiguration' extension. +i.e. 'az k8sconfiguration' + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name k8sconfiguration +``` + +### Included Features +#### Kubernetes Configuration: +Kubernetes SourceControl Configuration: [more info](https://docs.microsoft.com/en-us/azure/kubernetessconfiguration/)\ +*Examples:* + +##### Create a KubernetesConfiguration +``` +az k8sconfiguration create \ + --resource-group groupName \ + --cluster-name clusterName \ + --cluster-type clusterType \ + --name configurationName \ + --operator-instance-name operatorInstanceName \ + --operator-namespace operatorNamespace \ + --repository-url githubRepoUrl \ + --operator-params operatorParameters \ + --enable-helm-operator \ + --helm-operator-version chartVersion \ + --helm-operator-params chartParameters +``` + +##### Get a KubernetesConfiguration +``` +az k8sconfiguration show \ + --resource-group groupName \ + --cluster-name clusterName \ + --cluster-type clusterType \ + --name configurationName +``` + +##### Delete a KubernetesConfiguration +``` +az k8sconfiguration delete \ + --resource-group groupName \ + --cluster-name clusterName \ + --cluster-type clusterType \ + --name configurationName +``` + +##### Update a KubernetesConfiguration +``` +az k8sconfiguration create \ + --resource-group groupName \ + --cluster-name clusterName \ + --cluster-type clusterType \ + --name configurationName \ + --repository-url githubRepoUrl \ + --operator-params operatorParameters \ + --enable-helm-operator \ + --helm-operator-version chartVersion \ + --helm-operator-params chartParameters +``` + +##### List all KubernetesConfigurations of a cluster +``` +az k8sconfiguration list \ + --resource-group groupName \ + --cluster-name clusterName \ + --cluster-type clusterType +``` + +If you have issues, please give feedback by opening an issue at https://github.com/Azure/azure-cli-extensions/issues. \ No newline at end of file diff --git a/src/k8sconfiguration/azext_k8sconfiguration/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/__init__.py new file mode 100644 index 00000000000..993cec81f44 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/__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_k8sconfiguration._help import helps # pylint: disable=unused-import + + +class K8sconfigurationCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_k8sconfiguration._client_factory import cf_k8sconfiguration + k8sconfiguration_custom = CliCommandType( + operations_tmpl='azext_k8sconfiguration.custom#{}', + client_factory=cf_k8sconfiguration) + super(K8sconfigurationCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=k8sconfiguration_custom) + + def load_command_table(self, args): + from azext_k8sconfiguration.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_k8sconfiguration._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = K8sconfigurationCommandsLoader diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_client_factory.py b/src/k8sconfiguration/azext_k8sconfiguration/_client_factory.py new file mode 100644 index 00000000000..f853563686b --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/_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_k8sconfiguration(cli_ctx, *_): + + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azext_k8sconfiguration.vendored_sdks import SourceControlConfigurationClient + return get_mgmt_service_client(cli_ctx, SourceControlConfigurationClient) + + +def cf_k8sconfiguration_operation(cli_ctx, _): + return cf_k8sconfiguration(cli_ctx).source_control_configurations diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_help.py b/src/k8sconfiguration/azext_k8sconfiguration/_help.py new file mode 100644 index 00000000000..0ed38a02f2a --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/_help.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.help_files import helps # pylint: disable=unused-import + + +helps['k8sconfiguration'] = """ + type: group + short-summary: Commands to manage Kubernetes configuration. +""" + +helps['k8sconfiguration create'] = """ + type: command + short-summary: Create a Kubernetes configuration. + examples: + - name: Create a Kubernetes configuration + text: |- + az k8sconfiguration create --resource-group MyResourceGroup --cluster-name MyClusterName \\ + --cluster-type connectedClusters --name MyConfigurationName --operator-instance-name OperatorInst01 \\ + --operator-namespace OperatorNamespace01 --repository-url git://github.com/fluxHowTo/flux-get-started \\ + --operator-params "'--git-readonly'" --enable-helm-operator --helm-operator-version 0.6.0 \\ + --scope namespace --helm-operator-params '--set helm.versions=v3' +""" + +helps['k8sconfiguration list'] = """ + type: command + short-summary: List Kubernetes configurations. + examples: + - name: List all Kubernetes configurations of a cluster + text: |- + az k8sconfiguration list --resource-group MyResourceGroup --cluster-name MyClusterName \\ + --cluster-type connectedClusters +""" + +helps['k8sconfiguration delete'] = """ + type: command + short-summary: Delete a Kubernetes configuration. + examples: + - name: Delete a Kubernetes configuration + text: |- + az k8sconfiguration delete --resource-group MyResourceGroup --cluster-name MyClusterName \\ + --cluster-type connectedClusters --name MyConfigurationName +""" + +helps['k8sconfiguration show'] = """ + type: command + short-summary: Show details of a Kubernetes configuration. + examples: + - name: Show a Kubernetes configuration + text: |- + az k8sconfiguration show --resource-group MyResourceGroup --cluster-name MyClusterName \\ + --cluster-type connectedClusters --name MyConfigurationName +""" + +helps['k8sconfiguration update'] = """ + type: command + short-summary: Update a Kubernetes configuration. + examples: + - name: Update an existing Kubernetes configuration + text: |- + az k8sconfiguration update --resource-group MyResourceGroup --cluster-name MyClusterName \\ + --cluster-type connectedClusters --name MyConfigurationName --enable-helm-operator \\ + --repository-url git://github.com/fluxHowTo/flux-get-started --operator-params "'--git-readonly'" \\ + --helm-operator-version 0.6.0 --helm-operator-params '--set helm.versions=v3' +""" diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_params.py b/src/k8sconfiguration/azext_k8sconfiguration/_params.py new file mode 100644 index 00000000000..088836c434b --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/_params.py @@ -0,0 +1,52 @@ +# -------------------------------------------------------------------------------------------- +# 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 + +from knack.arguments import CLIArgumentType + +from azure.cli.core.commands.parameters import ( + get_three_state_flag, + get_enum_type, + tags_type +) + +from azure.cli.core.commands.validators import get_default_location_from_resource_group +from ._validators import validate_configuration_type + + +def load_arguments(self, _): + sourcecontrolconfiguration_type = CLIArgumentType(help='Name of the Kubernetes Configuration') + + with self.argument_context('k8sconfiguration') as c: + c.argument('tags', tags_type) + c.argument('location', validator=get_default_location_from_resource_group) + c.argument('name', sourcecontrolconfiguration_type, options_list=['--name', '-n']) + c.argument('cluster_name', options_list=['--cluster-name', '-c'], help='Name of the Kubernetes cluster') + c.argument('cluster_type', arg_type=get_enum_type(['connectedClusters', 'managedClusters']), + help='Specify Arc clusters or AKS managed clusters.') + c.argument('repository_url', options_list=['--repository-url', '-u'], + help='Url of the source control repository') + c.argument('enable_helm_operator', arg_type=get_three_state_flag(), + help='Enable support for Helm chart deployments') + c.argument('scope', arg_type=get_enum_type(['namespace', 'cluster']), + help='''Specify scope of the operator to be 'namespace' or 'cluster' ''') + c.argument('configuration_type', validator=validate_configuration_type, + arg_type=get_enum_type(['sourceControlConfiguration']), + help='Type of the configuration') + c.argument('helm_operator_params', + help='Chart values for the Helm Operator (if enabled)') + c.argument('helm_operator_version', + help='Chart version of the Helm Operator (if enabled)') + c.argument('operator_params', + help='Parameters for the Operator') + c.argument('operator_instance_name', + help='Instance name of the Operator') + c.argument('operator_namespace', + help='Namespace in which to install the Operator') + c.argument('operator_type', + help='''Type of the operator. Valid value is 'flux' ''') + + with self.argument_context('k8sconfiguration list') as c: + c.argument('sourcecontrolconfiguration', sourcecontrolconfiguration_type, id_part=None) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/_validators.py b/src/k8sconfiguration/azext_k8sconfiguration/_validators.py new file mode 100644 index 00000000000..cd8ca4df85e --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/_validators.py @@ -0,0 +1,11 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.util import CLIError + + +def validate_configuration_type(configuration_type): + if configuration_type.lower() != 'sourcecontrolconfiguration': + raise CLIError('Invalid configuration-type. Valid value is "sourceControlConfiguration"') diff --git a/src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json b/src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json new file mode 100644 index 00000000000..8cfc6da9485 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.3.1" +} \ No newline at end of file diff --git a/src/k8sconfiguration/azext_k8sconfiguration/commands.py b/src/k8sconfiguration/azext_k8sconfiguration/commands.py new file mode 100644 index 00000000000..a554e47fa43 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/commands.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +from azure.cli.core.commands import CliCommandType +from azext_k8sconfiguration._client_factory import (cf_k8sconfiguration, cf_k8sconfiguration_operation) + + +def load_command_table(self, _): + + k8sconfiguration_sdk = CliCommandType( + operations_tmpl='azext_k8sconfiguration.vendored_sdks.operations#SourceControlConfigurationsOperations.{}', + client_factory=cf_k8sconfiguration) + + with self.command_group('k8sconfiguration', k8sconfiguration_sdk, client_factory=cf_k8sconfiguration_operation, + is_preview=True) \ + as g: + g.custom_command('create', 'create_k8sconfiguration') + g.custom_command('update', 'update_k8sconfiguration') + g.custom_command('delete', 'delete_k8sconfiguration', confirmation=True) + g.custom_command('list', 'list_k8sconfiguration') + g.custom_show_command('show', 'show_k8sconfiguration') diff --git a/src/k8sconfiguration/azext_k8sconfiguration/custom.py b/src/k8sconfiguration/azext_k8sconfiguration/custom.py new file mode 100644 index 00000000000..60292c05269 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/custom.py @@ -0,0 +1,155 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.util import CLIError + +from azext_k8sconfiguration.vendored_sdks.models import SourceControlConfiguration +from azext_k8sconfiguration.vendored_sdks.models import HelmOperatorProperties +from azext_k8sconfiguration.vendored_sdks.models import ErrorResponseException + + +def show_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type): + """Get an existing Kubernetes Source Control Configuration. + + """ + # Determine ClusterRP + cluster_rp = __get_cluster_type(cluster_type) + + try: + config = client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, name) + return __fix_compliance_state(config) + except ErrorResponseException as ex: + # Customize the error message for resources not found + if ex.response.status_code == 404: + # If Cluster not found + if ex.message.__contains__("(ResourceNotFound)"): + message = "{0} Verify that the --cluster-type is correct and the resource exists.".format(ex.message) + # If Configuration not found + elif ex.message.__contains__("Operation returned an invalid status code 'Not Found'"): + message = "(ConfigurationNotFound) The Resource {0}/{1}/{2}/Microsoft.KubernetesConfiguration/" \ + "sourcecontrolConfigurations/{3} could not be found!".format(cluster_rp, cluster_type, + cluster_name, name) + else: + message = ex.message + raise CLIError(message) + + +def create_k8sconfiguration(client, resource_group_name, cluster_name, name, repository_url, scope, cluster_type, + operator_instance_name=None, operator_namespace='default', helm_operator_version='0.3.0', + operator_type='flux', operator_params='', enable_helm_operator=None, + helm_operator_params=''): + """Create a new Kubernetes Source Control Configuration. + + """ + # Determine ClusterRP + cluster_rp = __get_cluster_type(cluster_type) + + # Determine operatorInstanceName + if operator_instance_name is None: + operator_instance_name = name + + # Create helmOperatorProperties object + helm_operator_properties = None + + if enable_helm_operator: + helm_operator_properties = HelmOperatorProperties() + helm_operator_properties.chart_version = helm_operator_version.strip() + helm_operator_properties.chart_values = helm_operator_params.strip() + + # Create sourceControlConfiguration object + source_control_configuration = SourceControlConfiguration(repository_url=repository_url, + operator_namespace=operator_namespace, + operator_instance_name=operator_instance_name, + operator_type=operator_type, + operator_params=operator_params, + operator_scope=scope, + enable_helm_operator=enable_helm_operator, + helm_operator_properties=helm_operator_properties) + + # Try to create the resource + config = client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, + name, source_control_configuration) + + return __fix_compliance_state(config) + + +def update_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type, + repository_url=None, operator_params=None, enable_helm_operator=None, + helm_operator_version=None, helm_operator_params=None): + """Create a new Kubernetes Source Control Configuration. + + """ + # Determine ClusterRP + cluster_rp = __get_cluster_type(cluster_type) + + source_control_configuration_name = name.strip() + + config = client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, + source_control_configuration_name).as_dict() + + update_yes = False + + # Set input values, if they are supplied + if repository_url is not None: + config['repository_url'] = repository_url + update_yes = True + + if operator_params is not None: + config['operator_params'] = operator_params + update_yes = True + + if enable_helm_operator is not None: + config['enable_helm_operator'] = enable_helm_operator + update_yes = True + + if helm_operator_version is not None: + config['helm_operator_version'] = helm_operator_version + update_yes = True + + if helm_operator_params is not None: + config['helm_operator_params'] = helm_operator_params + update_yes = True + + if update_yes is False: + raise CLIError('Invalid update. No values to update!') + + config = client.create_or_update(resource_group_name, cluster_rp, cluster_type, cluster_name, + source_control_configuration_name, config) + + return __fix_compliance_state(config) + + +def list_k8sconfiguration(client, resource_group_name, cluster_name, cluster_type): + cluster_rp = __get_cluster_type(cluster_type) + return client.list(resource_group_name, cluster_rp, cluster_type, cluster_name) + + +def delete_k8sconfiguration(client, resource_group_name, cluster_name, name, cluster_type): + """Delete an existing Kubernetes Source Control Configuration. + + """ + # Determine ClusterRP + cluster_rp = __get_cluster_type(cluster_type) + + source_control_configuration_name = name + + return client.delete(resource_group_name, cluster_rp, cluster_type, cluster_name, source_control_configuration_name) + + +def __get_cluster_type(cluster_type): + if cluster_type.lower() == 'connectedclusters': + return 'Microsoft.Kubernetes' + # Since cluster_type is an enum of only two values, if not connectedClusters, it will be managedClusters. + return 'Microsoft.ContainerService' + + +def __fix_compliance_state(config): + # If we get Compliant/NonCompliant as compliance_sate, change them before returning + if config.compliance_status.compliance_state.lower() == 'noncompliant': + config.compliance_status.compliance_state = 'Failed' + elif config.compliance_status.compliance_state.lower() == 'compliant': + config.compliance_status.compliance_state = 'Installed' + + return config diff --git a/src/k8sconfiguration/azext_k8sconfiguration/tests/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/tests/__init__.py new file mode 100644 index 00000000000..99c0f28cd71 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# 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/k8sconfiguration/azext_k8sconfiguration/tests/latest/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/__init__.py new file mode 100644 index 00000000000..99c0f28cd71 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# 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/k8sconfiguration/azext_k8sconfiguration/tests/latest/recordings/test_k8sconfiguration.yaml b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/recordings/test_k8sconfiguration.yaml new file mode 100644 index 00000000000..fbc3c5f4468 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/recordings/test_k8sconfiguration.yaml @@ -0,0 +1,358 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - k8sconfiguration list + Connection: + - keep-alive + ParameterSetName: + - -g --cluster-name --cluster-type + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations?api-version=2019-11-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505e","name":"config0505e","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505e-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505e-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505d","name":"config0505d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505d-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505c","name":"config0505c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505c-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-branch=master''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0406a","name":"config0406a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0406a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0406a/flux-get-started","operatorInstanceName":"config0406a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403d","name":"config0403d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403d/flux-get-started","operatorInstanceName":"config0403d-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403c","name":"config0403c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403c/flux-get-started","operatorInstanceName":"config0403c-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403b","name":"config0403b","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403b-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403b/flux-get-started","operatorInstanceName":"config0403b-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403a","name":"config0403a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/config0403a/flux-get-started","operatorInstanceName":"config0403a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config323a","name":"config323a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config323-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/testurl","operatorInstanceName":"config323-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config226a","name":"config226a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config226a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"''--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system''"},"repositoryUrl":"git://github.com/config226a/flux-get-started","operatorInstanceName":"config226a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0220a","name":"cfg0220a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"default","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":""},"repositoryUrl":"git://github.com/slack/cluster-config.git","operatorInstanceName":"cfg0220a","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0219a","name":"cfg0219a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cfg0219a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207i","name":"cfg0207i","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"default","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207g","name":"cfg0207g","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cfg0207g-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/cfg0207g/flux-get-started","operatorInstanceName":"cfg0207g-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}],"nextLink":null}' + headers: + api-supported-versions: + - 2019-11-01-Preview + cache-control: + - no-cache + content-length: + - '14012' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 06 May 2020 03:58:56 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.2 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"repositoryUrl": "git://github.com/anubhav929/flux-get-started", + "operatorNamespace": "cliTestConfig0505A-opns", "operatorInstanceName": "cliTestconfig0505A-opin", + "operatorType": "flux", "operatorParams": "--git-readonly ", "operatorScope": + "namespace", "enableHelmOperator": "True", "helmOperatorProperties": {"chartVersion": + "0.6.0", "chartValues": "--set git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - k8sconfiguration create + Connection: + - keep-alive + Content-Length: + - '447' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -c -u --cluster-type --scope --operator-instance-name --operator-namespace + --operator-params --git-readonly --enable-helm-operator --helm-operator-version + --helm-operator-params --set git.ssh.secretName + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0505A?api-version=2019-11-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0505A","name":"cliTestConfig0505A","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0505A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0505A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}' + headers: + api-supported-versions: + - 2019-11-01-Preview + cache-control: + - no-cache + content-length: + - '1101' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 06 May 2020 03:58:58 GMT + expires: + - '-1' + location: + - /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0505A + pragma: + - no-cache + server: + - openresty/1.15.8.2 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - k8sconfiguration list + Connection: + - keep-alive + ParameterSetName: + - -g --cluster-name --cluster-type + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations?api-version=2019-11-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/clitestconfig0505a","name":"clitestconfig0505a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0505A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0505A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505e","name":"config0505e","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505e-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505e-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505d","name":"config0505d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505d-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505c","name":"config0505c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505c-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-branch=master''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0406a","name":"config0406a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0406a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0406a/flux-get-started","operatorInstanceName":"config0406a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403d","name":"config0403d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403d/flux-get-started","operatorInstanceName":"config0403d-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403c","name":"config0403c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403c/flux-get-started","operatorInstanceName":"config0403c-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403b","name":"config0403b","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403b-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403b/flux-get-started","operatorInstanceName":"config0403b-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403a","name":"config0403a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/config0403a/flux-get-started","operatorInstanceName":"config0403a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config323a","name":"config323a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config323-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/testurl","operatorInstanceName":"config323-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config226a","name":"config226a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config226a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"''--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system''"},"repositoryUrl":"git://github.com/config226a/flux-get-started","operatorInstanceName":"config226a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0220a","name":"cfg0220a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"default","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":""},"repositoryUrl":"git://github.com/slack/cluster-config.git","operatorInstanceName":"cfg0220a","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0219a","name":"cfg0219a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cfg0219a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207i","name":"cfg0207i","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"default","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207g","name":"cfg0207g","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cfg0207g-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/cfg0207g/flux-get-started","operatorInstanceName":"cfg0207g-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}],"nextLink":null}' + headers: + api-supported-versions: + - 2019-11-01-Preview + cache-control: + - no-cache + content-length: + - '15114' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 06 May 2020 03:58:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.2 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - k8sconfiguration show + Connection: + - keep-alive + ParameterSetName: + - -g -c -n --cluster-type + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0505A?api-version=2019-11-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0505A","name":"cliTestConfig0505A","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cliTestConfig0505A-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cliTestconfig0505A-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}' + headers: + api-supported-versions: + - 2019-11-01-Preview + cache-control: + - no-cache + content-length: + - '1101' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 06 May 2020 03:59:00 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.2 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - k8sconfiguration delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -c -n --cluster-type -y + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cliTestConfig0505A?api-version=2019-11-01-preview + response: + body: + string: '{"version":"1.1","content":null,"statusCode":200,"reasonPhrase":"OK","headers":[],"trailingHeaders":[],"requestMessage":null,"isSuccessStatusCode":true}' + headers: + api-supported-versions: + - 2019-11-01-Preview + cache-control: + - no-cache + content-length: + - '152' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 06 May 2020 03:59:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.2 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - k8sconfiguration list + Connection: + - keep-alive + ParameterSetName: + - -g --cluster-name --cluster-type + User-Agent: + - python/3.8.0 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations?api-version=2019-11-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505e","name":"config0505e","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505e-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505e-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505d","name":"config0505d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505d-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0505c","name":"config0505c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0505c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/anagg929/ContosoSecurityPolicies","operatorInstanceName":"config0505c-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-branch=master''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0406a","name":"config0406a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0406a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0406a/flux-get-started","operatorInstanceName":"config0406a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403d","name":"config0403d","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403d-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403d/flux-get-started","operatorInstanceName":"config0403d-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403c","name":"config0403c","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403c-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403c/flux-get-started","operatorInstanceName":"config0403c-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403b","name":"config0403b","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403b-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.6.0","chartValues":"--set + helm.versions=v3"},"repositoryUrl":"git://github.com/config0403b/flux-get-started","operatorInstanceName":"config0403b-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config0403a","name":"config0403a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config0403a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/config0403a/flux-get-started","operatorInstanceName":"config0403a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config323a","name":"config323a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config323-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"https://github.com/testurl","operatorInstanceName":"config323-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/config226a","name":"config226a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"config226a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"''--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system''"},"repositoryUrl":"git://github.com/config226a/flux-get-started","operatorInstanceName":"config226a-opin","operatorType":"Flux","operatorScope":"namespace","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0220a","name":"cfg0220a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"default","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":""},"repositoryUrl":"git://github.com/slack/cluster-config.git","operatorInstanceName":"cfg0220a","operatorType":"Flux","operatorScope":"namespace","operatorParams":"--git-readonly","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0219a","name":"cfg0219a","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cfg0219a-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207i","name":"cfg0207i","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"default","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":false,"repositoryUrl":"git://github.com/anubhav929/flux-get-started","operatorInstanceName":"cfg0219a-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"--git-readonly + ","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/haikudevtesting/providers/Microsoft.Kubernetes/connectedClusters/matrived-tpcomi/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/cfg0207g","name":"cfg0207g","type":"Microsoft.KubernetesConfiguration/sourceControlConfigurations","properties":{"operatorNamespace":"cfg0207g-opns","provisioningState":"Succeeded","complianceStatus":{"complianceState":"Pending","lastConfigApplied":"0001-01-01T00:00:00","message":"{\"OperatorMessage\":null,\"ClusterState\":null}","messageLevel":3},"enableHelmOperator":true,"helmOperatorProperties":{"chartVersion":"0.2.0","chartValues":"--set + git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system"},"repositoryUrl":"git://github.com/cfg0207g/flux-get-started","operatorInstanceName":"cfg0207g-opin","operatorType":"Flux","operatorScope":"cluster","operatorParams":"''--git-readonly''","repositoryPublicKey":"","configKind":0,"createdDate":"0001-01-01T00:00:00+00:00","lastModifiedDate":"0001-01-01T00:00:00+00:00"}}],"nextLink":null}' + headers: + api-supported-versions: + - 2019-11-01-Preview + cache-control: + - no-cache + content-length: + - '14012' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 06 May 2020 03:59:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.2 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py new file mode 100644 index 00000000000..16fce68767e --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/tests/latest/test_kubernetesconfiguration_scenario.py @@ -0,0 +1,80 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os + +from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, record_only) + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class K8sconfigurationScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_k8sconfiguration') + @record_only() + def test_k8sconfiguration(self): + self.kwargs.update({ + 'name': 'cliTestConfig0505A', + 'cluster_name': 'matrived-tpcomi', + 'rg': 'haikudevtesting', + 'repo_url': 'git://github.com/anubhav929/flux-get-started', + 'operator_instance_name': 'cliTestconfig0505A-opin', + 'operator_namespace': 'cliTestConfig0505A-opns', + 'cluster_type': 'connectedClusters', + 'scope': 'namespace' + }) + + # List Configurations and get the count + config_count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name} ' + '--cluster-type {cluster_type}').get_output_in_json()) + self.greater_than(config_count, 10) + + # Create a configuration + self.cmd(''' k8sconfiguration create -g {rg} + -n {name} + -c {cluster_name} + -u {repo_url} + --cluster-type {cluster_type} + --scope {scope} + --operator-instance-name {operator_instance_name} + --operator-namespace {operator_namespace} + --operator-params \"--git-readonly \" + --enable-helm-operator + --helm-operator-version 0.6.0 + --helm-operator-params \"--set git.ssh.secretName=flux-git-deploy --set tillerNamespace=kube-system\" ''', + checks=[ + self.check('name', '{name}'), + self.check('resourceGroup', '{rg}'), + self.check('operatorInstanceName', '{operator_instance_name}'), + self.check('operatorNamespace', '{operator_namespace}'), + self.check('provisioningState', 'Succeeded'), + self.check('operatorScope', 'namespace'), + self.check('operatorType', 'Flux') + ]) + + # List the configurations again to see if we have one additional + new_count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name} ' + '--cluster-type {cluster_type}').get_output_in_json()) + self.assertEqual(new_count, config_count + 1) + + # Get the configuration created + self.cmd('k8sconfiguration show -g {rg} -c {cluster_name} -n {name} --cluster-type {cluster_type}', + checks=[ + self.check('name', '{name}'), + self.check('resourceGroup', '{rg}'), + self.check('operatorInstanceName', '{operator_instance_name}'), + self.check('operatorNamespace', '{operator_namespace}'), + self.check('provisioningState', 'Succeeded'), + self.check('operatorScope', 'namespace'), + self.check('operatorType', 'Flux') + ]) + + # Delete the created configuration + self.cmd('k8sconfiguration delete -g {rg} -c {cluster_name} -n {name} --cluster-type {cluster_type} -y') + + # List Configurations and confirm the count is the same as we started + new_count = len(self.cmd('k8sconfiguration list -g {rg} --cluster-name {cluster_name} ' + '--cluster-type {cluster_type}').get_output_in_json()) + self.assertEqual(new_count, config_count) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/__init__.py new file mode 100644 index 00000000000..874177b4d34 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/__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 SourceControlConfigurationClientConfiguration +from ._source_control_configuration_client import SourceControlConfigurationClient +__all__ = ['SourceControlConfigurationClient', 'SourceControlConfigurationClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/_configuration.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/_configuration.py new file mode 100644 index 00000000000..5043ed69594 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/_configuration.py @@ -0,0 +1,49 @@ +# 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 SourceControlConfigurationClientConfiguration(AzureConfiguration): + """Configuration for SourceControlConfigurationClient + 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: The Azure subscription ID. This is a + GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(SourceControlConfigurationClientConfiguration, 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-kubernetesconfiguration/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/_source_control_configuration_client.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/_source_control_configuration_client.py new file mode 100644 index 00000000000..004f8988387 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/_source_control_configuration_client.py @@ -0,0 +1,55 @@ +# 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 SourceControlConfigurationClientConfiguration +from .operations import SourceControlConfigurationsOperations +from .operations import Operations +from . import models + + +class SourceControlConfigurationClient(SDKClient): + """Use these APIs to create Source Control Configuration resources through ARM, for Kubernetes Clusters. + + :ivar config: Configuration for client. + :vartype config: SourceControlConfigurationClientConfiguration + + :ivar source_control_configurations: SourceControlConfigurations operations + :vartype source_control_configurations: azure.mgmt.kubernetesconfiguration.operations.SourceControlConfigurationsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.kubernetesconfiguration.operations.Operations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Azure subscription ID. This is a + GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = SourceControlConfigurationClientConfiguration(credentials, subscription_id, base_url) + super(SourceControlConfigurationClient, 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 = '2019-11-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.source_control_configurations = SourceControlConfigurationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/__init__.py new file mode 100644 index 00000000000..3288aba428d --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/__init__.py @@ -0,0 +1,64 @@ +# 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 ComplianceStatus + from ._models_py3 import ErrorDefinition + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import HelmOperatorProperties + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import ResourceProviderOperation + from ._models_py3 import ResourceProviderOperationDisplay + from ._models_py3 import Result + from ._models_py3 import SourceControlConfiguration +except (SyntaxError, ImportError): + from ._models import ComplianceStatus + from ._models import ErrorDefinition + from ._models import ErrorResponse, ErrorResponseException + from ._models import HelmOperatorProperties + from ._models import ProxyResource + from ._models import Resource + from ._models import ResourceProviderOperation + from ._models import ResourceProviderOperationDisplay + from ._models import Result + from ._models import SourceControlConfiguration +from ._paged_models import ResourceProviderOperationPaged +from ._paged_models import SourceControlConfigurationPaged +from ._source_control_configuration_client_enums import ( + ComplianceState, + MessageLevel, + OperatorType, + OperatorScope, + EnableHelmOperator, + ProvisioningState, +) + +__all__ = [ + 'ComplianceStatus', + 'ErrorDefinition', + 'ErrorResponse', 'ErrorResponseException', + 'HelmOperatorProperties', + 'ProxyResource', + 'Resource', + 'ResourceProviderOperation', + 'ResourceProviderOperationDisplay', + 'Result', + 'SourceControlConfiguration', + 'SourceControlConfigurationPaged', + 'ResourceProviderOperationPaged', + 'ComplianceState', + 'MessageLevel', + 'OperatorType', + 'OperatorScope', + 'EnableHelmOperator', + 'ProvisioningState', +] diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models.py new file mode 100644 index 00000000000..390ef245874 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models.py @@ -0,0 +1,368 @@ +# 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 CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ComplianceStatus(Model): + """Compliance Status details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar compliance_state: The compliance state of the configuration. + Possible values include: 'Pending', 'Compliant', 'Noncompliant', + 'Installed', 'Failed' + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.models.ComplianceState + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: datetime + :param message: Message from when the configuration was applied. + :type message: str + :param message_level: Level of the message. Possible values include: + 'Error', 'Warning', 'Information' + :type message_level: str or + ~azure.mgmt.kubernetesconfiguration.models.MessageLevel + """ + + _validation = { + 'compliance_state': {'readonly': True}, + } + + _attribute_map = { + 'compliance_state': {'key': 'complianceState', 'type': 'str'}, + 'last_config_applied': {'key': 'lastConfigApplied', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'message_level': {'key': 'messageLevel', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ComplianceStatus, self).__init__(**kwargs) + self.compliance_state = None + self.last_config_applied = kwargs.get('last_config_applied', None) + self.message = kwargs.get('message', None) + self.message_level = kwargs.get('message_level', None) + + +class ErrorDefinition(Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Service specific error code which serves as the substatus for + the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: + list[~azure.mgmt.kubernetesconfiguration.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__(self, **kwargs): + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None + + +class ErrorResponse(Model): + """Error response. + + :param error: Error definition. + :type error: ~azure.mgmt.kubernetesconfiguration.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class HelmOperatorProperties(Model): + """Properties for Helm operator. + + :param chart_version: Version of the operator Helm chart. + :type chart_version: str + :param chart_values: Values override for the operator Helm chart. + :type chart_values: str + """ + + _attribute_map = { + 'chart_version': {'key': 'chartVersion', 'type': 'str'}, + 'chart_values': {'key': 'chartValues', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HelmOperatorProperties, self).__init__(**kwargs) + self.chart_version = kwargs.get('chart_version', None) + self.chart_values = kwargs.get('chart_values', None) + + +class Resource(Model): + """The Resource model definition. + + 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 + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """ARM proxy resource. + + 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 + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + + +class ResourceProviderOperation(Model): + """Supported operation of this resource provider. + + :param name: Operation name, in format of + {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class ResourceProviderOperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft KubernetesConfiguration. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class Result(Model): + """Sample result definition. + + :param sample_property: Sample property of type string + :type sample_property: str + """ + + _attribute_map = { + 'sample_property': {'key': 'sampleProperty', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Result, self).__init__(**kwargs) + self.sample_property = kwargs.get('sample_property', None) + + +class SourceControlConfiguration(ProxyResource): + """The SourceControl Configuration object. + + 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 repository_url: Url of the SourceControl Repository. + :type repository_url: str + :param operator_namespace: The namespace to which this operator is + installed to. Maximum of 253 lower case alphanumeric characters, hyphen + and period only. Default value: "default" . + :type operator_namespace: str + :param operator_instance_name: Instance name of the operator - identifying + the specific configuration. + :type operator_instance_name: str + :param operator_type: Type of the operator. Possible values include: + 'Flux' + :type operator_type: str or + ~azure.mgmt.kubernetesconfiguration.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string + format. + :type operator_params: str + :param operator_scope: Scope at which the operator will be installed. + Possible values include: 'cluster', 'namespace'. Default value: "cluster" + . + :type operator_scope: str or + ~azure.mgmt.kubernetesconfiguration.models.OperatorScope + :ivar repository_public_key: Public Key associated with this SourceControl + configuration (either generated within the cluster or provided by the + user). + :vartype repository_public_key: str + :param enable_helm_operator: Option to enable Helm Operator for this git + configuration. Possible values include: 'true', 'false' + :type enable_helm_operator: str or + ~azure.mgmt.kubernetesconfiguration.models.EnableHelmOperator + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: + ~azure.mgmt.kubernetesconfiguration.models.HelmOperatorProperties + :ivar provisioning_state: The provisioning state of the resource provider. + Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', + 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.models.ProvisioningState + :ivar compliance_status: Compliance Status of the Configuration + :vartype compliance_status: + ~azure.mgmt.kubernetesconfiguration.models.ComplianceStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'repository_public_key': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'compliance_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'operator_namespace': {'key': 'properties.operatorNamespace', 'type': 'str'}, + 'operator_instance_name': {'key': 'properties.operatorInstanceName', 'type': 'str'}, + 'operator_type': {'key': 'properties.operatorType', 'type': 'str'}, + 'operator_params': {'key': 'properties.operatorParams', 'type': 'str'}, + 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, + 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, + 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'str'}, + 'helm_operator_properties': {'key': 'properties.helmOperatorProperties', 'type': 'HelmOperatorProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'compliance_status': {'key': 'properties.complianceStatus', 'type': 'ComplianceStatus'}, + } + + def __init__(self, **kwargs): + super(SourceControlConfiguration, self).__init__(**kwargs) + self.repository_url = kwargs.get('repository_url', None) + self.operator_namespace = kwargs.get('operator_namespace', "default") + self.operator_instance_name = kwargs.get('operator_instance_name', None) + self.operator_type = kwargs.get('operator_type', None) + self.operator_params = kwargs.get('operator_params', None) + self.operator_scope = kwargs.get('operator_scope', "cluster") + self.repository_public_key = None + self.enable_helm_operator = kwargs.get('enable_helm_operator', None) + self.helm_operator_properties = kwargs.get('helm_operator_properties', None) + self.provisioning_state = None + self.compliance_status = None diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models_py3.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models_py3.py new file mode 100644 index 00000000000..67d46fffa37 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_models_py3.py @@ -0,0 +1,368 @@ +# 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 CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ComplianceStatus(Model): + """Compliance Status details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar compliance_state: The compliance state of the configuration. + Possible values include: 'Pending', 'Compliant', 'Noncompliant', + 'Installed', 'Failed' + :vartype compliance_state: str or + ~azure.mgmt.kubernetesconfiguration.models.ComplianceState + :param last_config_applied: Datetime the configuration was last applied. + :type last_config_applied: datetime + :param message: Message from when the configuration was applied. + :type message: str + :param message_level: Level of the message. Possible values include: + 'Error', 'Warning', 'Information' + :type message_level: str or + ~azure.mgmt.kubernetesconfiguration.models.MessageLevel + """ + + _validation = { + 'compliance_state': {'readonly': True}, + } + + _attribute_map = { + 'compliance_state': {'key': 'complianceState', 'type': 'str'}, + 'last_config_applied': {'key': 'lastConfigApplied', 'type': 'iso-8601'}, + 'message': {'key': 'message', 'type': 'str'}, + 'message_level': {'key': 'messageLevel', 'type': 'str'}, + } + + def __init__(self, *, last_config_applied=None, message: str=None, message_level=None, **kwargs) -> None: + super(ComplianceStatus, self).__init__(**kwargs) + self.compliance_state = None + self.last_config_applied = last_config_applied + self.message = message + self.message_level = message_level + + +class ErrorDefinition(Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Service specific error code which serves as the substatus for + the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: + list[~azure.mgmt.kubernetesconfiguration.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None + + +class ErrorResponse(Model): + """Error response. + + :param error: Error definition. + :type error: ~azure.mgmt.kubernetesconfiguration.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class HelmOperatorProperties(Model): + """Properties for Helm operator. + + :param chart_version: Version of the operator Helm chart. + :type chart_version: str + :param chart_values: Values override for the operator Helm chart. + :type chart_values: str + """ + + _attribute_map = { + 'chart_version': {'key': 'chartVersion', 'type': 'str'}, + 'chart_values': {'key': 'chartValues', 'type': 'str'}, + } + + def __init__(self, *, chart_version: str=None, chart_values: str=None, **kwargs) -> None: + super(HelmOperatorProperties, self).__init__(**kwargs) + self.chart_version = chart_version + self.chart_values = chart_values + + +class Resource(Model): + """The Resource model definition. + + 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 + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """ARM proxy resource. + + 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 + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + + +class ResourceProviderOperation(Model): + """Supported operation of this resource provider. + + :param name: Operation name, in format of + {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = name + self.display = display + + +class ResourceProviderOperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft KubernetesConfiguration. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class Result(Model): + """Sample result definition. + + :param sample_property: Sample property of type string + :type sample_property: str + """ + + _attribute_map = { + 'sample_property': {'key': 'sampleProperty', 'type': 'str'}, + } + + def __init__(self, *, sample_property: str=None, **kwargs) -> None: + super(Result, self).__init__(**kwargs) + self.sample_property = sample_property + + +class SourceControlConfiguration(ProxyResource): + """The SourceControl Configuration object. + + 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 repository_url: Url of the SourceControl Repository. + :type repository_url: str + :param operator_namespace: The namespace to which this operator is + installed to. Maximum of 253 lower case alphanumeric characters, hyphen + and period only. Default value: "default" . + :type operator_namespace: str + :param operator_instance_name: Instance name of the operator - identifying + the specific configuration. + :type operator_instance_name: str + :param operator_type: Type of the operator. Possible values include: + 'Flux' + :type operator_type: str or + ~azure.mgmt.kubernetesconfiguration.models.OperatorType + :param operator_params: Any Parameters for the Operator instance in string + format. + :type operator_params: str + :param operator_scope: Scope at which the operator will be installed. + Possible values include: 'cluster', 'namespace'. Default value: "cluster" + . + :type operator_scope: str or + ~azure.mgmt.kubernetesconfiguration.models.OperatorScope + :ivar repository_public_key: Public Key associated with this SourceControl + configuration (either generated within the cluster or provided by the + user). + :vartype repository_public_key: str + :param enable_helm_operator: Option to enable Helm Operator for this git + configuration. Possible values include: 'true', 'false' + :type enable_helm_operator: str or + ~azure.mgmt.kubernetesconfiguration.models.EnableHelmOperator + :param helm_operator_properties: Properties for Helm operator. + :type helm_operator_properties: + ~azure.mgmt.kubernetesconfiguration.models.HelmOperatorProperties + :ivar provisioning_state: The provisioning state of the resource provider. + Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', + 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.kubernetesconfiguration.models.ProvisioningState + :ivar compliance_status: Compliance Status of the Configuration + :vartype compliance_status: + ~azure.mgmt.kubernetesconfiguration.models.ComplianceStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'repository_public_key': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'compliance_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_url': {'key': 'properties.repositoryUrl', 'type': 'str'}, + 'operator_namespace': {'key': 'properties.operatorNamespace', 'type': 'str'}, + 'operator_instance_name': {'key': 'properties.operatorInstanceName', 'type': 'str'}, + 'operator_type': {'key': 'properties.operatorType', 'type': 'str'}, + 'operator_params': {'key': 'properties.operatorParams', 'type': 'str'}, + 'operator_scope': {'key': 'properties.operatorScope', 'type': 'str'}, + 'repository_public_key': {'key': 'properties.repositoryPublicKey', 'type': 'str'}, + 'enable_helm_operator': {'key': 'properties.enableHelmOperator', 'type': 'str'}, + 'helm_operator_properties': {'key': 'properties.helmOperatorProperties', 'type': 'HelmOperatorProperties'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'compliance_status': {'key': 'properties.complianceStatus', 'type': 'ComplianceStatus'}, + } + + def __init__(self, *, repository_url: str=None, operator_namespace: str="default", operator_instance_name: str=None, operator_type=None, operator_params: str=None, operator_scope="cluster", enable_helm_operator=None, helm_operator_properties=None, **kwargs) -> None: + super(SourceControlConfiguration, self).__init__(**kwargs) + self.repository_url = repository_url + self.operator_namespace = operator_namespace + self.operator_instance_name = operator_instance_name + self.operator_type = operator_type + self.operator_params = operator_params + self.operator_scope = operator_scope + self.repository_public_key = None + self.enable_helm_operator = enable_helm_operator + self.helm_operator_properties = helm_operator_properties + self.provisioning_state = None + self.compliance_status = None diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_paged_models.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_paged_models.py new file mode 100644 index 00000000000..da03391d8d6 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_paged_models.py @@ -0,0 +1,40 @@ +# 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 SourceControlConfigurationPaged(Paged): + """ + A paging container for iterating over a list of :class:`SourceControlConfiguration ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SourceControlConfiguration]'} + } + + def __init__(self, *args, **kwargs): + + super(SourceControlConfigurationPaged, self).__init__(*args, **kwargs) +class ResourceProviderOperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceProviderOperation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceProviderOperation]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceProviderOperationPaged, self).__init__(*args, **kwargs) diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_source_control_configuration_client_enums.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_source_control_configuration_client_enums.py new file mode 100644 index 00000000000..17114fbca71 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/models/_source_control_configuration_client_enums.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ComplianceState(str, Enum): + + pending = "Pending" + compliant = "Compliant" + noncompliant = "Noncompliant" + installed = "Installed" + failed = "Failed" + + +class MessageLevel(str, Enum): + + error = "Error" + warning = "Warning" + information = "Information" + + +class OperatorType(str, Enum): + + flux = "Flux" + + +class OperatorScope(str, Enum): + + cluster = "cluster" + namespace = "namespace" + + +class EnableHelmOperator(str, Enum): + + true = "true" + false = "false" + + +class ProvisioningState(str, Enum): + + accepted = "Accepted" + deleting = "Deleting" + running = "Running" + succeeded = "Succeeded" + failed = "Failed" diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/__init__.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/__init__.py new file mode 100644 index 00000000000..b6c0858d9a7 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/__init__.py @@ -0,0 +1,18 @@ +# 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 ._source_control_configurations_operations import SourceControlConfigurationsOperations +from ._operations import Operations + +__all__ = [ + 'SourceControlConfigurationsOperations', + 'Operations', +] diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_operations.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_operations.py new file mode 100644 index 00000000000..a1ef22cadd8 --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_operations.py @@ -0,0 +1,103 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +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: The API version to be used with the HTTP request. Constant value: "2019-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-11-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all the available operations the KubernetesConfiguration resource + provider supports. + + :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 ResourceProviderOperation + :rtype: + ~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperationPaged[~azure.mgmt.kubernetesconfiguration.models.ResourceProviderOperation] + :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.ResourceProviderOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.KubernetesConfiguration/operations'} diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_source_control_configurations_operations.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_source_control_configurations_operations.py new file mode 100644 index 00000000000..290dba8e4ac --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/operations/_source_control_configurations_operations.py @@ -0,0 +1,386 @@ +# 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 SourceControlConfigurationsOperations(object): + """SourceControlConfigurationsOperations 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: The API version to be used with the HTTP request. Constant value: "2019-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers=None, raw=False, **operation_config): + """Gets details of the Source Control Configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either + Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes + (for OnPrem K8S clusters). Possible values include: + 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - + either managedClusters (for AKS clusters) or connectedClusters (for + OnPrem K8S clusters). Possible values include: 'managedClusters', + 'connectedClusters' + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control + Configuration. + :type source_control_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: SourceControlConfiguration or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.kubernetesconfiguration.models.SourceControlConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SourceControlConfiguration', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} + + def create_or_update( + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, source_control_configuration, custom_headers=None, raw=False, **operation_config): + """Create a new Kubernetes Source Control Configuration. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either + Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes + (for OnPrem K8S clusters). Possible values include: + 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - + either managedClusters (for AKS clusters) or connectedClusters (for + OnPrem K8S clusters). Possible values include: 'managedClusters', + 'connectedClusters' + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control + Configuration. + :type source_control_configuration_name: str + :param source_control_configuration: Properties necessary to Create + KubernetesConfiguration. + :type source_control_configuration: + ~azure.mgmt.kubernetesconfiguration.models.SourceControlConfiguration + :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: SourceControlConfiguration or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.kubernetesconfiguration.models.SourceControlConfiguration + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # 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'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_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(source_control_configuration, 'SourceControlConfiguration') + + # 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, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SourceControlConfiguration', response) + if response.status_code == 201: + deserialized = self._deserialize('SourceControlConfiguration', 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/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} + + + def _delete_initial( + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_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'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'sourceControlConfigurationName': self._serialize.url("source_control_configuration_name", source_control_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, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, source_control_configuration_name, custom_headers=None, raw=False, polling=True, **operation_config): + """This will delete the YAML file used to set up the Source control + configuration, thus stopping future sync from the source repo. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either + Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes + (for OnPrem K8S clusters). Possible values include: + 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - + either managedClusters (for AKS clusters) or connectedClusters (for + OnPrem K8S clusters). Possible values include: 'managedClusters', + 'connectedClusters' + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_name: str + :param source_control_configuration_name: Name of the Source Control + Configuration. + :type source_control_configuration_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:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_rp=cluster_rp, + cluster_resource_name=cluster_resource_name, + cluster_name=cluster_name, + source_control_configuration_name=source_control_configuration_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/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/{sourceControlConfigurationName}'} + + def list( + self, resource_group_name, cluster_rp, cluster_resource_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """List all Source Control Configurations. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_rp: The Kubernetes cluster RP - either + Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes + (for OnPrem K8S clusters). Possible values include: + 'Microsoft.ContainerService', 'Microsoft.Kubernetes' + :type cluster_rp: str + :param cluster_resource_name: The Kubernetes cluster resource name - + either managedClusters (for AKS clusters) or connectedClusters (for + OnPrem K8S clusters). Possible values include: 'managedClusters', + 'connectedClusters' + :type cluster_resource_name: str + :param cluster_name: The name of the kubernetes cluster. + :type cluster_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: An iterator like instance of SourceControlConfiguration + :rtype: + ~azure.mgmt.kubernetesconfiguration.models.SourceControlConfigurationPaged[~azure.mgmt.kubernetesconfiguration.models.SourceControlConfiguration] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'clusterRp': self._serialize.url("cluster_rp", cluster_rp, 'str'), + 'clusterResourceName': self._serialize.url("cluster_resource_name", cluster_resource_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_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') + + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SourceControlConfigurationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{clusterRp}/{clusterResourceName}/{clusterName}/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations'} diff --git a/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/version.py b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/version.py new file mode 100644 index 00000000000..e0ec669828c --- /dev/null +++ b/src/k8sconfiguration/azext_k8sconfiguration/vendored_sdks/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/k8sconfiguration/setup.cfg b/src/k8sconfiguration/setup.cfg new file mode 100644 index 00000000000..3c6e79cf31d --- /dev/null +++ b/src/k8sconfiguration/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/src/k8sconfiguration/setup.py b/src/k8sconfiguration/setup.py new file mode 100644 index 00000000000..17b8070b62c --- /dev/null +++ b/src/k8sconfiguration/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.8' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +# TODO: Add any additional SDK dependencies here +DEPENDENCIES = [] + +with open('README.rst', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='k8sconfiguration', + version=VERSION, + description='Microsoft Azure Command-Line Tools K8sconfiguration 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_k8sconfiguration': ['azext_metadata.json']}, +) \ No newline at end of file diff --git a/src/kusto/HISTORY.rst b/src/kusto/HISTORY.rst new file mode 100644 index 00000000000..27f152061e8 --- /dev/null +++ b/src/kusto/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/kusto/README.md b/src/kusto/README.md new file mode 100644 index 00000000000..3622fe06255 --- /dev/null +++ b/src/kusto/README.md @@ -0,0 +1,5 @@ +Microsoft Azure CLI 'kusto' Extension +========================================== + +This package is for the 'kusto' extension. +i.e. 'az kusto' diff --git a/src/kusto/azext_kusto/__init__.py b/src/kusto/azext_kusto/__init__.py new file mode 100644 index 00000000000..5a12fc226b3 --- /dev/null +++ b/src/kusto/azext_kusto/__init__.py @@ -0,0 +1,46 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader +from azext_kusto.generated._help import helps # pylint: disable=unused-import + + +class KustoManagementClientCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_kusto.generated._client_factory import cf_kusto + kusto_custom = CliCommandType( + operations_tmpl='azext_kusto.custom#{}', + client_factory=cf_kusto) + super(KustoManagementClientCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=kusto_custom) + + def load_command_table(self, args): + from azext_kusto.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_kusto.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError: + pass + return self.command_table + + def load_arguments(self, command): + from azext_kusto.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_kusto.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass + + +COMMAND_LOADER_CLS = KustoManagementClientCommandsLoader diff --git a/src/kusto/azext_kusto/action.py b/src/kusto/azext_kusto/action.py new file mode 100644 index 00000000000..a846b2766c4 --- /dev/null +++ b/src/kusto/azext_kusto/action.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/kusto/azext_kusto/azext_metadata.json b/src/kusto/azext_kusto/azext_metadata.json new file mode 100644 index 00000000000..7b56fb1e11a --- /dev/null +++ b/src/kusto/azext_kusto/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1" +} \ No newline at end of file diff --git a/src/kusto/azext_kusto/custom.py b/src/kusto/azext_kusto/custom.py new file mode 100644 index 00000000000..7f31674ce96 --- /dev/null +++ b/src/kusto/azext_kusto/custom.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/kusto/azext_kusto/generated/__init__.py b/src/kusto/azext_kusto/generated/__init__.py new file mode 100644 index 00000000000..ee0c4f36bd0 --- /dev/null +++ b/src/kusto/azext_kusto/generated/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/kusto/azext_kusto/generated/_client_factory.py b/src/kusto/azext_kusto/generated/_client_factory.py new file mode 100644 index 00000000000..96406ce744f --- /dev/null +++ b/src/kusto/azext_kusto/generated/_client_factory.py @@ -0,0 +1,39 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +def cf_kusto(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from ..vendored_sdks.kusto import KustoManagementClient + return get_mgmt_service_client(cli_ctx, KustoManagementClient) + + +def cf_cluster(cli_ctx, *_): + return cf_kusto(cli_ctx).cluster + + +def cf_cluster_principal_assignment(cli_ctx, *_): + return cf_kusto(cli_ctx).cluster_principal_assignment + + +def cf_database(cli_ctx, *_): + return cf_kusto(cli_ctx).database + + +def cf_database_principal_assignment(cli_ctx, *_): + return cf_kusto(cli_ctx).database_principal_assignment + + +def cf_attached_database_configuration(cli_ctx, *_): + return cf_kusto(cli_ctx).attached_database_configuration + + +def cf_data_connection(cli_ctx, *_): + return cf_kusto(cli_ctx).data_connection diff --git a/src/kusto/azext_kusto/generated/_help.py b/src/kusto/azext_kusto/generated/_help.py new file mode 100644 index 00000000000..c319c0cdaf0 --- /dev/null +++ b/src/kusto/azext_kusto/generated/_help.py @@ -0,0 +1,558 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + + +helps['kusto cluster'] = """ + type: group + short-summary: kusto cluster +""" + +helps['kusto cluster list'] = """ + type: command + short-summary: Lists all Kusto clusters within a subscription. + examples: + - name: KustoClustersListByResourceGroup + text: |- + az kusto cluster list --resource-group "kustorptest" +""" + +helps['kusto cluster show'] = """ + type: command + short-summary: Gets a Kusto cluster. + examples: + - name: KustoClustersGet + text: |- + az kusto cluster show --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto cluster create'] = """ + type: command + short-summary: Create or update a Kusto cluster. + examples: + - name: KustoClustersCreateOrUpdate + text: |- + az kusto cluster create --cluster-name "KustoClusterRPTest4" --identity-type "SystemAssigned" --location\ + "westus" --enable-purge true --enable-streaming-ingest true --key-vault-properties key-name="" key-vault-uri="" key-ve\ +rsion="" --sku name="Standard_L8s" capacity=2 tier="Standard" --resource-group "kustorptest" +""" + +helps['kusto cluster update'] = """ + type: command + short-summary: Update a Kusto cluster. + examples: + - name: KustoClustersUpdate + text: |- + az kusto cluster update --cluster-name "KustoClusterRPTest4" --identity-type "SystemAssigned" --location\ + "westus" --enable-purge true --enable-streaming-ingest true --key-vault-properties key-name="keyName" key-vault-uri="h\ +ttps://dummy.keyvault.com" key-version="keyVersion" --resource-group "kustorptest" +""" + +helps['kusto cluster delete'] = """ + type: command + short-summary: Deletes a Kusto cluster. + examples: + - name: KustoClustersDelete + text: |- + az kusto cluster delete --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto cluster add-language-extension'] = """ + type: command + short-summary: Add a list of language extensions that can run within KQL queries. + examples: + - name: KustoClusterAddLanguageExtensions + text: |- + az kusto cluster add-language-extension --cluster-name "KustoClusterRPTest4" --value language-extension-\ +name="PYTHON" --value language-extension-name="R" --resource-group "kustorptest" +""" + +helps['kusto cluster detach-follower-database'] = """ + type: command + short-summary: Detaches all followers of a database owned by this cluster. + examples: + - name: KustoClusterDetachFollowerDatabases + text: |- + az kusto cluster detach-follower-database --cluster-name "KustoClusterRPTest4" --attached-database-confi\ +guration-name "myAttachedDatabaseConfiguration" --cluster-resource-id "/subscriptions/12345678-1234-1234-1234-123456789\ +098/resourceGroups/kustorptest/providers/Microsoft.Kusto/clusters/leader4" --resource-group "kustorptest" +""" + +helps['kusto cluster diagnose-virtual-network'] = """ + type: command + short-summary: Diagnoses network connectivity status for external resources on which the service is dependent on. + examples: + - name: KustoClusterDiagnoseVirtualNetwork + text: |- + az kusto cluster diagnose-virtual-network --cluster-name "KustoClusterRPTest4" --resource-group "kustorp\ +test" +""" + +helps['kusto cluster list-follower-database'] = """ + type: command + short-summary: Returns a list of databases that are owned by this cluster and were followed by another cluster. + examples: + - name: KustoClusterListFollowerDatabases + text: |- + az kusto cluster list-follower-database --cluster-name "KustoClusterRPTest4" --resource-group "kustorpte\ +st" +""" + +helps['kusto cluster list-language-extension'] = """ + type: command + short-summary: Returns a list of language extensions that can run within KQL queries. + examples: + - name: KustoClusterListLanguageExtensions + text: |- + az kusto cluster list-language-extension --cluster-name "KustoClusterRPTest4" --resource-group "kustorpt\ +est" +""" + +helps['kusto cluster list-sku'] = """ + type: command + short-summary: Lists eligible SKUs for Kusto resource provider. + examples: + - name: KustoClustersListResourceSkus + text: |- + az kusto cluster list-sku --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto cluster remove-language-extension'] = """ + type: command + short-summary: Remove a list of language extensions that can run within KQL queries. + examples: + - name: KustoClusterRemoveLanguageExtensions + text: |- + az kusto cluster remove-language-extension --cluster-name "KustoClusterRPTest4" --value language-extensi\ +on-name="PYTHON" --value language-extension-name="R" --resource-group "kustorptest" +""" + +helps['kusto cluster start'] = """ + type: command + short-summary: Starts a Kusto cluster. + examples: + - name: KustoClustersStart + text: |- + az kusto cluster start --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto cluster stop'] = """ + type: command + short-summary: Stops a Kusto cluster. + examples: + - name: KustoClustersStop + text: |- + az kusto cluster stop --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto cluster-principal-assignment'] = """ + type: group + short-summary: kusto cluster-principal-assignment +""" + +helps['kusto cluster-principal-assignment list'] = """ + type: command + short-summary: Lists all Kusto cluster principalAssignments. + examples: + - name: KustoPrincipalAssignmentsList + text: |- + az kusto cluster-principal-assignment list --cluster-name "kustoclusterrptest4" --resource-group "kustor\ +ptest" +""" + +helps['kusto cluster-principal-assignment show'] = """ + type: command + short-summary: Gets a Kusto cluster principalAssignment. + examples: + - name: KustoClusterPrincipalAssignmentsGet + text: |- + az kusto cluster-principal-assignment show --cluster-name "kustoclusterrptest4" --principal-assignment-n\ +ame "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto cluster-principal-assignment create'] = """ + type: command + short-summary: Create a Kusto cluster principalAssignment. + examples: + - name: KustoClusterPrincipalAssignmentsCreateOrUpdate + text: |- + az kusto cluster-principal-assignment create --cluster-name "kustoclusterrptest4" --principal-id "876543\ +21-1234-1234-1234-123456789123" --principal-type "App" --role "AllDatabasesAdmin" --tenant-id "12345678-1234-1234-1234-\ +123456789123" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto cluster-principal-assignment update'] = """ + type: command + short-summary: Create a Kusto cluster principalAssignment. + examples: + - name: KustoClusterPrincipalAssignmentsCreateOrUpdate + text: |- + az kusto cluster-principal-assignment update --cluster-name "kustoclusterrptest4" --principal-id "876543\ +21-1234-1234-1234-123456789123" --principal-type "App" --role "AllDatabasesAdmin" --tenant-id "12345678-1234-1234-1234-\ +123456789123" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto cluster-principal-assignment delete'] = """ + type: command + short-summary: Deletes a Kusto cluster principalAssignment. + examples: + - name: KustoClusterPrincipalAssignmentsDelete + text: |- + az kusto cluster-principal-assignment delete --cluster-name "kustoclusterrptest4" --principal-assignment\ +-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto database'] = """ + type: group + short-summary: kusto database +""" + +helps['kusto database list'] = """ + type: command + short-summary: Returns the list of databases of the given Kusto cluster. + examples: + - name: KustoDatabasesListByCluster + text: |- + az kusto database list --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto database show'] = """ + type: command + short-summary: Returns a database. + examples: + - name: KustoDatabasesGet + text: |- + az kusto database show --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --resource-\ +group "kustorptest" +""" + +helps['kusto database create'] = """ + type: command + short-summary: Creates or updates a database. + examples: + - name: KustoDatabasesCreateOrUpdate + text: |- + az kusto database create --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --read-wr\ +ite-database location="westus" soft-delete-period="P1D" --resource-group "kustorptest" +""" + +helps['kusto database update'] = """ + type: command + short-summary: Updates a database. + examples: + - name: KustoDatabasesUpdate + text: |- + az kusto database update --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --read-wr\ +ite-database soft-delete-period="P1D" --resource-group "kustorptest" +""" + +helps['kusto database delete'] = """ + type: command + short-summary: Deletes the database with the given name. + examples: + - name: KustoDatabasesDelete + text: |- + az kusto database delete --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --resourc\ +e-group "kustorptest" +""" + +helps['kusto database add-principal'] = """ + type: command + short-summary: Add Database principals permissions. + examples: + - name: KustoDatabaseAddPrincipals + text: |- + az kusto database add-principal --cluster-name "KustoClusterRPTest4" --database-name "databaseName1" --v\ +alue name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser=some_guid" role="Admin" --value nam\ +e="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup=some_guid" role="Viewer" --value name="SomeA\ +pp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp=some_guid_app_id" role="Admin" --resource-group "kustorpt\ +est" +""" + +helps['kusto database list-principal'] = """ + type: command + short-summary: Returns a list of database principals of the given Kusto cluster and database. + examples: + - name: KustoDatabaseListPrincipals + text: |- + az kusto database list-principal --cluster-name "KustoClusterRPTest4" --database-name "Kustodatabase8" -\ +-resource-group "kustorptest" +""" + +helps['kusto database remove-principal'] = """ + type: command + short-summary: Remove Database principals permissions. + examples: + - name: KustoDatabaseRemovePrincipals + text: |- + az kusto database remove-principal --cluster-name "KustoClusterRPTest4" --database-name "databaseName1" \ +--value name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser=some_guid" role="Admin" --value \ +name="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup=some_guid" role="Viewer" --value name="So\ +meApp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp=some_guid_app_id" role="Admin" --resource-group "kusto\ +rptest" +""" + +helps['kusto database-principal-assignment'] = """ + type: group + short-summary: kusto database-principal-assignment +""" + +helps['kusto database-principal-assignment list'] = """ + type: command + short-summary: Lists all Kusto cluster database principalAssignments. + examples: + - name: KustoPrincipalAssignmentsList + text: |- + az kusto database-principal-assignment list --cluster-name "kustoclusterrptest4" --database-name "Kustod\ +atabase8" --resource-group "kustorptest" +""" + +helps['kusto database-principal-assignment show'] = """ + type: command + short-summary: Gets a Kusto cluster database principalAssignment. + examples: + - name: KustoDatabasePrincipalAssignmentsGet + text: |- + az kusto database-principal-assignment show --cluster-name "kustoclusterrptest4" --database-name "Kustod\ +atabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto database-principal-assignment create'] = """ + type: command + short-summary: Creates a Kusto cluster database principalAssignment. + examples: + - name: KustoDatabasePrincipalAssignmentsCreateOrUpdate + text: |- + az kusto database-principal-assignment create --cluster-name "kustoclusterrptest4" --database-name "Kust\ +odatabase8" --principal-id "87654321-1234-1234-1234-123456789123" --principal-type "App" --role "Admin" --tenant-id "12\ +345678-1234-1234-1234-123456789123" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto database-principal-assignment update'] = """ + type: command + short-summary: Creates a Kusto cluster database principalAssignment. + examples: + - name: KustoDatabasePrincipalAssignmentsCreateOrUpdate + text: |- + az kusto database-principal-assignment update --cluster-name "kustoclusterrptest4" --database-name "Kust\ +odatabase8" --principal-id "87654321-1234-1234-1234-123456789123" --principal-type "App" --role "Admin" --tenant-id "12\ +345678-1234-1234-1234-123456789123" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto database-principal-assignment delete'] = """ + type: command + short-summary: Deletes a Kusto principalAssignment. + examples: + - name: KustoDatabasePrincipalAssignmentsDelete + text: |- + az kusto database-principal-assignment delete --cluster-name "kustoclusterrptest4" --database-name "Kust\ +odatabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto attached-database-configuration'] = """ + type: group + short-summary: kusto attached-database-configuration +""" + +helps['kusto attached-database-configuration list'] = """ + type: command + short-summary: Returns the list of attached database configurations of the given Kusto cluster. + examples: + - name: KustoAttachedDatabaseConfigurationsListByCluster + text: |- + az kusto attached-database-configuration list --cluster-name "KustoClusterRPTest4" --resource-group "kus\ +torptest" +""" + +helps['kusto attached-database-configuration show'] = """ + type: command + short-summary: Returns an attached database configuration. + examples: + - name: AttachedDatabaseConfigurationsGet + text: |- + az kusto attached-database-configuration show --attached-database-configuration-name "attachedDatabaseCo\ +nfigurations1" --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto attached-database-configuration create'] = """ + type: command + short-summary: Creates or updates an attached database configuration. + examples: + - name: AttachedDatabaseConfigurationsCreateOrUpdate + text: |- + az kusto attached-database-configuration create --attached-database-configuration-name "attachedDatabase\ +Configurations1" --cluster-name "KustoClusterRPTest4" --location "westus" --cluster-resource-id "/subscriptions/1234567\ +8-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterLeader" --datab\ +ase-name "Kustodatabase8" --default-principals-modification-kind "Union" --resource-group "kustorptest" +""" + +helps['kusto attached-database-configuration update'] = """ + type: command + short-summary: Creates or updates an attached database configuration. + examples: + - name: AttachedDatabaseConfigurationsCreateOrUpdate + text: |- + az kusto attached-database-configuration update --attached-database-configuration-name "attachedDatabase\ +Configurations1" --cluster-name "KustoClusterRPTest4" --location "westus" --cluster-resource-id "/subscriptions/1234567\ +8-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterLeader" --datab\ +ase-name "Kustodatabase8" --default-principals-modification-kind "Union" --resource-group "kustorptest" +""" + +helps['kusto attached-database-configuration delete'] = """ + type: command + short-summary: Deletes the attached database configuration with the given name. + examples: + - name: AttachedDatabaseConfigurationsDelete + text: |- + az kusto attached-database-configuration delete --attached-database-configuration-name "attachedDatabase\ +Configurations1" --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto data-connection'] = """ + type: group + short-summary: kusto data-connection +""" + +helps['kusto data-connection list'] = """ + type: command + short-summary: Returns the list of data connections of the given Kusto database. + examples: + - name: KustoDatabasesListByCluster + text: |- + az kusto data-connection list --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --re\ +source-group "kustorptest" +""" + +helps['kusto data-connection show'] = """ + type: command + short-summary: Returns a data connection. + examples: + - name: KustoDataConnectionsGet + text: |- + az kusto data-connection show --cluster-name "KustoClusterRPTest4" --data-connection-name "DataConnectio\ +ns8" --database-name "KustoDatabase8" --resource-group "kustorptest" +""" + +helps['kusto data-connection event-grid'] = """ + type: group + short-summary: kusto data-connection sub group event-grid +""" + +helps['kusto data-connection event-grid create'] = """ + type: command + short-summary: Creates or updates a data connection. +""" + +helps['kusto data-connection event-hub'] = """ + type: group + short-summary: kusto data-connection sub group event-hub +""" + +helps['kusto data-connection event-hub create'] = """ + type: command + short-summary: Creates or updates a data connection. + examples: + - name: KustoDataConnectionsCreateOrUpdate + text: |- + az kusto data-connection event-hub create --cluster-name "KustoClusterRPTest4" --data-connection-name "D\ +ataConnections8" --database-name "KustoDatabase8" --location "westus" --consumer-group "testConsumerGroup1" --event-hub\ +-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventH\ +ub/namespaces/eventhubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" +""" + +helps['kusto data-connection iot-hub'] = """ + type: group + short-summary: kusto data-connection sub group iot-hub +""" + +helps['kusto data-connection iot-hub create'] = """ + type: command + short-summary: Creates or updates a data connection. +""" + +helps['kusto data-connection event-grid update'] = """ + type: command + short-summary: Updates a data connection. +""" + +helps['kusto data-connection event-hub update'] = """ + type: command + short-summary: Updates a data connection. + examples: + - name: KustoDataConnectionsUpdate + text: |- + az kusto data-connection event-hub update --cluster-name "KustoClusterRPTest4" --data-connection-name "D\ +ataConnections8" --database-name "KustoDatabase8" --location "westus" --consumer-group "testConsumerGroup1" --event-hub\ +-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventH\ +ub/namespaces/eventhubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" +""" + +helps['kusto data-connection iot-hub update'] = """ + type: command + short-summary: Updates a data connection. +""" + +helps['kusto data-connection delete'] = """ + type: command + short-summary: Deletes the data connection with the given name. + examples: + - name: KustoDataConnectionsDelete + text: |- + az kusto data-connection delete --cluster-name "KustoClusterRPTest4" --data-connection-name "kustoeventh\ +ubconnection1" --database-name "KustoDatabase8" --resource-group "kustorptest" +""" + +helps['kusto data-connection event-grid data-connection-validation'] = """ + type: command + short-summary: Checks that the data connection parameters are valid. +""" + +helps['kusto data-connection event-hub data-connection-validation'] = """ + type: command + short-summary: Checks that the data connection parameters are valid. + examples: + - name: KustoDataConnectionValidation + text: |- + az kusto data-connection event-hub data-connection-validation --cluster-name "KustoClusterRPTest4" --dat\ +abase-name "KustoDatabase8" --data-connection-name "DataConnections8" --consumer-group "testConsumerGroup1" --event-hub\ +-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventH\ +ub/namespaces/eventhubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" +""" + +helps['kusto data-connection iot-hub data-connection-validation'] = """ + type: command + short-summary: Checks that the data connection parameters are valid. +""" + +helps['kusto attached-database-configuration wait'] = """ +type: command +short-summary: Wait for a managed Kusto cluster to reach a desired state. +long-summary: If an operation on a cluster was interrupted or was started with `--no-wait`, use this command to wait for it to complete. +""" + +helps['kusto cluster-principal-assignment wait'] = """ +type: command +short-summary: Wait for a managed Kusto cluster to reach a desired state. +long-summary: If an operation on a cluster was interrupted or was started with `--no-wait`, use this command to wait for it to complete. +""" + +helps['kusto data-connection wait'] = """ +type: command +short-summary: Wait for a managed Kusto cluster to reach a desired state. +long-summary: If an operation on a cluster was interrupted or was started with `--no-wait`, use this command to wait for it to complete. +""" + +helps['kusto database-principal-assignment wait'] = """ +type: command +short-summary: Wait for a managed Kusto cluster to reach a desired state. +long-summary: If an operation on a cluster was interrupted or was started with `--no-wait`, use this command to wait for it to complete. +""" diff --git a/src/kusto/azext_kusto/generated/_params.py b/src/kusto/azext_kusto/generated/_params.py new file mode 100644 index 00000000000..ff17d49df18 --- /dev/null +++ b/src/kusto/azext_kusto/generated/_params.py @@ -0,0 +1,525 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from knack.arguments import CLIArgumentType +from azure.cli.core.commands.parameters import ( + tags_type, + get_three_state_flag, + get_enum_type, + resource_group_name_type, + get_location_type +) +from azure.cli.core.commands.validators import get_default_location_from_resource_group +from azext_kusto.action import ( + AddSku, + AddTrustedExternalTenants, + AddOptimizedAutoscale, + AddVirtualNetworkConfiguration, + AddKeyVaultProperties, + AddLanguageExtensionsValue, + AddReadWriteDatabase, + AddReadOnlyFollowingDatabase, + AddValue +) + + +def load_arguments(self, _): + + with self.argument_context('kusto cluster list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('kusto cluster show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + + with self.argument_context('kusto cluster create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('tags', tags_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('sku', action=AddSku, nargs='+', help='The SKU of the cluster. Expect value: KEY1=VALUE1 KEY2=VALUE2' + ' ... , available KEYs are: name, capacity, tier.') + c.argument('zones', nargs='+', help='The availability zones of the cluster. Expected value: json-string/@json-f' + 'ile.') + c.argument('trusted_external_tenants', action=AddTrustedExternalTenants, nargs='+', help='The cluster\'s extern' + 'al tenants. Expect value: value=xx.') + c.argument('optimized_autoscale', action=AddOptimizedAutoscale, nargs='+', help='Optimized auto scale definitio' + 'n. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: version, is-enabled, minimum, ma' + 'ximum.') + c.argument('enable_disk_encryption', arg_type=get_three_state_flag(), help='A boolean value that indicates if t' + 'he cluster\'s disks are encrypted.') + c.argument('enable_streaming_ingest', arg_type=get_three_state_flag(), help='A boolean value that indicates if ' + 'the streaming ingest is enabled.') + c.argument('virtual_network_configuration', action=AddVirtualNetworkConfiguration, nargs='+', help='Virtual net' + 'work definition. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: subnet-id, engine-' + 'public-ip-id, data-management-public-ip-id.') + c.argument('key_vault_properties', action=AddKeyVaultProperties, nargs='+', help='KeyVault properties for the c' + 'luster encryption. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: key-name, key-ve' + 'rsion, key-vault-uri.') + c.argument('enable_purge', arg_type=get_three_state_flag(), help='A boolean value that indicates if the purge o' + 'perations are enabled.') + c.argument('language_extensions_value', action=AddLanguageExtensionsValue, nargs='+', help='The list of languag' + 'e extensions. Expect value: language-extension-name=xx.') + c.argument('identity_type', arg_type=get_enum_type(['None', 'SystemAssigned']), help='The identity type.') + c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigned-identities'], help='The list of user identities associated with the Kusto cluster. The user identity dictionary key references will be ARM resource ids in the form: \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}\'. Expected value: json-string/@json-file.')) + + with self.argument_context('kusto cluster update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('tags', tags_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('sku', action=AddSku, nargs='+', help='The SKU of the cluster. Expect value: KEY1=VALUE1 KEY2=VALUE2' + ' ... , available KEYs are: name, capacity, tier.') + c.argument('trusted_external_tenants', action=AddTrustedExternalTenants, nargs='+', help='The cluster\'s extern' + 'al tenants. Expect value: value=xx.') + c.argument('optimized_autoscale', action=AddOptimizedAutoscale, nargs='+', help='Optimized auto scale definitio' + 'n. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: version, is-enabled, minimum, ma' + 'ximum.') + c.argument('enable_disk_encryption', arg_type=get_three_state_flag(), help='A boolean value that indicates if t' + 'he cluster\'s disks are encrypted.') + c.argument('enable_streaming_ingest', arg_type=get_three_state_flag(), help='A boolean value that indicates if ' + 'the streaming ingest is enabled.') + c.argument('virtual_network_configuration', action=AddVirtualNetworkConfiguration, nargs='+', help='Virtual net' + 'work definition. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: subnet-id, engine-' + 'public-ip-id, data-management-public-ip-id.') + c.argument('key_vault_properties', action=AddKeyVaultProperties, nargs='+', help='KeyVault properties for the c' + 'luster encryption. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: key-name, key-ve' + 'rsion, key-vault-uri.') + c.argument('enable_purge', arg_type=get_three_state_flag(), help='A boolean value that indicates if the purge o' + 'perations are enabled.') + c.argument('language_extensions_value', action=AddLanguageExtensionsValue, nargs='+', help='The list of languag' + 'e extensions. Expect value: language-extension-name=xx.') + c.argument('identity_type', arg_type=get_enum_type(['None', 'SystemAssigned']), help='The identity type.') + c.argument('identity_user_assigned_identities', arg_type=CLIArgumentType(options_list=['--identity-user-assigned-identities'], help='The list of user identities associated with the Kusto cluster. The user identity dictionary key references will be ARM resource ids in the form: \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}\'. Expected value: json-string/@json-file.')) + + with self.argument_context('kusto cluster delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + + with self.argument_context('kusto cluster add-language-extension') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('value', action=AddLanguageExtensionsValue, nargs='+', help='The list of language extensions. Expect' + ' value: language-extension-name=xx.') + + with self.argument_context('kusto cluster detach-follower-database') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('cluster_resource_id', help='Resource id of the cluster that follows a database owned by this cluste' + 'r.') + c.argument('attached_database_configuration_name', help='Resource name of the attached database configuration i' + 'n the follower cluster.') + + with self.argument_context('kusto cluster diagnose-virtual-network') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + + with self.argument_context('kusto cluster list-follower-database') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + + with self.argument_context('kusto cluster list-language-extension') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + + with self.argument_context('kusto cluster list-sku') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + + with self.argument_context('kusto cluster remove-language-extension') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('value', action=AddLanguageExtensionsValue, nargs='+', help='The list of language extensions. Expect' + ' value: language-extension-name=xx.') + + with self.argument_context('kusto cluster start') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + + with self.argument_context('kusto cluster stop') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + + with self.argument_context('kusto cluster-principal-assignment list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + + with self.argument_context('kusto cluster-principal-assignment show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') + + with self.argument_context('kusto cluster-principal-assignment create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') + c.argument('principal_id', help='The principal ID assigned to the cluster principal. It can be a user email, ap' + 'plication ID, or security group name.') + c.argument('role', arg_type=get_enum_type(['AllDatabasesAdmin', 'AllDatabasesViewer']), help='Cluster principal' + ' role.') + c.argument('tenant_id', help='The tenant id of the principal') + c.argument('principal_type', arg_type=get_enum_type(['App', 'Group', 'User']), help='Principal type.') + + with self.argument_context('kusto cluster-principal-assignment update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') + c.argument('principal_id', help='The principal ID assigned to the cluster principal. It can be a user email, ap' + 'plication ID, or security group name.') + c.argument('role', arg_type=get_enum_type(['AllDatabasesAdmin', 'AllDatabasesViewer']), help='Cluster principal' + ' role.') + c.argument('tenant_id', help='The tenant id of the principal') + c.argument('principal_type', arg_type=get_enum_type(['App', 'Group', 'User']), help='Principal type.') + + with self.argument_context('kusto cluster-principal-assignment delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') + + with self.argument_context('kusto database list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + + with self.argument_context('kusto database show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + + with self.argument_context('kusto database create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('read_write_database', action=AddReadWriteDatabase, nargs='+', help='Class representing a read write' + ' database. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: soft-delete-period, hot-' + 'cache-period, location.', arg_group='Parameters') + c.argument('read_only_following_database', action=AddReadOnlyFollowingDatabase, nargs='+', help='Class represen' + 'ting a read only following database. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are' + ': hot-cache-period, location.', arg_group='Parameters') + + with self.argument_context('kusto database update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('read_write_database', action=AddReadWriteDatabase, nargs='+', help='Class representing a read write' + ' database. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: soft-delete-period, hot-' + 'cache-period, location.', arg_group='Parameters') + c.argument('read_only_following_database', action=AddReadOnlyFollowingDatabase, nargs='+', help='Class represen' + 'ting a read only following database. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are' + ': hot-cache-period, location.', arg_group='Parameters') + + with self.argument_context('kusto database delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + + with self.argument_context('kusto database add-principal') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('value', action=AddValue, nargs='+', help='The list of Kusto database principals. Expect value: KEY1' + '=VALUE1 KEY2=VALUE2 ... , available KEYs are: role, name, type, fqn, email, app-id.') + + with self.argument_context('kusto database list-principal') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + + with self.argument_context('kusto database remove-principal') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('value', action=AddValue, nargs='+', help='The list of Kusto database principals. Expect value: KEY1' + '=VALUE1 KEY2=VALUE2 ... , available KEYs are: role, name, type, fqn, email, app-id.') + + with self.argument_context('kusto database-principal-assignment list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + + with self.argument_context('kusto database-principal-assignment show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') + + with self.argument_context('kusto database-principal-assignment create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') + c.argument('principal_id', help='The principal ID assigned to the database principal. It can be a user email, a' + 'pplication ID, or security group name.') + c.argument('role', arg_type=get_enum_type(['Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'View' + 'er']), help='Database principal role.') + c.argument('tenant_id', help='The tenant id of the principal') + c.argument('principal_type', arg_type=get_enum_type(['App', 'Group', 'User']), help='Principal type.') + + with self.argument_context('kusto database-principal-assignment update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') + c.argument('principal_id', help='The principal ID assigned to the database principal. It can be a user email, a' + 'pplication ID, or security group name.') + c.argument('role', arg_type=get_enum_type(['Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'View' + 'er']), help='Database principal role.') + c.argument('tenant_id', help='The tenant id of the principal') + c.argument('principal_type', arg_type=get_enum_type(['App', 'Group', 'User']), help='Principal type.') + + with self.argument_context('kusto database-principal-assignment delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('principal_assignment_name', help='The name of the Kusto principalAssignment.') + + with self.argument_context('kusto attached-database-configuration list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + + with self.argument_context('kusto attached-database-configuration show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('attached_database_configuration_name', help='The name of the attached database configuration.') + + with self.argument_context('kusto attached-database-configuration create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('attached_database_configuration_name', help='The name of the attached database configuration.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('database_name', help='The name of the database which you would like to attach, use * if you want to' + ' follow all current and future databases.') + c.argument('cluster_resource_id', help='The resource id of the cluster where the databases you would like to at' + 'tach reside.') + c.argument('default_principals_modification_kind', arg_type=get_enum_type(['Union', 'Replace', 'None']), help='The default principals modification kind') + + with self.argument_context('kusto attached-database-configuration update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('attached_database_configuration_name', help='The name of the attached database configuration.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('database_name', help='The name of the database which you would like to attach, use * if you want to' + ' follow all current and future databases.') + c.argument('cluster_resource_id', help='The resource id of the cluster where the databases you would like to at' + 'tach reside.') + c.argument('default_principals_modification_kind', arg_type=get_enum_type(['Union', 'Replace', 'None']), help='The default principals modification kind') + + with self.argument_context('kusto attached-database-configuration delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('attached_database_configuration_name', help='The name of the attached database configuration.') + + with self.argument_context('kusto data-connection list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + + with self.argument_context('kusto data-connection show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('data_connection_name', help='The name of the data connection.') + + with self.argument_context('kusto data-connection event-grid create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('data_connection_name', help='The name of the data connection.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('storage_account_resource_id', + help='The resource ID of the storage account where the data resides.') + c.argument('event_hub_resource_id', help='The resource ID where the event grid is configured to send events.') + c.argument('consumer_group', help='The event hub consumer group.') + c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' + 'n be added to each message.') + c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' + 'formation can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' + ' Optionally the data format can be added to each message.') + + with self.argument_context('kusto data-connection event-hub create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('data_connection_name', help='The name of the data connection.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('event_hub_resource_id', help='The resource ID of the event hub to be used to create a data connecti' + 'on.') + c.argument('consumer_group', help='The event hub consumer group.') + c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' + 'n be added to each message.') + c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' + 'formation can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' + ' Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='+', help='System properties of the event hub Expected value: json-' + 'string/@json-file.') + c.argument('compression', arg_type=get_enum_type(['None', 'GZip']), help='The event hub messages compression ty' + 'pe') + + with self.argument_context('kusto data-connection iot-hub create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('data_connection_name', help='The name of the data connection.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('iot_hub_resource_id', + help='The resource ID of the Iot hub to be used to create a data connection.') + c.argument('consumer_group', help='The iot hub consumer group.') + c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' + 'n be added to each message.') + c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' + 'formation can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' + ' Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='+', help='System properties of the iot hub Expected value: json-st' + 'ring/@json-file.') + c.argument('shared_access_policy_name', help='The name of the share access policy') + + with self.argument_context('kusto data-connection event-grid update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('data_connection_name', help='The name of the data connection.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('storage_account_resource_id', + help='The resource ID of the storage account where the data resides.') + c.argument('event_hub_resource_id', help='The resource ID where the event grid is configured to send events.') + c.argument('consumer_group', help='The event hub consumer group.') + c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' + 'n be added to each message.') + c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' + 'formation can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' + ' Optionally the data format can be added to each message.') + + with self.argument_context('kusto data-connection event-hub update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('data_connection_name', help='The name of the data connection.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('event_hub_resource_id', help='The resource ID of the event hub to be used to create a data connecti' + 'on.') + c.argument('consumer_group', help='The event hub consumer group.') + c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' + 'n be added to each message.') + c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' + 'formation can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' + ' Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='+', help='System properties of the event hub Expected value: json-' + 'string/@json-file.') + c.argument('compression', arg_type=get_enum_type(['None', 'GZip']), help='The event hub messages compression ty' + 'pe') + + with self.argument_context('kusto data-connection iot-hub update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('data_connection_name', help='The name of the data connection.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('iot_hub_resource_id', + help='The resource ID of the Iot hub to be used to create a data connection.') + c.argument('consumer_group', help='The iot hub consumer group.') + c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' + 'n be added to each message.') + c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' + 'formation can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' + ' Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='+', help='System properties of the iot hub Expected value: json-st' + 'ring/@json-file.') + c.argument('shared_access_policy_name', help='The name of the share access policy') + + with self.argument_context('kusto data-connection delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('data_connection_name', help='The name of the data connection.') + + with self.argument_context('kusto data-connection event-grid data-connection-validation') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('data_connection_name', help='The name of the data connection.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('storage_account_resource_id', + help='The resource ID of the storage account where the data resides.') + c.argument('event_hub_resource_id', help='The resource ID where the event grid is configured to send events.') + c.argument('consumer_group', help='The event hub consumer group.') + c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' + 'n be added to each message.') + c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' + 'formation can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' + ' Optionally the data format can be added to each message.') + + with self.argument_context('kusto data-connection event-hub data-connection-validation') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('data_connection_name', help='The name of the data connection.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('event_hub_resource_id', help='The resource ID of the event hub to be used to create a data connecti' + 'on.') + c.argument('consumer_group', help='The event hub consumer group.') + c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' + 'n be added to each message.') + c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' + 'formation can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' + ' Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='+', help='System properties of the event hub Expected value: json-' + 'string/@json-file.') + c.argument('compression', arg_type=get_enum_type(['None', 'GZip']), help='The event hub messages compression ty' + 'pe') + + with self.argument_context('kusto data-connection iot-hub data-connection-validation') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('cluster_name', help='The name of the Kusto cluster.') + c.argument('database_name', help='The name of the database in the Kusto cluster.') + c.argument('data_connection_name', help='The name of the data connection.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('iot_hub_resource_id', + help='The resource ID of the Iot hub to be used to create a data connection.') + c.argument('consumer_group', help='The iot hub consumer group.') + c.argument('table_name', help='The table where the data should be ingested. Optionally the table information ca' + 'n be added to each message.') + c.argument('mapping_rule_name', help='The mapping rule to be used to ingest the data. Optionally the mapping in' + 'formation can be added to each message.') + c.argument('data_format', arg_type=get_enum_type(['MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'T' + 'XT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC']), help='The data format of the message.' + ' Optionally the data format can be added to each message.') + c.argument('event_system_properties', nargs='+', help='System properties of the iot hub Expected value: json-st' + 'ring/@json-file.') + c.argument('shared_access_policy_name', help='The name of the share access policy') diff --git a/src/kusto/azext_kusto/generated/_validators.py b/src/kusto/azext_kusto/generated/_validators.py new file mode 100644 index 00000000000..7536d0531ea --- /dev/null +++ b/src/kusto/azext_kusto/generated/_validators.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +def example_name_or_id_validator(cmd, namespace): + from azure.cli.core.commands.client_factory import get_subscription_id + from msrestazure.tools import is_valid_resource_id, resource_id + if namespace.storage_account: + if not is_valid_resource_id(namespace.RESOURCE): + namespace.storage_account = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), + resource_group=namespace.resource_group_name, + namespace='Microsoft.Storage', + type='storageAccounts', + name=namespace.storage_account + ) diff --git a/src/kusto/azext_kusto/generated/action.py b/src/kusto/azext_kusto/generated/action.py new file mode 100644 index 00000000000..c5c7ef27a7c --- /dev/null +++ b/src/kusto/azext_kusto/generated/action.py @@ -0,0 +1,248 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access + +import argparse +from knack.util import CLIError +from collections import defaultdict + + +class AddSku(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.sku = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'name': + d['name'] = v[0] + elif kl == 'capacity': + d['capacity'] = v[0] + elif kl == 'tier': + d['tier'] = v[0] + return d + + +class AddTrustedExternalTenants(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddTrustedExternalTenants, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'value': + d['value'] = v[0] + return d + + +class AddOptimizedAutoscale(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.optimized_autoscale = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'version': + d['version'] = v[0] + elif kl == 'is-enabled': + d['is_enabled'] = v[0] + elif kl == 'minimum': + d['minimum'] = v[0] + elif kl == 'maximum': + d['maximum'] = v[0] + return d + + +class AddVirtualNetworkConfiguration(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.virtual_network_configuration = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'subnet-id': + d['subnet_id'] = v[0] + elif kl == 'engine-public-ip-id': + d['engine_public_ip_id'] = v[0] + elif kl == 'data-management-public-ip-id': + d['data_management_public_ip_id'] = v[0] + return d + + +class AddKeyVaultProperties(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.key_vault_properties = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'key-name': + d['key_name'] = v[0] + elif kl == 'key-version': + d['key_version'] = v[0] + elif kl == 'key-vault-uri': + d['key_vault_uri'] = v[0] + return d + + +class AddLanguageExtensionsValue(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddLanguageExtensionsValue, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'language-extension-name': + d['language_extension_name'] = v[0] + return d + + +class AddReadWriteDatabase(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.read_write_database = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'soft-delete-period': + d['soft_delete_period'] = v[0] + elif kl == 'hot-cache-period': + d['hot_cache_period'] = v[0] + elif kl == 'location': + d['location'] = v[0] + d['kind'] = 'ReadWrite' + return d + + +class AddReadOnlyFollowingDatabase(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.read_only_following_database = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'hot-cache-period': + d['hot_cache_period'] = v[0] + elif kl == 'location': + d['location'] = v[0] + d['kind'] = 'ReadOnlyFollowing' + return d + + +class AddValue(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddValue, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'role': + d['role'] = v[0] + elif kl == 'name': + d['name'] = v[0] + elif kl == 'type': + d['type'] = v[0] + elif kl == 'fqn': + d['fqn'] = v[0] + elif kl == 'email': + d['email'] = v[0] + elif kl == 'app-id': + d['app_id'] = v[0] + return d diff --git a/src/kusto/azext_kusto/generated/commands.py b/src/kusto/azext_kusto/generated/commands.py new file mode 100644 index 00000000000..3058e404f8a --- /dev/null +++ b/src/kusto/azext_kusto/generated/commands.py @@ -0,0 +1,117 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_kusto.generated._client_factory import cf_cluster + kusto_cluster = CliCommandType( + operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._cluster_operations#ClusterOperations.{}', + client_factory=cf_cluster) + with self.command_group('kusto cluster', kusto_cluster, client_factory=cf_cluster, is_experimental=True) as g: + g.custom_command('list', 'kusto_cluster_list') + g.custom_show_command('show', 'kusto_cluster_show') + g.custom_command('create', 'kusto_cluster_create', supports_no_wait=True) + g.custom_command('update', 'kusto_cluster_update', supports_no_wait=True) + g.custom_command('delete', 'kusto_cluster_delete', supports_no_wait=True) + g.custom_command('add-language-extension', 'kusto_cluster_add_language_extension', supports_no_wait=True) + g.custom_command('detach-follower-database', 'kusto_cluster_detach_follower_database', supports_no_wait=True) + g.custom_command('diagnose-virtual-network', 'kusto_cluster_diagnose_virtual_network', supports_no_wait=True) + g.custom_command('list-follower-database', 'kusto_cluster_list_follower_database') + g.custom_command('list-language-extension', 'kusto_cluster_list_language_extension') + g.custom_command('list-sku', 'kusto_cluster_list_sku') + g.custom_command('remove-language-extension', 'kusto_cluster_remove_language_extension', + supports_no_wait=True) + g.custom_command('start', 'kusto_cluster_start', supports_no_wait=True) + g.custom_command('stop', 'kusto_cluster_stop', supports_no_wait=True) + g.wait_command('wait') + + from azext_kusto.generated._client_factory import cf_cluster_principal_assignment + kusto_cluster_principal_assignment = CliCommandType( + operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._cluster_principal_assignment_operations#ClusterPri' + 'ncipalAssignmentOperations.{}', + client_factory=cf_cluster_principal_assignment) + with self.command_group('kusto cluster-principal-assignment', kusto_cluster_principal_assignment, + client_factory=cf_cluster_principal_assignment, is_experimental=True) as g: + g.custom_command('list', 'kusto_cluster_principal_assignment_list') + g.custom_show_command('show', 'kusto_cluster_principal_assignment_show') + g.custom_command('create', 'kusto_cluster_principal_assignment_create', supports_no_wait=True) + g.custom_command('update', 'kusto_cluster_principal_assignment_update', supports_no_wait=True) + g.custom_command('delete', 'kusto_cluster_principal_assignment_delete', supports_no_wait=True) + g.wait_command('wait') + + from azext_kusto.generated._client_factory import cf_database + kusto_database = CliCommandType( + operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._database_operations#DatabaseOperations.{}', + client_factory=cf_database) + with self.command_group('kusto database', kusto_database, client_factory=cf_database, is_experimental=True) as g: + g.custom_command('list', 'kusto_database_list') + g.custom_show_command('show', 'kusto_database_show') + g.custom_command('create', 'kusto_database_create', supports_no_wait=True) + g.custom_command('update', 'kusto_database_update', supports_no_wait=True) + g.custom_command('delete', 'kusto_database_delete', supports_no_wait=True) + g.custom_command('add-principal', 'kusto_database_add_principal') + g.custom_command('list-principal', 'kusto_database_list_principal') + g.custom_command('remove-principal', 'kusto_database_remove_principal') + g.wait_command('wait') + + from azext_kusto.generated._client_factory import cf_database_principal_assignment + kusto_database_principal_assignment = CliCommandType( + operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._database_principal_assignment_operations#DatabaseP' + 'rincipalAssignmentOperations.{}', + client_factory=cf_database_principal_assignment) + with self.command_group('kusto database-principal-assignment', kusto_database_principal_assignment, + client_factory=cf_database_principal_assignment, is_experimental=True) as g: + g.custom_command('list', 'kusto_database_principal_assignment_list') + g.custom_show_command('show', 'kusto_database_principal_assignment_show') + g.custom_command('create', 'kusto_database_principal_assignment_create', supports_no_wait=True) + g.custom_command('update', 'kusto_database_principal_assignment_update', supports_no_wait=True) + g.custom_command('delete', 'kusto_database_principal_assignment_delete', supports_no_wait=True) + g.wait_command('wait') + + from azext_kusto.generated._client_factory import cf_attached_database_configuration + kusto_attached_database_configuration = CliCommandType( + operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._attached_database_configuration_operations#Attache' + 'dDatabaseConfigurationOperations.{}', + client_factory=cf_attached_database_configuration) + with self.command_group('kusto attached-database-configuration', kusto_attached_database_configuration, + client_factory=cf_attached_database_configuration, is_experimental=True) as g: + g.custom_command('list', 'kusto_attached_database_configuration_list') + g.custom_show_command('show', 'kusto_attached_database_configuration_show') + g.custom_command('create', 'kusto_attached_database_configuration_create', supports_no_wait=True) + g.custom_command('update', 'kusto_attached_database_configuration_update', supports_no_wait=True) + g.custom_command('delete', 'kusto_attached_database_configuration_delete', supports_no_wait=True) + g.wait_command('wait') + + from azext_kusto.generated._client_factory import cf_data_connection + kusto_data_connection = CliCommandType( + operations_tmpl='azext_kusto.vendored_sdks.kusto.operations._data_connection_operations#DataConnectionOperation' + 's.{}', + client_factory=cf_data_connection) + with self.command_group('kusto data-connection', kusto_data_connection, client_factory=cf_data_connection, + is_experimental=True) as g: + g.custom_command('list', 'kusto_data_connection_list') + g.custom_show_command('show', 'kusto_data_connection_show') + g.custom_command('event-grid create', 'kusto_data_connection_event_grid_create', supports_no_wait=True) + g.custom_command('event-hub create', 'kusto_data_connection_event_hub_create', supports_no_wait=True) + g.custom_command('iot-hub create', 'kusto_data_connection_iot_hub_create', supports_no_wait=True) + g.custom_command('event-grid update', 'kusto_data_connection_event_grid_update', supports_no_wait=True) + g.custom_command('event-hub update', 'kusto_data_connection_event_hub_update', supports_no_wait=True) + g.custom_command('iot-hub update', 'kusto_data_connection_iot_hub_update', supports_no_wait=True) + g.custom_command('delete', 'kusto_data_connection_delete', supports_no_wait=True) + g.custom_command('event-grid data-connection-validation', 'kusto_data_connection_event_grid_data_connection_val' + 'idation') + g.custom_command('event-hub data-connection-validation', 'kusto_data_connection_event_hub_data_connection_valid' + 'ation') + g.custom_command('iot-hub data-connection-validation', 'kusto_data_connection_iot_hub_data_connection_validatio' + 'n') + g.wait_command('wait') diff --git a/src/kusto/azext_kusto/generated/custom.py b/src/kusto/azext_kusto/generated/custom.py new file mode 100644 index 00000000000..7e9cc01e8d8 --- /dev/null +++ b/src/kusto/azext_kusto/generated/custom.py @@ -0,0 +1,778 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=line-too-long +# pylint: disable=too-many-lines + +import json +from knack.util import CLIError + + +def kusto_cluster_list(client, + resource_group_name=None): + if resource_group_name is not None: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list() + + +def kusto_cluster_show(client, + resource_group_name, + cluster_name): + return client.get(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_create(client, + resource_group_name, + cluster_name, + location, + sku, + tags=None, + zones=None, + trusted_external_tenants=None, + optimized_autoscale=None, + enable_disk_encryption=None, + enable_streaming_ingest=None, + virtual_network_configuration=None, + key_vault_properties=None, + enable_purge=None, + language_extensions_value=None, + identity_type=None, + identity_user_assigned_identities=None): + if isinstance(zones, str): + zones = json.loads(zones) + if isinstance(identity_user_assigned_identities, str): + identity_user_assigned_identities = json.loads(identity_user_assigned_identities) + return client.begin_create_or_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + tags=tags, + location=location, + sku=sku, + zones=zones, + trusted_external_tenants=trusted_external_tenants, + optimized_autoscale=optimized_autoscale, + enable_disk_encryption=enable_disk_encryption, + enable_streaming_ingest=enable_streaming_ingest, + virtual_network_configuration=virtual_network_configuration, + key_vault_properties=key_vault_properties, + enable_purge=enable_purge, + value=language_extensions_value, + type=identity_type, + user_assigned_identities=identity_user_assigned_identities) + + +def kusto_cluster_update(client, + resource_group_name, + cluster_name, + tags=None, + location=None, + sku=None, + trusted_external_tenants=None, + optimized_autoscale=None, + enable_disk_encryption=None, + enable_streaming_ingest=None, + virtual_network_configuration=None, + key_vault_properties=None, + enable_purge=None, + language_extensions_value=None, + identity_type=None, + identity_user_assigned_identities=None): + if isinstance(identity_user_assigned_identities, str): + identity_user_assigned_identities = json.loads(identity_user_assigned_identities) + return client.begin_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + tags=tags, + location=location, + sku=sku, + trusted_external_tenants=trusted_external_tenants, + optimized_autoscale=optimized_autoscale, + enable_disk_encryption=enable_disk_encryption, + enable_streaming_ingest=enable_streaming_ingest, + virtual_network_configuration=virtual_network_configuration, + key_vault_properties=key_vault_properties, + enable_purge=enable_purge, + value=language_extensions_value, + type=identity_type, + user_assigned_identities=identity_user_assigned_identities) + + +def kusto_cluster_delete(client, + resource_group_name, + cluster_name): + return client.begin_delete(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_add_language_extension(client, + resource_group_name, + cluster_name, + value=None): + return client.begin_add_language_extension(resource_group_name=resource_group_name, + cluster_name=cluster_name, + value=value) + + +def kusto_cluster_detach_follower_database(client, + resource_group_name, + cluster_name, + cluster_resource_id, + attached_database_configuration_name): + return client.begin_detach_follower_database(resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_resource_id=cluster_resource_id, + attached_database_configuration_name=attached_database_configuration_name) + + +def kusto_cluster_diagnose_virtual_network(client, + resource_group_name, + cluster_name): + return client.begin_diagnose_virtual_network(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_list_follower_database(client, + resource_group_name, + cluster_name): + return client.list_follower_database(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_list_language_extension(client, + resource_group_name, + cluster_name): + return client.list_language_extension(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_list_sku(client, + resource_group_name=None, + cluster_name=None): + if resource_group_name is not None and cluster_name is not None: + return client.list_sku_by_resource(resource_group_name=resource_group_name, + cluster_name=cluster_name) + return client.list_sku() + + +def kusto_cluster_remove_language_extension(client, + resource_group_name, + cluster_name, + value=None): + return client.begin_remove_language_extension(resource_group_name=resource_group_name, + cluster_name=cluster_name, + value=value) + + +def kusto_cluster_start(client, + resource_group_name, + cluster_name): + return client.begin_start(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_stop(client, + resource_group_name, + cluster_name): + return client.begin_stop(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_principal_assignment_list(client, + resource_group_name, + cluster_name): + return client.list(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_cluster_principal_assignment_show(client, + resource_group_name, + cluster_name, + principal_assignment_name): + return client.get(resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name) + + +def kusto_cluster_principal_assignment_create(client, + resource_group_name, + cluster_name, + principal_assignment_name, + principal_id=None, + role=None, + tenant_id=None, + principal_type=None): + return client.begin_create_or_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type) + + +def kusto_cluster_principal_assignment_update(client, + resource_group_name, + cluster_name, + principal_assignment_name, + principal_id=None, + role=None, + tenant_id=None, + principal_type=None): + return client.begin_create_or_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type) + + +def kusto_cluster_principal_assignment_delete(client, + resource_group_name, + cluster_name, + principal_assignment_name): + return client.begin_delete(resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name) + + +def kusto_database_list(client, + resource_group_name, + cluster_name): + return client.list_by_cluster(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_database_show(client, + resource_group_name, + cluster_name, + database_name): + return client.get(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name) + + +def kusto_database_create(client, + resource_group_name, + cluster_name, + database_name, + read_write_database=None, + read_only_following_database=None): + all_parameters = [] + if read_write_database is not None: + all_parameters.append(read_write_database) + if read_only_following_database is not None: + all_parameters.append(read_only_following_database) + if len(all_parameters) > 1: + raise CLIError('at most one of read_write_database, read_only_following_database is needed for parameters!') + if len(all_parameters) != 1: + raise CLIError('parameters is required. but none of read_write_database, read_only_following_database is provid' + 'ed!') + parameters = all_parameters[0] if len(all_parameters) == 1 else None + return client.begin_create_or_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters) + + +def kusto_database_update(client, + resource_group_name, + cluster_name, + database_name, + read_write_database=None, + read_only_following_database=None): + all_parameters = [] + if read_write_database is not None: + all_parameters.append(read_write_database) + if read_only_following_database is not None: + all_parameters.append(read_only_following_database) + if len(all_parameters) > 1: + raise CLIError('at most one of read_write_database, read_only_following_database is needed for parameters!') + if len(all_parameters) != 1: + raise CLIError('parameters is required. but none of read_write_database, read_only_following_database is provid' + 'ed!') + parameters = all_parameters[0] if len(all_parameters) == 1 else None + return client.begin_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters) + + +def kusto_database_delete(client, + resource_group_name, + cluster_name, + database_name): + return client.begin_delete(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name) + + +def kusto_database_add_principal(client, + resource_group_name, + cluster_name, + database_name, + value=None): + return client.add_principal(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + value=value) + + +def kusto_database_list_principal(client, + resource_group_name, + cluster_name, + database_name): + return client.list_principal(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name) + + +def kusto_database_remove_principal(client, + resource_group_name, + cluster_name, + database_name, + value=None): + return client.remove_principal(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + value=value) + + +def kusto_database_principal_assignment_list(client, + resource_group_name, + cluster_name, + database_name): + return client.list(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name) + + +def kusto_database_principal_assignment_show(client, + resource_group_name, + cluster_name, + database_name, + principal_assignment_name): + return client.get(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name) + + +def kusto_database_principal_assignment_create(client, + resource_group_name, + cluster_name, + database_name, + principal_assignment_name, + principal_id=None, + role=None, + tenant_id=None, + principal_type=None): + return client.begin_create_or_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type) + + +def kusto_database_principal_assignment_update(client, + resource_group_name, + cluster_name, + database_name, + principal_assignment_name, + principal_id=None, + role=None, + tenant_id=None, + principal_type=None): + return client.begin_create_or_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type) + + +def kusto_database_principal_assignment_delete(client, + resource_group_name, + cluster_name, + database_name, + principal_assignment_name): + return client.begin_delete(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name) + + +def kusto_attached_database_configuration_list(client, + resource_group_name, + cluster_name): + return client.list_by_cluster(resource_group_name=resource_group_name, + cluster_name=cluster_name) + + +def kusto_attached_database_configuration_show(client, + resource_group_name, + cluster_name, + attached_database_configuration_name): + return client.get(resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name) + + +def kusto_attached_database_configuration_create(client, + resource_group_name, + cluster_name, + attached_database_configuration_name, + location=None, + database_name=None, + cluster_resource_id=None, + default_principals_modification_kind=None): + return client.begin_create_or_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + location=location, + database_name=database_name, + cluster_resource_id=cluster_resource_id, + default_principals_modification_kind=default_principals_modification_kind) + + +def kusto_attached_database_configuration_update(client, + resource_group_name, + cluster_name, + attached_database_configuration_name, + location=None, + database_name=None, + cluster_resource_id=None, + default_principals_modification_kind=None): + return client.begin_create_or_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + location=location, + database_name=database_name, + cluster_resource_id=cluster_resource_id, + default_principals_modification_kind=default_principals_modification_kind) + + +def kusto_attached_database_configuration_delete(client, + resource_group_name, + cluster_name, + attached_database_configuration_name): + return client.begin_delete(resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name) + + +def kusto_data_connection_list(client, + resource_group_name, + cluster_name, + database_name): + return client.list_by_database(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name) + + +def kusto_data_connection_show(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name): + return client.get(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name) + + +def kusto_data_connection_event_grid_create(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name, + location=None, + storage_account_resource_id=None, + event_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None): + parameters = {} + parameters['location'] = location + parameters['kind'] = 'EventGrid' + parameters['storage_account_resource_id'] = storage_account_resource_id + parameters['event_hub_resource_id'] = event_hub_resource_id + parameters['consumer_group'] = consumer_group + parameters['table_name'] = table_name + parameters['mapping_rule_name'] = mapping_rule_name + parameters['data_format'] = data_format + return client.begin_create_or_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) + + +def kusto_data_connection_event_hub_create(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name, + location=None, + event_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None, + event_system_properties=None, + compression=None): + if isinstance(event_system_properties, str): + event_system_properties = json.loads(event_system_properties) + parameters = {} + parameters['location'] = location + parameters['kind'] = 'EventHub' + parameters['event_hub_resource_id'] = event_hub_resource_id + parameters['consumer_group'] = consumer_group + parameters['table_name'] = table_name + parameters['mapping_rule_name'] = mapping_rule_name + parameters['data_format'] = data_format + parameters['event_system_properties'] = event_system_properties + parameters['compression'] = compression + return client.begin_create_or_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) + + +def kusto_data_connection_iot_hub_create(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name, + location=None, + iot_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None, + event_system_properties=None, + shared_access_policy_name=None): + if isinstance(event_system_properties, str): + event_system_properties = json.loads(event_system_properties) + parameters = {} + parameters['location'] = location + parameters['kind'] = 'IotHub' + parameters['iot_hub_resource_id'] = iot_hub_resource_id + parameters['consumer_group'] = consumer_group + parameters['table_name'] = table_name + parameters['mapping_rule_name'] = mapping_rule_name + parameters['data_format'] = data_format + parameters['event_system_properties'] = event_system_properties + parameters['shared_access_policy_name'] = shared_access_policy_name + return client.begin_create_or_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) + + +def kusto_data_connection_event_grid_update(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name, + location=None, + storage_account_resource_id=None, + event_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None): + parameters = {} + parameters['location'] = location + parameters['kind'] = 'EventGrid' + parameters['storage_account_resource_id'] = storage_account_resource_id + parameters['event_hub_resource_id'] = event_hub_resource_id + parameters['consumer_group'] = consumer_group + parameters['table_name'] = table_name + parameters['mapping_rule_name'] = mapping_rule_name + parameters['data_format'] = data_format + return client.begin_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) + + +def kusto_data_connection_event_hub_update(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name, + location=None, + event_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None, + event_system_properties=None, + compression=None): + if isinstance(event_system_properties, str): + event_system_properties = json.loads(event_system_properties) + parameters = {} + parameters['location'] = location + parameters['kind'] = 'EventHub' + parameters['event_hub_resource_id'] = event_hub_resource_id + parameters['consumer_group'] = consumer_group + parameters['table_name'] = table_name + parameters['mapping_rule_name'] = mapping_rule_name + parameters['data_format'] = data_format + parameters['event_system_properties'] = event_system_properties + parameters['compression'] = compression + return client.begin_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) + + +def kusto_data_connection_iot_hub_update(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name, + location=None, + iot_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None, + event_system_properties=None, + shared_access_policy_name=None): + if isinstance(event_system_properties, str): + event_system_properties = json.loads(event_system_properties) + parameters = {} + parameters['location'] = location + parameters['kind'] = 'IotHub' + parameters['iot_hub_resource_id'] = iot_hub_resource_id + parameters['consumer_group'] = consumer_group + parameters['table_name'] = table_name + parameters['mapping_rule_name'] = mapping_rule_name + parameters['data_format'] = data_format + parameters['event_system_properties'] = event_system_properties + parameters['shared_access_policy_name'] = shared_access_policy_name + return client.begin_update(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters) + + +def kusto_data_connection_delete(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name): + return client.begin_delete(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name) + + +def kusto_data_connection_event_grid_data_connection_validation(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name=None, + location=None, + storage_account_resource_id=None, + event_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None): + properties = {} + properties['location'] = location + properties['kind'] = 'EventGrid' + properties['storage_account_resource_id'] = storage_account_resource_id + properties['event_hub_resource_id'] = event_hub_resource_id + properties['consumer_group'] = consumer_group + properties['table_name'] = table_name + properties['mapping_rule_name'] = mapping_rule_name + properties['data_format'] = data_format + return client.data_connection_validation(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + properties=properties) + + +def kusto_data_connection_event_hub_data_connection_validation(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name=None, + location=None, + event_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None, + event_system_properties=None, + compression=None): + if isinstance(event_system_properties, str): + event_system_properties = json.loads(event_system_properties) + properties = {} + properties['location'] = location + properties['kind'] = 'EventHub' + properties['event_hub_resource_id'] = event_hub_resource_id + properties['consumer_group'] = consumer_group + properties['table_name'] = table_name + properties['mapping_rule_name'] = mapping_rule_name + properties['data_format'] = data_format + properties['event_system_properties'] = event_system_properties + properties['compression'] = compression + return client.data_connection_validation(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + properties=properties) + + +def kusto_data_connection_iot_hub_data_connection_validation(client, + resource_group_name, + cluster_name, + database_name, + data_connection_name=None, + location=None, + iot_hub_resource_id=None, + consumer_group=None, + table_name=None, + mapping_rule_name=None, + data_format=None, + event_system_properties=None, + shared_access_policy_name=None): + if isinstance(event_system_properties, str): + event_system_properties = json.loads(event_system_properties) + properties = {} + properties['location'] = location + properties['kind'] = 'IotHub' + properties['iot_hub_resource_id'] = iot_hub_resource_id + properties['consumer_group'] = consumer_group + properties['table_name'] = table_name + properties['mapping_rule_name'] = mapping_rule_name + properties['data_format'] = data_format + properties['event_system_properties'] = event_system_properties + properties['shared_access_policy_name'] = shared_access_policy_name + return client.data_connection_validation(resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + properties=properties) diff --git a/src/kusto/azext_kusto/manual/__init__.py b/src/kusto/azext_kusto/manual/__init__.py new file mode 100644 index 00000000000..ee0c4f36bd0 --- /dev/null +++ b/src/kusto/azext_kusto/manual/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/kusto/azext_kusto/manual/_help.py b/src/kusto/azext_kusto/manual/_help.py new file mode 100644 index 00000000000..b050075960d --- /dev/null +++ b/src/kusto/azext_kusto/manual/_help.py @@ -0,0 +1,559 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + + +helps['kusto cluster'] = """ + type: group + short-summary: kusto cluster +""" + +helps['kusto cluster list'] = """ + type: command + short-summary: Lists all Kusto clusters within a subscription. + examples: + - name: List Kusto clusters by resource group + text: |- + az kusto cluster list --resource-group "kustorptest" +""" + +helps['kusto cluster show'] = """ + type: command + short-summary: Gets a Kusto cluster + examples: + - name: Get a Kusto cluster. + text: |- + az kusto cluster show --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto cluster create'] = """ + type: command + short-summary: Create or update a Kusto cluster. + examples + - name: Create or update a Kusto cluster. + text: |- + az kusto cluster create --cluster-name "KustoClusterRPTest4" --identity-type "SystemAssigned" --location\ + "westus" --enable-purge true --enable-streaming-ingest true --key-vault-properties key-name="" key-vault-uri="" key-ve\ +rsion="" --sku name="Standard_L8s" capacity=2 tier="Standard" --resource-group "kustorptest" +""" + +helps['kusto cluster update'] = """ + type: command + short-summary: Update a Kusto cluster + examples: + - name: Update a Kusto cluster + text: |- + az kusto cluster update --cluster-name "KustoClusterRPTest4" --identity-type "SystemAssigned" --location\ + "westus" --enable-purge true --enable-streaming-ingest true --key-vault-properties key-name="keyName" key-vault-uri="h\ +ttps://dummy.keyvault.com" key-version="keyVersion" --resource-group "kustorptest" +""" + +helps['kusto cluster delete'] = """ + type: command + short-summary: Deletes a Kusto cluster + examples: + - name: Deletes a Kusto cluster. + text: |- + az kusto cluster delete --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto cluster add-language-extension'] = """ + type: command + short-summary: Add a list of language extensions that can run within KQL queries. + examples: + - name: Add language extensions + text: |- + az kusto cluster add-language-extension --cluster-name "KustoClusterRPTest4" --value language-extension-\ +name="PYTHON" --value language-extension-name="R" --resource-group "kustorptest" +""" + +helps['kusto cluster detach-follower-database'] = """ + type: command + short-summary: Detaches all followers of a database owned by this cluster. + examples: + - name: Detach followers databases. + text: |- + az kusto cluster detach-follower-database --cluster-name "KustoClusterRPTest4" --attached-database-confi\ +guration-name "myAttachedDatabaseConfiguration" --cluster-resource-id "/subscriptions/12345678-1234-1234-1234-123456789\ +098/resourceGroups/kustorptest/providers/Microsoft.Kusto/clusters/leader4" --resource-group "kustorptest" +""" + +helps['kusto cluster diagnose-virtual-network'] = """ + type: command + short-summary: Diagnoses network connectivity status for external resources on which the service is dependent on. + examples: + - name: Diagnose virtual-network + text: |- + az kusto cluster diagnose-virtual-network --cluster-name "KustoClusterRPTest4" --resource-group "kustorp\ +test" +""" + +helps['kusto cluster list-follower-database'] = """ + type: command + short-summary: Returns a list of databases that are owned by this cluster and were followed by another cluster. + examples: + - name: List follower databases + text: |- + az kusto cluster list-follower-database --cluster-name "KustoClusterRPTest4" --resource-group "kustorpte\ +st" +""" + +helps['kusto cluster list-language-extension'] = """ + type: command + short-summary: Returns a list of language extensions that can run within KQL queries. + examples: + - name: List language extensions + text: |- + az kusto cluster list-language-extension --cluster-name "KustoClusterRPTest4" --resource-group "kustorpt\ +est" +""" + +helps['kusto cluster list-sku'] = """ + type: command + short-summary: Lists eligible SKUs for Kusto resource provider. + examples: + - name: List SKUs + text: |- + az kusto cluster list-sku --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto cluster remove-language-extension'] = """ + type: command + short-summary: Remove a list of language extensions that can run within KQL queries. + examples: + - name: Remove language extensions + text: |- + az kusto cluster remove-language-extension --cluster-name "KustoClusterRPTest4" --value language-extensi\ +on-name="PYTHON" --value language-extension-name="R" --resource-group "kustorptest" +""" + +helps['kusto cluster start'] = """ + type: command + short-summary: Starts a Kusto cluster. + examples: + - name: Start cluster + text: |- + az kusto cluster start --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto cluster stop'] = """ + type: command + short-summary: Stops a Kusto cluster. + examples: + - name: Stop cluster + text: |- + az kusto cluster stop --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto cluster-principal-assignment'] = """ + type: group + short-summary: kusto cluster-principal-assignment +""" + +helps['kusto cluster-principal-assignment list'] = """ + type: command + short-summary: Lists all Kusto cluster principalAssignments. + examples: + - name: List cluster principal assignment + text: |- + az kusto cluster-principal-assignment list --cluster-name "kustoclusterrptest4" --resource-group "kustor\ +ptest" +""" + +helps['kusto cluster-principal-assignment show'] = """ + type: command + short-summary: Gets a Kusto cluster principalAssignment. + examples: + - name: Get cluster principal assignment + text: |- + az kusto cluster-principal-assignment show --cluster-name "kustoclusterrptest4" --principal-assignment-n\ +ame "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto cluster-principal-assignment create'] = """ + type: command + short-summary: Create a Kusto cluster principalAssignment. + examples: + - name: Create or update cluster principal assignment + text: |- + az kusto cluster-principal-assignment create --cluster-name "kustoclusterrptest4" --principal-id "876543\ +21-1234-1234-1234-123456789123" --principal-type "App" --role "AllDatabasesAdmin" --tenant-id "12345678-1234-1234-1234-\ +123456789123" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto cluster-principal-assignment update'] = """ + type: command + short-summary: Create a Kusto cluster principalAssignment. + examples: + - name: Create or update cluster principal assignment + text: |- + az kusto cluster-principal-assignment update --cluster-name "kustoclusterrptest4" --principal-id "876543\ +21-1234-1234-1234-123456789123" --principal-type "App" --role "AllDatabasesAdmin" --tenant-id "12345678-1234-1234-1234-\ +123456789123" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto cluster-principal-assignment delete'] = """ + type: command + short-summary: Deletes a Kusto cluster principalAssignment. + examples: + - name: Delete cluster principal assignment + text: |- + az kusto cluster-principal-assignment delete --cluster-name "kustoclusterrptest4" --principal-assignment\ +-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto database'] = """ + type: group + short-summary: kusto database +""" + +helps['kusto database list'] = """ + type: command + short-summary: Returns the list of databases of the given Kusto cluster. + examples: + - name: List databases by cluster + text: |- + az kusto database list --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto database show'] = """ + type: command + short-summary: Returns a database. + examples: + - name: Get database + text: |- + az kusto database show --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --resource-\ +group "kustorptest" +""" + +helps['kusto database create'] = """ + type: command + short-summary: Creates or updates a database. + examples: + - name: Create or update Kusto database + text: |- + az kusto database create --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --read-wr\ +ite-database location="westus" soft-delete-period="P1D" --resource-group "kustorptest" +""" + +helps['kusto database update'] = """ + type: command + short-summary: Updates a database. + examples: + - name: Update Kusto database + text: |- + az kusto database update --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --read-wr\ +ite-database soft-delete-period="P1D" --resource-group "kustorptest" +""" + +helps['kusto database delete'] = """ + type: command + short-summary: Deletes the database with the given name. + examples: + - name: Delete Kusto database + text: |- + az kusto database delete --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --resourc\ +e-group "kustorptest" +""" + +helps['kusto database add-principal'] = """ + type: command + short-summary: Add Database principals permissions. + examples: + - name: Add database principal + text: |- + az kusto database add-principal --cluster-name "KustoClusterRPTest4" --database-name "databaseName1" --v\ +alue name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser=some_guid" role="Admin" --value nam\ +e="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup=some_guid" role="Viewer" --value name="SomeA\ +pp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp=some_guid_app_id" role="Admin" --resource-group "kustorpt\ +est" +""" + +helps['kusto database list-principal'] = """ + type: command + short-summary: Returns a list of database principals of the given Kusto cluster and database. + examples: + - name: List database principals + text: |- + az kusto database list-principal --cluster-name "KustoClusterRPTest4" --database-name "Kustodatabase8" -\ +-resource-group "kustorptest" +""" + +helps['kusto database remove-principal'] = """ + type: command + short-summary: Remove Database principals permissions. + examples: + - name: Remove database principals + text: |- + az kusto database remove-principal --cluster-name "KustoClusterRPTest4" --database-name "databaseName1" \ +--value name="Some User" type="User" app-id="" email="user@microsoft.com" fqn="aaduser=some_guid" role="Admin" --value \ +name="Kusto" type="Group" app-id="" email="kusto@microsoft.com" fqn="aadgroup=some_guid" role="Viewer" --value name="So\ +meApp" type="App" app-id="some_guid_app_id" email="" fqn="aadapp=some_guid_app_id" role="Admin" --resource-group "kusto\ +rptest" +""" + +helps['kusto database-principal-assignment'] = """ + type: group + short-summary: kusto database-principal-assignment +""" + +helps['kusto database-principal-assignment list'] = """ + type: command + short-summary: Lists all Kusto cluster database principalAssignments. + examples: + - name: List database principal assignment + text: |- + az kusto database-principal-assignment list --cluster-name "kustoclusterrptest4" --database-name "Kustod\ +atabase8" --resource-group "kustorptest" +""" + +helps['kusto database-principal-assignment show'] = """ + type: command + short-summary: Get database principal assignment + examples: + - name: KustoDatabasePrincipalAssignmentsGet + text: |- + az kusto database-principal-assignment show --cluster-name "kustoclusterrptest4" --database-name "Kustod\ +atabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto database-principal-assignment create'] = """ + type: command + short-summary: Creates a Kusto cluster database principalAssignment. + examples: + - name: Create or update database principal assignment + text: |- + az kusto database-principal-assignment create --cluster-name "kustoclusterrptest4" --database-name "Kust\ +odatabase8" --principal-id "87654321-1234-1234-1234-123456789123" --principal-type "App" --role "Admin" --tenant-id "12\ +345678-1234-1234-1234-123456789123" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto database-principal-assignment update'] = """ + type: command + short-summary: Creates a Kusto cluster database principalAssignment. + examples: + - name: Create or update database principal assignment + text: |- + az kusto database-principal-assignment update --cluster-name "kustoclusterrptest4" --database-name "Kust\ +odatabase8" --principal-id "87654321-1234-1234-1234-123456789123" --principal-type "App" --role "Admin" --tenant-id "12\ +345678-1234-1234-1234-123456789123" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto database-principal-assignment delete'] = """ + type: command + short-summary: Deletes a Kusto principalAssignment. + examples: + - name: Delete database principal assignment + text: |- + az kusto database-principal-assignment delete --cluster-name "kustoclusterrptest4" --database-name "Kust\ +odatabase8" --principal-assignment-name "kustoprincipal1" --resource-group "kustorptest" +""" + +helps['kusto attached-database-configuration'] = """ + type: group + short-summary: kusto attached-database-configuration +""" + +helps['kusto attached-database-configuration list'] = """ + type: command + short-summary: Returns the list of attached database configurations of the given Kusto cluster. + examples: + - name: List attached databases by cluster + text: |- + az kusto attached-database-configuration list --cluster-name "KustoClusterRPTest4" --resource-group "kus\ +torptest" +""" + +helps['kusto attached-database-configuration show'] = """ + type: command + short-summary: Returns an attached database configuration. + examples: + - name: Get attached database + text: |- + az kusto attached-database-configuration show --attached-database-configuration-name "attachedDatabaseCo\ +nfigurations1" --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto attached-database-configuration create'] = """ + type: command + short-summary: Creates or updates an attached database configuration. + examples: + - name: Create or update attached database + text: |- + az kusto attached-database-configuration create --attached-database-configuration-name "attachedDatabase\ +Configurations1" --cluster-name "KustoClusterRPTest4" --location "westus" --cluster-resource-id "/subscriptions/1234567\ +8-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterLeader" --datab\ +ase-name "Kustodatabase8" --default-principals-modification-kind "Union" --resource-group "kustorptest" +""" + +helps['kusto attached-database-configuration update'] = """ + type: command + short-summary: Creates or updates an attached database configuration. + examples: + - name: Create or update attached database + text: |- + az kusto attached-database-configuration update --attached-database-configuration-name "attachedDatabase\ +Configurations1" --cluster-name "KustoClusterRPTest4" --location "westus" --cluster-resource-id "/subscriptions/1234567\ +8-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.Kusto/Clusters/KustoClusterLeader" --datab\ +ase-name "Kustodatabase8" --default-principals-modification-kind "Union" --resource-group "kustorptest" +""" + +helps['kusto attached-database-configuration delete'] = """ + type: command + short-summary: Deletes the attached database configuration with the given name. + examples: + - name: Delete attached database + text: |- + az kusto attached-database-configuration delete --attached-database-configuration-name "attachedDatabase\ +Configurations1" --cluster-name "KustoClusterRPTest4" --resource-group "kustorptest" +""" + +helps['kusto data-connection'] = """ + type: group + short-summary: kusto data-connection +""" + +helps['kusto data-connection list'] = """ + type: command + short-summary: Returns the list of data connections of the given Kusto database. + examples: + - name: List cluster data connection + text: |- + az kusto data-connection list --cluster-name "KustoClusterRPTest4" --database-name "KustoDatabase8" --re\ +source-group "kustorptest" +""" + +helps['kusto data-connection show'] = """ + type: command + short-summary: Returns a data connection. + examples: + - name: Get data connection + text: |- + az kusto data-connection show --cluster-name "KustoClusterRPTest4" --data-connection-name "DataConnectio\ +ns8" --database-name "KustoDatabase8" --resource-group "kustorptest" +""" + +helps['kusto data-connection event-grid'] = """ + type: group + short-summary: kusto data-connection sub group event-grid +""" + +helps['kusto data-connection event-grid create'] = """ + type: command + short-summary: Creates or updates a data connection. +""" + +helps['kusto data-connection event-hub'] = """ + type: group + short-summary: kusto data-connection sub group event-hub +""" + +helps['kusto data-connection event-hub create'] = """ + type: command + short-summary: Creates or updates a data connection. + examples: + - name: Create or update data connection + text: |- + az kusto data-connection event-hub create --cluster-name "KustoClusterRPTest4" --data-connection-name "D\ +ataConnections8" --database-name "KustoDatabase8" --location "westus" --consumer-group "testConsumerGroup1" --event-hub\ +-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventH\ +ub/namespaces/eventhubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" +""" + +helps['kusto data-connection iot-hub'] = """ + type: group + short-summary: kusto data-connection sub group iot-hub +""" + +helps['kusto data-connection iot-hub create'] = """ + type: command + short-summary: Creates or updates a data connection. +""" + +helps['kusto data-connection event-grid update'] = """ + type: command + short-summary: Updates a data connection. +""" + +helps['kusto data-connection event-hub update'] = """ + type: command + short-summary: Updates a data connection. + examples: + - name: Update data connection + text: |- + az kusto data-connection event-hub update --cluster-name "KustoClusterRPTest4" --data-connection-name "D\ +ataConnections8" --database-name "KustoDatabase8" --location "westus" --consumer-group "testConsumerGroup1" --event-hub\ +-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventH\ +ub/namespaces/eventhubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" +""" + +helps['kusto data-connection iot-hub update'] = """ + type: command + short-summary: Updates a data connection. +""" + +helps['kusto data-connection delete'] = """ + type: command + short-summary: Deletes the data connection with the given name. + examples: + - name: Delete data connection + text: |- + az kusto data-connection delete --cluster-name "KustoClusterRPTest4" --data-connection-name "kustoeventh\ +ubconnection1" --database-name "KustoDatabase8" --resource-group "kustorptest" +""" + +helps['kusto data-connection event-grid data-connection-validation'] = """ + type: command + short-summary: Checks that the data connection parameters are valid. +""" + +helps['kusto data-connection event-hub data-connection-validation'] = """ + type: command + short-summary: Checks that the data connection parameters are valid. + examples: + - name: Validate data connection + text: |- + az kusto data-connection event-hub data-connection-validation --cluster-name "KustoClusterRPTest4" --dat\ +abase-name "KustoDatabase8" --data-connection-name "DataConnections8" --consumer-group "testConsumerGroup1" --event-hub\ +-resource-id "/subscriptions/12345678-1234-1234-1234-123456789098/resourceGroups/kustorptest/providers/Microsoft.EventH\ +ub/namespaces/eventhubTestns1/eventhubs/eventhubTest1" --resource-group "kustorptest" +""" + +helps['kusto data-connection iot-hub data-connection-validation'] = """ + type: command + short-summary: Checks that the data connection parameters are valid. +""" + + +helps['kusto attached-database-configuration wait'] = """ +type: command +short-summary: Wait for a managed Kusto cluster to reach a desired state. +long-summary: If an operation on a cluster was interrupted or was started with `--no-wait`, use this command to wait for it to complete. +""" + +helps['kusto cluster-principal-assignment wait'] = """ +type: command +short-summary: Wait for a managed Kusto cluster to reach a desired state. +long-summary: If an operation on a cluster was interrupted or was started with `--no-wait`, use this command to wait for it to complete. +""" + +helps['kusto data-connection wait wait'] = """ +type: command +short-summary: Wait for a managed Kusto cluster to reach a desired state. +long-summary: If an operation on a cluster was interrupted or was started with `--no-wait`, use this command to wait for it to complete. +""" + +helps['kusto database-principal-assignment wait'] = """ +type: command +short-summary: Wait for a managed Kusto cluster to reach a desired state. +long-summary: If an operation on a cluster was interrupted or was started with `--no-wait`, use this command to wait for it to complete. +""" diff --git a/src/kusto/azext_kusto/manual/tests/__init__.py b/src/kusto/azext_kusto/manual/tests/__init__.py new file mode 100644 index 00000000000..fe1bd438b46 --- /dev/null +++ b/src/kusto/azext_kusto/manual/tests/__init__.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +import inspect +import os + + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func) + module_path = __path__[0] + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + print("running {}()...".format(func.__name__)) + return func_to_call(*args, **kwargs) + + if inspect.isclass(func): + return get_func_to_call() + else: + return wrapper diff --git a/src/kusto/azext_kusto/manual/tests/latest/__init__.py b/src/kusto/azext_kusto/manual/tests/latest/__init__.py new file mode 100644 index 00000000000..ee0c4f36bd0 --- /dev/null +++ b/src/kusto/azext_kusto/manual/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/kusto/azext_kusto/manual/tests/latest/recordings/test_kusto.yaml b/src/kusto/azext_kusto/manual/tests/latest/recordings/test_kusto.yaml new file mode 100644 index 00000000000..5bddb894e72 --- /dev/null +++ b/src/kusto/azext_kusto/manual/tests/latest/recordings/test_kusto.yaml @@ -0,0 +1,8465 @@ +interactions: +- request: + body: '{"location": "westus", "sku": {"name": "Standard_L8s", "capacity": 2, "tier": + "Standard"}, "properties": {"enableStreamingIngest": true, "keyVaultProperties": + {"keyName": "", "keyVersion": "", "keyVaultUri": ""}, "enablePurge": true}, + "identity": {"type": "SystemAssigned"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + Content-Length: + - '274' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterfollower?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterfollower","name":"testcliclusterfollower","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"westus","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"properties":{"enableStreamingIngest":true,"keyVaultProperties":{"keyName":"","keyVersion":"","keyVaultUri":""},"enablePurge":true,"state":"Creating","provisioningState":"Creating"},"identity":{"type":"SystemAssigned"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '589' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 09:55:48 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '199' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 09:56:18 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 09:56:48 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '298' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 09:57:20 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '297' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 09:57:50 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '296' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 09:58:21 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '295' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 09:58:51 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '294' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 09:59:21 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '293' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 09:59:52 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '292' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:00:23 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '291' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:00:53 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '290' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:01:24 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:01:55 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '288' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:02:24 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '287' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:02:55 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '286' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:03:27 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '285' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:03:57 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '284' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:04:26 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '283' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:04:58 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '282' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:05:28 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Running","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T09:55:49.4885405Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:05:59 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '288' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/31caed15-c03d-4205-8ff1-d7aae37588ef?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/31caed15-c03d-4205-8ff1-d7aae37588ef","name":"31caed15-c03d-4205-8ff1-d7aae37588ef","status":"Succeeded","startTime":"2020-04-28T09:55:47.0333409Z","endTime":"2020-04-28T10:06:13.842226Z","percentComplete":1.0,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"ee94d5bb-5d5b-41fa-8f27-f0032d6e9a5f","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '472' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:06:29 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '287' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterfollower?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterfollower","name":"testcliclusterfollower","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://testcliclusterfollower.westus.kusto.windows.net","dataIngestionUri":"https://ingest-testcliclusterfollower.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"fe272264-9a7d-4a40-af0b-b9408bdc0f9a","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}}' + headers: + cache-control: + - no-cache + content-length: + - '979' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:06:30 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "sku": {"name": "Standard_L8s", "capacity": 2, "tier": + "Standard"}, "properties": {"enableStreamingIngest": true, "keyVaultProperties": + {"keyName": "", "keyVersion": "", "keyVaultUri": ""}, "enablePurge": true}, + "identity": {"type": "SystemAssigned"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + Content-Length: + - '274' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader","name":"testcliclusterleader","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"westus","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"properties":{"enableStreamingIngest":true,"keyVaultProperties":{"keyName":"","keyVersion":"","keyVaultUri":""},"enablePurge":true,"state":"Creating","provisioningState":"Creating"},"identity":{"type":"SystemAssigned"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '585' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:06:42 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '198' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:07:13 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:07:43 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '298' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:08:14 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '297' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:08:44 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '296' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:09:15 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '295' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:09:45 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '294' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:10:15 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '293' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:10:47 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '292' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:11:17 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '291' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:11:47 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '290' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:12:18 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:12:48 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '288' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:13:19 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '287' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:13:49 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '286' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:14:19 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '285' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:14:51 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '284' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:15:21 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:15:52 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:16:22 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '298' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:16:53 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '297' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Running","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:06:44.5145049Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '469' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:17:23 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '296' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9132663b-17cc-4ebf-970d-d3ee66b7f509?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9132663b-17cc-4ebf-970d-d3ee66b7f509","name":"9132663b-17cc-4ebf-970d-d3ee66b7f509","status":"Succeeded","startTime":"2020-04-28T10:06:42.1707545Z","endTime":"2020-04-28T10:17:29.6898115Z","percentComplete":1.0,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"5946ed2f-814d-4425-b4a2-a2d884e6460f","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '473' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:17:54 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '295' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader","name":"testcliclusterleader","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://testcliclusterleader.westus.kusto.windows.net","dataIngestionUri":"https://ingest-testcliclusterleader.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"580ee680-fcf2-4c4e-9631-f13415eba524","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}}' + headers: + cache-control: + - no-cache + content-length: + - '971' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:17:54 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster wait + Connection: + - keep-alive + ParameterSetName: + - --created --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader","name":"testcliclusterleader","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://testcliclusterleader.westus.kusto.windows.net","dataIngestionUri":"https://ingest-testcliclusterleader.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"580ee680-fcf2-4c4e-9631-f13415eba524","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}}' + headers: + cache-control: + - no-cache + content-length: + - '971' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:17:57 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster show + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader","name":"testcliclusterleader","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://testcliclusterleader.westus.kusto.windows.net","dataIngestionUri":"https://ingest-testcliclusterleader.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"580ee680-fcf2-4c4e-9631-f13415eba524","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}}' + headers: + cache-control: + - no-cache + content-length: + - '971' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:17:58 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/clusters?api-version=2020-02-15 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/noamgotest/providers/Microsoft.Kusto/Clusters/noamgotest1","name":"noamgotest1","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + Europe","sku":{"name":"Standard_D14_v2","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Stopped","stateReason":"Suspended + at 3/22/2020 11:23:02 AM","uri":"https://noamgotest1.westeurope.kusto.windows.net","dataIngestionUri":"https://ingest-noamgotest1.westeurope.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/kubill-kustointernalppe/providers/Microsoft.Kusto/Clusters/royi","name":"royi","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"East + US 2","sku":{"name":"Dev(No SLA)_Standard_D11_v2","tier":"Basic","capacity":1},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://royi.eastus2.kusto.windows.net","dataIngestionUri":"https://ingest-royi.eastus2.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/royikusto/providers/Microsoft.Kusto/Clusters/royitest","name":"royitest","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"East + US 2","sku":{"name":"Dev(No SLA)_Standard_D11_v2","tier":"Basic","capacity":1},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://royitest.eastus2.kusto.windows.net","dataIngestionUri":"https://ingest-royitest.eastus2.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":{"keyVaultUri":"https://royitestkv.vault.azure.net","keyName":"TestKey","keyVersion":"0efe068347d641f4bfd20c692f05ca62"},"languageExtensions":{"value":[]},"enablePurge":null,"provisioningState":"Succeeded"},"identity":{"principalId":"a9a04853-74ee-4bde-b14c-25f100bb0d50","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/astauben-tests/providers/Microsoft.Kusto/Clusters/astaubencli","name":"astaubencli","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Dev(No SLA)_Standard_D11_v2","tier":"Basic","capacity":1},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://astaubencli.westus.kusto.windows.net","dataIngestionUri":"https://ingest-astaubencli.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":null,"provisioningState":"Succeeded"},"identity":{"principalId":"fddf12de-e076-4898-853b-c45b21242035","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/astauben-tests/providers/Microsoft.Kusto/Clusters/astaubentestcli","name":"astaubentestcli","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_D12_v2","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://astaubentestcli.westus.kusto.windows.net","dataIngestionUri":"https://ingest-astaubentestcli.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Failed"},"identity":{"principalId":"6b62bb67-0f54-4211-acf7-3f882cca2437","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitestgcjzdmbmffg63ofutofl5dbnfwb2exetloz6e3f2eqiyzlof2p7zqtbabgm7gf3qnr55/providers/Microsoft.Kusto/Clusters/clitestcluster","name":"clitestcluster","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://clitestcluster.westus.kusto.windows.net","dataIngestionUri":"https://ingest-clitestcluster.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"9f650181-5483-4436-b925-ab60f7735b5c","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest3dencicwf6phmiqnhkoc4i27dgo7i7ok6vzzxj2um55gwfpmcouh5wlq3fy7opdechxp/providers/Microsoft.Kusto/Clusters/testcli3","name":"testcli3","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://testcli3.westus.kusto.windows.net","dataIngestionUri":"https://ingest-testcli3.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"0f266868-fa0d-485d-8848-c44ec7dc680f","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterfollower","name":"testcliclusterfollower","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://testcliclusterfollower.westus.kusto.windows.net","dataIngestionUri":"https://ingest-testcliclusterfollower.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"fe272264-9a7d-4a40-af0b-b9408bdc0f9a","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader","name":"testcliclusterleader","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://testcliclusterleader.westus.kusto.windows.net","dataIngestionUri":"https://ingest-testcliclusterleader.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"580ee680-fcf2-4c4e-9631-f13415eba524","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Kusto/Clusters/testnewkustocluster2","name":"testnewkustocluster2","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"East + US","sku":{"name":"Standard_D11_v2","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://testnewkustocluster2.eastus.kusto.windows.net","dataIngestionUri":"https://ingest-testnewkustocluster2.eastus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Kusto/Clusters/testnewkustocluster","name":"testnewkustocluster","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"East + US","sku":{"name":"Standard_D11_v2","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://testnewkustocluster.eastus.kusto.windows.net","dataIngestionUri":"https://ingest-testnewkustocluster.eastus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[{"languageExtensionName":"PYTHON"}]},"enablePurge":null,"provisioningState":"Succeeded"},"identity":{"principalId":"e599ae33-a117-4952-bb30-5fab29f6334f","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gildev/providers/Microsoft.Kusto/Clusters/gilcluster","name":"gilcluster","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"East + US","sku":{"name":"Dev(No SLA)_Standard_D11_v2","tier":"Basic","capacity":1},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://gilcluster.eastus.kusto.windows.net","dataIngestionUri":"https://ingest-gilcluster.eastus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/orenrgilaysub/providers/Microsoft.Kusto/Clusters/oren2104","name":"oren2104","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"East + US","sku":{"name":"Standard_D11_v2","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://oren2104.eastus.kusto.windows.net","dataIngestionUri":"https://ingest-oren2104.eastus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/noamDRI/providers/Microsoft.Kusto/Clusters/noamskuissue","name":"noamskuissue","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"Australia + East","sku":{"name":"Standard_D14_v2","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Stopped","stateReason":"Suspended + at 3/22/2020 11:20:03 AM","uri":"https://noamskuissue.australiaeast.kusto.windows.net","dataIngestionUri":"https://ingest-noamskuissue.australiaeast.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":null,"provisioningState":"Succeeded"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '12073' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:18:01 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: + - e55ccc83-74fe-4c3a-b14d-6fcd6e8ebdf5 + - 5b9112d1-2433-4e3e-9091-35d310315e91 + - 3d61a4db-384c-419b-a345-7882e13abf1a + - 6a224af8-1928-4a47-b73f-327eaafcdcef + - 0ae748ba-2f60-4f98-a91b-5b8dc0dd01bb + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters?api-version=2020-02-15 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterfollower","name":"testcliclusterfollower","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://testcliclusterfollower.westus.kusto.windows.net","dataIngestionUri":"https://ingest-testcliclusterfollower.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"fe272264-9a7d-4a40-af0b-b9408bdc0f9a","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader","name":"testcliclusterleader","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://testcliclusterleader.westus.kusto.windows.net","dataIngestionUri":"https://ingest-testcliclusterleader.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"580ee680-fcf2-4c4e-9631-f13415eba524","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '1963' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:18:03 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster list-sku + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/skus?api-version=2020-02-15 + response: + body: + string: '{"value":[{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_D14_v2","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_D13_v2","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_L8s","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_L16s","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_D11_v2","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":8,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_D12_v2","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":16,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_L4s","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":16,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_L8s_v2","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_L16s_v2","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E2a_v4","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E4a_v4","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E8a_v4","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E16a_v4","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E8as_v4+1TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E8as_v4+2TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E16as_v4+3TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E16as_v4+4TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '4726' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:18:04 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster list-sku + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/skus?api-version=2020-02-15 + response: + body: + string: '{"value":[{"resourceType":"clusters","name":"Dev(No SLA)_Standard_D11_v2","tier":"Basic","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["uksouth"],"locationInfo":[{"location":"uksouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["uksouth"],"locationInfo":[{"location":"uksouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["uksouth"],"locationInfo":[{"location":"uksouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["centralindia"],"locationInfo":[{"location":"centralindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["centralindia"],"locationInfo":[{"location":"centralindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["centralindia"],"locationInfo":[{"location":"centralindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["centralindia"],"locationInfo":[{"location":"centralindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["centralindia"],"locationInfo":[{"location":"centralindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["francesouth"],"locationInfo":[{"location":"francesouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["francesouth"],"locationInfo":[{"location":"francesouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["francesouth"],"locationInfo":[{"location":"francesouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["francesouth"],"locationInfo":[{"location":"francesouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["francesouth"],"locationInfo":[{"location":"francesouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["southafricanorth"],"locationInfo":[{"location":"southafricanorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["southafricanorth"],"locationInfo":[{"location":"southafricanorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["southafricanorth"],"locationInfo":[{"location":"southafricanorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["southafricanorth"],"locationInfo":[{"location":"southafricanorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["southafricanorth"],"locationInfo":[{"location":"southafricanorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["southafricawest"],"locationInfo":[{"location":"southafricawest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["southafricawest"],"locationInfo":[{"location":"southafricawest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["southafricawest"],"locationInfo":[{"location":"southafricawest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["southafricawest"],"locationInfo":[{"location":"southafricawest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["southafricawest"],"locationInfo":[{"location":"southafricawest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]}]}' + headers: + cache-control: + - no-cache + content-length: + - '60499' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:18:05 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", "kind": "ReadWrite", "properties": {"softDeletePeriod": + "P1D"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database create + Connection: + - keep-alive + Content-Length: + - '86' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name --database-name --read-write-database --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/KustoDatabase8?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/Databases/KustoDatabase8","name":"testcliclusterleader/KustoDatabase8","type":"Microsoft.Kusto/Clusters/Databases","etag":"\"\"","location":"westus","kind":"ReadWrite","properties":{"softDeletePeriod":"P1D","provisioningState":"Creating"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/af8548d1-eb72-4cc0-925a-9d344a733bd7?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '445' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:18:08 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '199' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --read-write-database --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/af8548d1-eb72-4cc0-925a-9d344a733bd7?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/af8548d1-eb72-4cc0-925a-9d344a733bd7","name":"af8548d1-eb72-4cc0-925a-9d344a733bd7","status":"Succeeded","startTime":"2020-04-28T10:18:08.4481254Z","endTime":"2020-04-28T10:18:10.6825147Z","percentComplete":1.0,"properties":{"OperationKind":"DatabaseCreate","RootActivityId":"c3f89eeb-95e3-4d24-9fa7-707cd27f6a45","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '466' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:18:38 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --read-write-database --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/KustoDatabase8?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/Databases/KustoDatabase8","name":"testcliclusterleader/KustoDatabase8","type":"Microsoft.Kusto/Clusters/Databases","etag":"\"\"","location":"West + US","kind":"ReadWrite","tags":{},"properties":{"isFollowed":false,"softDeletePeriodInDays":1,"softDeletePeriod":"P1D","hotCachePeriodInDays":0,"hotCachePeriod":null,"statistics":{"size":0.0},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '576' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:18:38 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database list + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases?api-version=2020-02-15 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/Databases/KustoDatabase8","name":"testcliclusterleader/KustoDatabase8","type":"Microsoft.Kusto/Clusters/Databases","etag":"\"\"","location":"West + US","kind":"ReadWrite","properties":{"isFollowed":false,"softDeletePeriodInDays":1,"softDeletePeriod":"P1D","hotCachePeriodInDays":0,"hotCachePeriod":null,"statistics":{"size":0.0},"provisioningState":"Succeeded"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '578' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:18:41 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database show + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/KustoDatabase8?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/Databases/KustoDatabase8","name":"testcliclusterleader/KustoDatabase8","type":"Microsoft.Kusto/Clusters/Databases","etag":"\"\"","location":"West + US","kind":"ReadWrite","tags":{},"properties":{"isFollowed":false,"softDeletePeriodInDays":1,"softDeletePeriod":"P1D","hotCachePeriodInDays":0,"hotCachePeriod":null,"statistics":{"size":0.0},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '576' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:18:43 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"kind": "ReadWrite", "properties": {"softDeletePeriod": "P1D"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database update + Connection: + - keep-alive + Content-Length: + - '64' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name --database-name --read-write-database --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/KustoDatabase8?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/Databases/KustoDatabase8","name":"testcliclusterleader/KustoDatabase8","type":"Microsoft.Kusto/Clusters/Databases","etag":"\"\"","location":"West + US","kind":"ReadWrite","tags":{},"properties":{"softDeletePeriod":"P1D","provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/ebe5ffab-1d8c-4d33-856d-e76263be7c05?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '456' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:18:45 GMT + etag: + - '""' + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ebe5ffab-1d8c-4d33-856d-e76263be7c05?api-version=2020-02-15&operationResultResponseType=Location + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '199' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database update + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --read-write-database --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ebe5ffab-1d8c-4d33-856d-e76263be7c05?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ebe5ffab-1d8c-4d33-856d-e76263be7c05","name":"ebe5ffab-1d8c-4d33-856d-e76263be7c05","status":"Succeeded","startTime":"2020-04-28T10:18:44.964048Z","endTime":"2020-04-28T10:18:46.4172403Z","percentComplete":1.0,"properties":{"OperationKind":"DatabaseCreate","RootActivityId":"8c1117b4-fd8e-44b8-9c77-b92bc281781a","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '466' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:19:14 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database update + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --read-write-database --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/KustoDatabase8?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/Databases/KustoDatabase8","name":"testcliclusterleader/KustoDatabase8","type":"Microsoft.Kusto/Clusters/Databases","etag":"\"\"","location":"West + US","kind":"ReadWrite","tags":{},"properties":{"isFollowed":false,"softDeletePeriodInDays":1,"softDeletePeriod":"P1D","hotCachePeriodInDays":0,"hotCachePeriod":null,"statistics":{"size":0.0},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '576' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:19:16 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"principalId": "d9a1f322-1293-4595-91e3-f54f8bb34725", + "role": "Admin", "tenantId": "33e01921-4d64-4f8c-a055-5bdaffd5e33d", "principalType": + "App"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database-principal-assignment create + Connection: + - keep-alive + Content-Length: + - '164' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name --database-name --principal-id --principal-type --role --tenant-id + --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/Kustodatabase8/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/Databases/Kustodatabase8/PrincipalAssignments/kustoprincipal1","name":"testcliclusterleader/Kustodatabase8/kustoprincipal1","type":"Microsoft.Kusto/Clusters/Databases/PrincipalAssignments","etag":"\"\"","properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"Admin","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","principalType":"App","provisioningState":"Creating"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/0b1daa36-5242-4d2f-a45b-d174a8c02881?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '595' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:19:19 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '199' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database-principal-assignment create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --principal-id --principal-type --role --tenant-id + --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/0b1daa36-5242-4d2f-a45b-d174a8c02881?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/0b1daa36-5242-4d2f-a45b-d174a8c02881","name":"0b1daa36-5242-4d2f-a45b-d174a8c02881","status":"Succeeded","startTime":"2020-04-28T10:19:19.4198321Z","endTime":"2020-04-28T10:19:19.6854599Z","percentComplete":1.0,"properties":{"OperationKind":"DatabaseAddPrincipals","RootActivityId":"48374d45-7bfc-4744-8e40-d4dd9104e495","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '474' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:19:49 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database-principal-assignment create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --principal-id --principal-type --role --tenant-id + --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/Kustodatabase8/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/Databases/Kustodatabase8/PrincipalAssignments/kustoprincipal1","name":"testcliclusterleader/Kustodatabase8/kustoprincipal1","type":"Microsoft.Kusto/Clusters/Databases/PrincipalAssignments","etag":"\"\"","tags":{},"properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"Admin","principalType":"App","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","tenantName":"MS + Azure Cloud","principalName":"KustoResourceProvider","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '676' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:19:49 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database-principal-assignment wait + Connection: + - keep-alive + ParameterSetName: + - --created --cluster-name --database-name --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/Kustodatabase8/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/Databases/Kustodatabase8/PrincipalAssignments/kustoprincipal1","name":"testcliclusterleader/Kustodatabase8/kustoprincipal1","type":"Microsoft.Kusto/Clusters/Databases/PrincipalAssignments","etag":"\"\"","tags":{},"properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"Admin","principalType":"App","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","tenantName":"MS + Azure Cloud","principalName":"KustoResourceProvider","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '676' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:19:52 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database list-principal + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --cluster-name --database-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/Kustodatabase8/listPrincipals?api-version=2020-02-15 + response: + body: + string: '{"value":[{"name":"KustoResourceProvider","role":"Admin","type":"App","fqn":"aadapp=d9a1f322-1293-4595-91e3-f54f8bb34725;33e01921-4d64-4f8c-a055-5bdaffd5e33d","email":"","appId":"d9a1f322-1293-4595-91e3-f54f8bb34725","tenantName":"MS + Azure Cloud"},{"name":"Assaf Taubenfeld","role":"Admin","type":"User","fqn":"aaduser=53d8fc23-618e-49fa-ae3f-ae65cc60aa37;72f988bf-86f1-41af-91ab-2d7cd011db47","email":"astauben@microsoft.com","appId":"","tenantName":"Microsoft"}]}' + headers: + cache-control: + - no-cache + content-length: + - '465' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:19:54 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database-principal-assignment show + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/Kustodatabase8/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/Databases/Kustodatabase8/PrincipalAssignments/kustoprincipal1","name":"testcliclusterleader/Kustodatabase8/kustoprincipal1","type":"Microsoft.Kusto/Clusters/Databases/PrincipalAssignments","etag":"\"\"","tags":{},"properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"Admin","principalType":"App","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","tenantName":"MS + Azure Cloud","principalName":"KustoResourceProvider","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '676' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:19:56 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database-principal-assignment delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --cluster-name --database-name --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/Kustodatabase8/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/888266e0-22e1-4752-8445-1d2ced757528?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 28 Apr 2020 10:19:58 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/888266e0-22e1-4752-8445-1d2ced757528?api-version=2020-02-15&operationResultResponseType=Location + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database-principal-assignment delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/888266e0-22e1-4752-8445-1d2ced757528?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/888266e0-22e1-4752-8445-1d2ced757528","name":"888266e0-22e1-4752-8445-1d2ced757528","status":"Succeeded","startTime":"2020-04-28T10:19:58.8490828Z","endTime":"2020-04-28T10:19:58.9740777Z","percentComplete":1.0,"properties":{"OperationKind":"DatabaseDropPrincipals","RootActivityId":"b346734a-5c77-4c18-ae2a-0f8b70d41c87","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '475' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:20:28 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"principalId": "d9a1f322-1293-4595-91e3-f54f8bb34725", + "role": "AllDatabasesViewer", "tenantId": "33e01921-4d64-4f8c-a055-5bdaffd5e33d", + "principalType": "App"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster-principal-assignment create + Connection: + - keep-alive + Content-Length: + - '177' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name --principal-id --principal-type --role --tenant-id --principal-assignment-name + --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/PrincipalAssignments/kustoprincipal1","name":"testcliclusterleader/kustoprincipal1","type":"Microsoft.Kusto/Clusters/PrincipalAssignments","etag":"\"\"","properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"AllDatabasesViewer","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","principalType":"App","provisioningState":"Creating"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/4fbf95a3-650d-4cc3-97aa-e578eb5c162a?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '558' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:20:31 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '199' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster-principal-assignment create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --principal-id --principal-type --role --tenant-id --principal-assignment-name + --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/4fbf95a3-650d-4cc3-97aa-e578eb5c162a?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/4fbf95a3-650d-4cc3-97aa-e578eb5c162a","name":"4fbf95a3-650d-4cc3-97aa-e578eb5c162a","status":"Succeeded","startTime":"2020-04-28T10:20:32.0623563Z","endTime":"2020-04-28T10:20:35.1717706Z","percentComplete":1.0,"properties":{"OperationKind":"ServicePrincipalAssignmentsAdd","RootActivityId":"0be4754b-28ba-412d-b877-7ab7dcd80d75","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '483' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:21:02 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster-principal-assignment create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --principal-id --principal-type --role --tenant-id --principal-assignment-name + --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/PrincipalAssignments/kustoprincipal1","name":"testcliclusterleader/kustoprincipal1","type":"Microsoft.Kusto/Clusters/PrincipalAssignments","etag":"\"\"","tags":{},"properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"AllDatabasesViewer","principalType":"App","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","tenantName":"MS + Azure Cloud","principalName":"KustoResourceProvider","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '639' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:21:02 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster-principal-assignment wait + Connection: + - keep-alive + ParameterSetName: + - --created --principal-assignment-name --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/PrincipalAssignments/kustoprincipal1","name":"testcliclusterleader/kustoprincipal1","type":"Microsoft.Kusto/Clusters/PrincipalAssignments","etag":"\"\"","tags":{},"properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"AllDatabasesViewer","principalType":"App","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","tenantName":"MS + Azure Cloud","principalName":"KustoResourceProvider","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '639' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:21:04 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster-principal-assignment show + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/PrincipalAssignments/kustoprincipal1","name":"testcliclusterleader/kustoprincipal1","type":"Microsoft.Kusto/Clusters/PrincipalAssignments","etag":"\"\"","tags":{},"properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"AllDatabasesViewer","principalType":"App","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","tenantName":"MS + Azure Cloud","principalName":"KustoResourceProvider","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '639' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:21:06 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: 'b''{"location": "westus", "properties": {"databaseName": "Kustodatabase8", + "clusterResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader", + "defaultPrincipalsModificationKind": "Union"}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto attached-database-configuration create + Connection: + - keep-alive + Content-Length: + - '341' + Content-Type: + - application/json + ParameterSetName: + - --attached-database-configuration-name --cluster-name --location --cluster-resource-id + --database-name --default-principals-modification-kind --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterfollower/attachedDatabaseConfigurations/attachedDatabaseConfigurations2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterfollower/AttachedDatabaseConfigurations/attachedDatabaseConfigurations2","name":"testcliclusterfollower/attachedDatabaseConfigurations2","type":"Microsoft.Kusto/Clusters/AttachedDatabaseConfigurations","etag":"\"\"","location":"westus","properties":{"databaseName":"Kustodatabase8","clusterResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader","defaultPrincipalsModificationKind":"Union","provisioningState":"Creating"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9dca600d-61f7-47a5-b9e9-a306fc210db7?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '778' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:21:08 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '199' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto attached-database-configuration create + Connection: + - keep-alive + ParameterSetName: + - --attached-database-configuration-name --cluster-name --location --cluster-resource-id + --database-name --default-principals-modification-kind --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/9dca600d-61f7-47a5-b9e9-a306fc210db7?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/9dca600d-61f7-47a5-b9e9-a306fc210db7","name":"9dca600d-61f7-47a5-b9e9-a306fc210db7","status":"Succeeded","startTime":"2020-04-28T10:21:08.9844416Z","endTime":"2020-04-28T10:21:12.7188682Z","percentComplete":1.0,"properties":{"OperationKind":"FollowerDatabaseCreate","RootActivityId":"a789854d-031a-4b3c-b7f1-3ed46cec18f0","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '474' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:21:39 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto attached-database-configuration create + Connection: + - keep-alive + ParameterSetName: + - --attached-database-configuration-name --cluster-name --location --cluster-resource-id + --database-name --default-principals-modification-kind --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterfollower/attachedDatabaseConfigurations/attachedDatabaseConfigurations2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterfollower/AttachedDatabaseConfigurations/attachedDatabaseConfigurations2","name":"testcliclusterfollower/attachedDatabaseConfigurations2","type":"Microsoft.Kusto/Clusters/AttachedDatabaseConfigurations","etag":"\"\"","location":"West + US","tags":{},"properties":{"clusterResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader","databaseName":"Kustodatabase8","attachedDatabaseNames":["Kustodatabase8"],"defaultPrincipalsModificationKind":"Union","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '833' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:21:40 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto attached-database-configuration wait + Connection: + - keep-alive + ParameterSetName: + - --created --cluster-name --attached-database-configuration-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterfollower/attachedDatabaseConfigurations/attachedDatabaseConfigurations2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterfollower/AttachedDatabaseConfigurations/attachedDatabaseConfigurations2","name":"testcliclusterfollower/attachedDatabaseConfigurations2","type":"Microsoft.Kusto/Clusters/AttachedDatabaseConfigurations","etag":"\"\"","location":"West + US","tags":{},"properties":{"clusterResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader","databaseName":"Kustodatabase8","attachedDatabaseNames":["Kustodatabase8"],"defaultPrincipalsModificationKind":"Union","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '833' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:21:42 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto attached-database-configuration show + Connection: + - keep-alive + ParameterSetName: + - --attached-database-configuration-name --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterfollower/attachedDatabaseConfigurations/attachedDatabaseConfigurations2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterfollower/AttachedDatabaseConfigurations/attachedDatabaseConfigurations2","name":"testcliclusterfollower/attachedDatabaseConfigurations2","type":"Microsoft.Kusto/Clusters/AttachedDatabaseConfigurations","etag":"\"\"","location":"West + US","tags":{},"properties":{"clusterResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader","databaseName":"Kustodatabase8","attachedDatabaseNames":["Kustodatabase8"],"defaultPrincipalsModificationKind":"Union","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '833' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:21:44 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto attached-database-configuration list + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/attachedDatabaseConfigurations?api-version=2020-02-15 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:21:45 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster list-follower-database + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/listFollowerDatabases?api-version=2020-02-15 + response: + body: + string: '{"value":[{"clusterResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterfollower","attachedDatabaseConfigurationName":"attachedDatabaseConfigurations2","databaseName":"Kustodatabase8"}]}' + headers: + cache-control: + - no-cache + content-length: + - '338' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:21:48 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: 'b''{"clusterResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterfollower", + "attachedDatabaseConfigurationName": "attachedDatabaseConfigurations2"}''' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster detach-follower-database + Connection: + - keep-alive + Content-Length: + - '297' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name --attached-database-configuration-name --cluster-resource-id + --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/detachFollowerDatabases?api-version=2020-02-15 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/dea1b1ec-2c9a-4211-8c78-ac06e1dee24a?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 28 Apr 2020 10:21:50 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dea1b1ec-2c9a-4211-8c78-ac06e1dee24a?api-version=2020-02-15&operationResultResponseType=Location + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster detach-follower-database + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --attached-database-configuration-name --cluster-resource-id + --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dea1b1ec-2c9a-4211-8c78-ac06e1dee24a?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dea1b1ec-2c9a-4211-8c78-ac06e1dee24a","name":"dea1b1ec-2c9a-4211-8c78-ac06e1dee24a","status":"Succeeded","startTime":"2020-04-28T10:21:50.7194436Z","endTime":"2020-04-28T10:21:53.6569647Z","percentComplete":1.0,"properties":{"OperationKind":"FollowerDatabaseDetach","RootActivityId":"7dd97118-3064-4c00-ace5-ed328147a033","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '475' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:22:20 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster detach-follower-database + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --attached-database-configuration-name --cluster-resource-id + --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dea1b1ec-2c9a-4211-8c78-ac06e1dee24a?api-version=2020-02-15&operationResultResponseType=Location + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 28 Apr 2020 10:22:21 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '298' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto data-connection event-hub data-connection-validation + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --data-connection-name --consumer-group --event-hub-resource-id + --resource-group + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.13 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/resourcegroups/clitest000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001","name":"clitest000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-28T09:55:34Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '428' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:22:22 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: '{"dataConnectionName": "DataConnections8", "properties": {"location": "westus", + "kind": "EventHub", "properties": {"eventHubResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cliautogeneration-rg/providers/Microsoft.EventHub/namespaces/cliautogeneration/eventhubs/cliautogeneration-evenhub", + "consumerGroup": "$Default"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto data-connection event-hub data-connection-validation + Connection: + - keep-alive + Content-Length: + - '352' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name --database-name --data-connection-name --consumer-group --event-hub-resource-id + --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/KustoDatabase8/dataConnectionValidation?api-version=2020-02-15 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:22:26 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "kind": "EventHub", "properties": {"eventHubResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cliautogeneration-rg/providers/Microsoft.EventHub/namespaces/cliautogeneration/eventhubs/cliautogeneration-evenhub", + "consumerGroup": "$Default"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto data-connection event-hub create + Connection: + - keep-alive + Content-Length: + - '294' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name --data-connection-name --database-name --location --consumer-group + --event-hub-resource-id --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/KustoDatabase8/dataConnections/DataConnections8?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/Databases/KustoDatabase8/DataConnections/DataConnections8","name":"testcliclusterleader/KustoDatabase8/DataConnections8","type":"Microsoft.Kusto/Clusters/Databases/DataConnections","etag":"\"\"","location":"westus","kind":"EventHub","properties":{"eventHubResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cliautogeneration-rg/providers/Microsoft.EventHub/namespaces/cliautogeneration/eventhubs/cliautogeneration-evenhub","consumerGroup":"$Default","provisioningState":"Creating"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/c9c0ad4f-0ad4-4df1-8b89-170b4859dab6?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '717' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:22:29 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '199' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto data-connection event-hub create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --data-connection-name --database-name --location --consumer-group + --event-hub-resource-id --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/c9c0ad4f-0ad4-4df1-8b89-170b4859dab6?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/c9c0ad4f-0ad4-4df1-8b89-170b4859dab6","name":"c9c0ad4f-0ad4-4df1-8b89-170b4859dab6","status":"Succeeded","startTime":"2020-04-28T10:22:29.549257Z","endTime":"2020-04-28T10:22:56.7089309Z","percentComplete":1.0,"properties":{"OperationKind":"DmServiceEventHubObtainerAdd","RootActivityId":"ffa15acd-9c49-44ed-a223-22554036e5e0","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '479' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:22:59 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto data-connection event-hub create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --data-connection-name --database-name --location --consumer-group + --event-hub-resource-id --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/KustoDatabase8/dataConnections/DataConnections8?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/Databases/KustoDatabase8/DataConnections/DataConnections8","name":"testcliclusterleader/KustoDatabase8/DataConnections8","type":"Microsoft.Kusto/Clusters/Databases/DataConnections","etag":"\"\"","location":"West + US","kind":"EventHub","tags":{},"properties":{"eventHubResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cliautogeneration-rg/providers/Microsoft.EventHub/namespaces/cliautogeneration/eventhubs/cliautogeneration-evenhub","consumerGroup":"$Default","tableName":"","mappingRuleName":"","dataFormat":"","eventSystemProperties":[],"compression":"None","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '829' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:22:59 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto data-connection show + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --data-connection-name --database-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/KustoDatabase8/dataConnections/DataConnections8?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/Databases/KustoDatabase8/DataConnections/DataConnections8","name":"testcliclusterleader/KustoDatabase8/DataConnections8","type":"Microsoft.Kusto/Clusters/Databases/DataConnections","etag":"\"\"","location":"West + US","kind":"EventHub","tags":{},"properties":{"eventHubResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cliautogeneration-rg/providers/Microsoft.EventHub/namespaces/cliautogeneration/eventhubs/cliautogeneration-evenhub","consumerGroup":"$Default","tableName":"","mappingRuleName":"","dataFormat":"","eventSystemProperties":[],"compression":"None","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '829' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:23:02 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "kind": "EventHub", "properties": {"eventHubResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cliautogeneration-rg/providers/Microsoft.EventHub/namespaces/cliautogeneration/eventhubs/cliautogeneration-evenhub", + "consumerGroup": "$Default"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto data-connection event-hub update + Connection: + - keep-alive + Content-Length: + - '294' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name --data-connection-name --database-name --location --consumer-group + --event-hub-resource-id --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/KustoDatabase8/dataConnections/DataConnections8?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/Databases/KustoDatabase8/DataConnections/DataConnections8","name":"testcliclusterleader/KustoDatabase8/DataConnections8","type":"Microsoft.Kusto/Clusters/Databases/DataConnections","etag":"\"\"","location":"West + US","kind":"EventHub","tags":{},"properties":{"eventHubResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cliautogeneration-rg/providers/Microsoft.EventHub/namespaces/cliautogeneration/eventhubs/cliautogeneration-evenhub","consumerGroup":"$Default","provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/d6a231ee-5818-480f-b8ce-833b7c299df7?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '728' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:23:03 GMT + etag: + - '""' + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/d6a231ee-5818-480f-b8ce-833b7c299df7?api-version=2020-02-15&operationResultResponseType=Location + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '198' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto data-connection event-hub update + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --data-connection-name --database-name --location --consumer-group + --event-hub-resource-id --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/d6a231ee-5818-480f-b8ce-833b7c299df7?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/d6a231ee-5818-480f-b8ce-833b7c299df7","name":"d6a231ee-5818-480f-b8ce-833b7c299df7","status":"Succeeded","startTime":"2020-04-28T10:23:04.1465482Z","endTime":"2020-04-28T10:23:06.677815Z","percentComplete":1.0,"properties":{"OperationKind":"DmServiceEventHubObtainerAdd","RootActivityId":"2f5b7855-bdb4-4c87-abda-548a343f2436","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '480' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:23:34 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '298' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto data-connection event-hub update + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --data-connection-name --database-name --location --consumer-group + --event-hub-resource-id --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/KustoDatabase8/dataConnections/DataConnections8?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/testcliclusterleader/Databases/KustoDatabase8/DataConnections/DataConnections8","name":"testcliclusterleader/KustoDatabase8/DataConnections8","type":"Microsoft.Kusto/Clusters/Databases/DataConnections","etag":"\"\"","location":"West + US","kind":"EventHub","tags":{},"properties":{"eventHubResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cliautogeneration-rg/providers/Microsoft.EventHub/namespaces/cliautogeneration/eventhubs/cliautogeneration-evenhub","consumerGroup":"$Default","tableName":null,"mappingRuleName":null,"dataFormat":null,"eventSystemProperties":[],"compression":"None","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '835' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:23:35 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '298' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto data-connection delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --cluster-name --data-connection-name --database-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/KustoDatabase8/dataConnections/DataConnections8?api-version=2020-02-15 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/e9dec68c-5a9b-454f-bf18-11a7c551370c?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 28 Apr 2020 10:23:38 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/e9dec68c-5a9b-454f-bf18-11a7c551370c?api-version=2020-02-15&operationResultResponseType=Location + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto data-connection delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --data-connection-name --database-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/e9dec68c-5a9b-454f-bf18-11a7c551370c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/e9dec68c-5a9b-454f-bf18-11a7c551370c","name":"e9dec68c-5a9b-454f-bf18-11a7c551370c","status":"Succeeded","startTime":"2020-04-28T10:23:38.3361502Z","endTime":"2020-04-28T10:23:39.6329981Z","percentComplete":1.0,"properties":{"OperationKind":"DmServiceDataObtainerDrop","RootActivityId":"802d8676-8c34-4029-b9f2-48cfbf5005f2","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '478' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:24:08 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '298' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/stop?api-version=2020-02-15 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 28 Apr 2020 10:24:10 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15&operationResultResponseType=Location + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:24:41 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:25:11 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '298' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:25:43 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '297' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:26:13 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '296' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:26:43 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '295' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:27:14 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '294' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:27:44 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '293' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:28:15 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '292' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:28:46 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '291' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:29:16 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '290' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:29:47 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:30:18 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:30:48 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '288' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:31:19 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '287' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:31:49 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '286' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:32:19 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '285' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:32:50 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '284' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:33:21 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '283' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:33:52 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '282' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:34:22 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '281' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:34:53 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '280' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:35:24 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:35:55 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '288' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:36:25 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '287' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:36:56 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '286' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:37:26 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '285' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:37:57 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '284' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:38:28 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '283' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Running","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:24:12.3219579Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:38:57 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '282' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/dbf9ffd8-b188-483f-8107-fc5706d7b71c","name":"dbf9ffd8-b188-483f-8107-fc5706d7b71c","status":"Succeeded","startTime":"2020-04-28T10:24:11.5563535Z","endTime":"2020-04-28T10:39:05.3481839Z","percentComplete":1.0,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"59d5cd91-06ca-403f-8f6a-4452f87bb18c","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '467' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:39:29 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '281' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/dbf9ffd8-b188-483f-8107-fc5706d7b71c?api-version=2020-02-15&operationResultResponseType=Location + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 28 Apr 2020 10:39:30 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '280' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/start?api-version=2020-02-15 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 28 Apr 2020 10:39:32 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15&operationResultResponseType=Location + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/6f491254-44d8-4290-83ce-832acd8eecbf","name":"6f491254-44d8-4290-83ce-832acd8eecbf","status":"Running","startTime":"2020-04-28T10:39:33.1766281Z","endTime":"2020-04-28T10:39:34.2235352Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"836d4cd0-8abe-4c7b-ad3f-fcd294c99dfc","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:40:03 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/6f491254-44d8-4290-83ce-832acd8eecbf","name":"6f491254-44d8-4290-83ce-832acd8eecbf","status":"Running","startTime":"2020-04-28T10:39:33.1766281Z","endTime":"2020-04-28T10:39:34.2235352Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"836d4cd0-8abe-4c7b-ad3f-fcd294c99dfc","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:40:33 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '298' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/6f491254-44d8-4290-83ce-832acd8eecbf","name":"6f491254-44d8-4290-83ce-832acd8eecbf","status":"Running","startTime":"2020-04-28T10:39:33.1766281Z","endTime":"2020-04-28T10:39:34.2235352Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"836d4cd0-8abe-4c7b-ad3f-fcd294c99dfc","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:41:04 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '297' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/6f491254-44d8-4290-83ce-832acd8eecbf","name":"6f491254-44d8-4290-83ce-832acd8eecbf","status":"Running","startTime":"2020-04-28T10:39:33.1766281Z","endTime":"2020-04-28T10:39:34.2235352Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"836d4cd0-8abe-4c7b-ad3f-fcd294c99dfc","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:41:34 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '296' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/6f491254-44d8-4290-83ce-832acd8eecbf","name":"6f491254-44d8-4290-83ce-832acd8eecbf","status":"Running","startTime":"2020-04-28T10:39:33.1766281Z","endTime":"2020-04-28T10:39:34.2235352Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"836d4cd0-8abe-4c7b-ad3f-fcd294c99dfc","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:42:05 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '295' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/6f491254-44d8-4290-83ce-832acd8eecbf","name":"6f491254-44d8-4290-83ce-832acd8eecbf","status":"Running","startTime":"2020-04-28T10:39:33.1766281Z","endTime":"2020-04-28T10:39:34.2235352Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"836d4cd0-8abe-4c7b-ad3f-fcd294c99dfc","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:42:35 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '294' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/6f491254-44d8-4290-83ce-832acd8eecbf","name":"6f491254-44d8-4290-83ce-832acd8eecbf","status":"Running","startTime":"2020-04-28T10:39:33.1766281Z","endTime":"2020-04-28T10:39:34.2235352Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"836d4cd0-8abe-4c7b-ad3f-fcd294c99dfc","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:43:06 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '293' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/6f491254-44d8-4290-83ce-832acd8eecbf","name":"6f491254-44d8-4290-83ce-832acd8eecbf","status":"Running","startTime":"2020-04-28T10:39:33.1766281Z","endTime":"2020-04-28T10:39:34.2235352Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"836d4cd0-8abe-4c7b-ad3f-fcd294c99dfc","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:44:24 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '292' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/6f491254-44d8-4290-83ce-832acd8eecbf","name":"6f491254-44d8-4290-83ce-832acd8eecbf","status":"Running","startTime":"2020-04-28T10:39:33.1766281Z","endTime":"2020-04-28T10:39:34.2235352Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"836d4cd0-8abe-4c7b-ad3f-fcd294c99dfc","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:44:54 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '291' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/6f491254-44d8-4290-83ce-832acd8eecbf","name":"6f491254-44d8-4290-83ce-832acd8eecbf","status":"Running","startTime":"2020-04-28T10:39:33.1766281Z","endTime":"2020-04-28T10:39:34.2235352Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"836d4cd0-8abe-4c7b-ad3f-fcd294c99dfc","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:45:24 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '290' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/6f491254-44d8-4290-83ce-832acd8eecbf","name":"6f491254-44d8-4290-83ce-832acd8eecbf","status":"Running","startTime":"2020-04-28T10:39:33.1766281Z","endTime":"2020-04-28T10:39:34.2235352Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"836d4cd0-8abe-4c7b-ad3f-fcd294c99dfc","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:45:55 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/6f491254-44d8-4290-83ce-832acd8eecbf","name":"6f491254-44d8-4290-83ce-832acd8eecbf","status":"Running","startTime":"2020-04-28T10:39:33.1766281Z","endTime":"2020-04-28T10:39:34.2235352Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"836d4cd0-8abe-4c7b-ad3f-fcd294c99dfc","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:46:25 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '288' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/6f491254-44d8-4290-83ce-832acd8eecbf","name":"6f491254-44d8-4290-83ce-832acd8eecbf","status":"Running","startTime":"2020-04-28T10:39:33.1766281Z","endTime":"2020-04-28T10:39:34.2235352Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"836d4cd0-8abe-4c7b-ad3f-fcd294c99dfc","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:46:56 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '287' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/6f491254-44d8-4290-83ce-832acd8eecbf","name":"6f491254-44d8-4290-83ce-832acd8eecbf","status":"Running","startTime":"2020-04-28T10:39:33.1766281Z","endTime":"2020-04-28T10:39:34.2235352Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"836d4cd0-8abe-4c7b-ad3f-fcd294c99dfc","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:47:27 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '286' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/6f491254-44d8-4290-83ce-832acd8eecbf","name":"6f491254-44d8-4290-83ce-832acd8eecbf","status":"Succeeded","startTime":"2020-04-28T10:39:33.1766281Z","endTime":"2020-04-28T10:47:35.476039Z","percentComplete":1.0,"properties":{"OperationKind":"ClusterResume","RootActivityId":"836d4cd0-8abe-4c7b-ad3f-fcd294c99dfc","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '465' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:47:58 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '285' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/6f491254-44d8-4290-83ce-832acd8eecbf?api-version=2020-02-15&operationResultResponseType=Location + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 28 Apr 2020 10:47:58 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '284' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --cluster-name --database-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader/databases/KustoDatabase8?api-version=2020-02-15 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/64306fb5-dcc5-4729-991c-006de20e5db9?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 28 Apr 2020 10:48:01 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/64306fb5-dcc5-4729-991c-006de20e5db9?api-version=2020-02-15&operationResultResponseType=Location + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/64306fb5-dcc5-4729-991c-006de20e5db9?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/64306fb5-dcc5-4729-991c-006de20e5db9","name":"64306fb5-dcc5-4729-991c-006de20e5db9","status":"Succeeded","startTime":"2020-04-28T10:48:01.4605354Z","endTime":"2020-04-28T10:48:04.2573957Z","percentComplete":1.0,"properties":{"OperationKind":"DatabaseDelete","RootActivityId":"bec639e9-c809-4200-a64e-53a2af492466","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '467' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:48:31 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/testcliclusterleader?api-version=2020-02-15 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 28 Apr 2020 10:48:34 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15&operationResultResponseType=Location + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Running","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:48:36.0319982Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:49:05 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Running","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:48:36.0319982Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:49:35 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '298' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Running","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:48:36.0319982Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:50:06 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '297' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Running","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:48:36.0319982Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:50:37 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '296' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Running","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:48:36.0319982Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:51:07 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '295' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Running","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:48:36.0319982Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:51:38 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '294' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Running","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:48:36.0319982Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:52:08 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '293' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Running","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:48:36.0319982Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:52:39 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '292' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Running","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:48:36.0319982Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:53:10 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '291' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Running","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:48:36.0319982Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:53:40 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '290' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Running","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:48:36.0319982Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:54:10 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Running","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:48:36.0319982Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:54:41 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '288' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Running","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:48:36.0319982Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:55:12 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Running","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:48:36.0319982Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:55:42 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '288' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Running","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:48:36.0319982Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:56:13 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '287' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/c3fe7f15-8be1-494a-becb-cfc38604d2d5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/c3fe7f15-8be1-494a-becb-cfc38604d2d5","name":"c3fe7f15-8be1-494a-becb-cfc38604d2d5","status":"Succeeded","startTime":"2020-04-28T10:48:35.2663497Z","endTime":"2020-04-28T10:56:30.6219336Z","percentComplete":1.0,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"53807f12-2f09-47af-aa42-06fc724cc160","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '466' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 28 Apr 2020 10:56:44 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '286' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/kusto/azext_kusto/manual/tests/latest/test_kusto_scenario.py b/src/kusto/azext_kusto/manual/tests/latest/test_kusto_scenario.py new file mode 100644 index 00000000000..6cbe1f6ca7f --- /dev/null +++ b/src/kusto/azext_kusto/manual/tests/latest/test_kusto_scenario.py @@ -0,0 +1,468 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import os +import unittest + +from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk import ScenarioTest +from .. import try_manual +from azure.cli.testsdk import ResourceGroupPreparer + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +@try_manual +def setup(test, rg): + pass + + +# EXAMPLE: kustoclusterscreateorupdate +@try_manual +def step_kustoclusterscreateorupdate2(test, rg): + test.cmd('az kusto cluster create ' + '--cluster-name "{Clusters_2}" ' + '--identity-type "SystemAssigned" ' + '--location "westus" ' + '--enable-purge true ' + '--enable-streaming-ingest true ' + '--key-vault-properties key-name="" key-vault-uri="" key-version="" ' + '--sku name="Standard_L8s" capacity=2 tier="Standard" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclusterscreateorupdate +@try_manual +def step_kustoclusterscreateorupdate(test, rg): + test.cmd('az kusto cluster create ' + '--cluster-name "{Clusters_3}" ' + '--identity-type "SystemAssigned" ' + '--location "westus" ' + '--enable-purge true ' + '--enable-streaming-ingest true ' + '--key-vault-properties key-name="" key-vault-uri="" key-version="" ' + '--sku name="Standard_L8s" capacity=2 tier="Standard" ' + '--resource-group "{rg}"', + checks=[]) + test.cmd('az kusto cluster wait --created ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclusterschecknameavailability +@try_manual +def step_kustoclusterschecknameavailability(test, rg): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: kustoclustersget +@try_manual +def step_kustoclustersget(test, rg): + test.cmd('az kusto cluster show ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclusterslist +@try_manual +def step_kustoclusterslist(test, rg): + test.cmd('az kusto cluster list', + checks=[]) + + +# EXAMPLE: kustoclusterslistbyresourcegroup +@try_manual +def step_kustoclusterslistbyresourcegroup(test, rg): + test.cmd('az kusto cluster list ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclustersstop +@try_manual +def step_kustoclustersstop(test, rg): + test.cmd('az kusto cluster stop ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclustersstart +@try_manual +def step_kustoclustersstart(test, rg): + test.cmd('az kusto cluster start ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclusterslistresourceskus +@try_manual +def step_kustoclusterslistresourceskus(test, rg): + test.cmd('az kusto cluster list-sku ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclusterslistskus +@try_manual +def step_kustoclusterslistskus(test, rg): + test.cmd('az kusto cluster list-sku', + checks=[]) + + +# EXAMPLE: kustodatabasescreateorupdate +@try_manual +def step_kustodatabasescreateorupdate(test, rg): + test.cmd('az kusto database create ' + '--cluster-name "{Clusters_3}" ' + '--database-name "KustoDatabase8" ' + '--read-write-database location="westus" soft-delete-period="P1D" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustodatabasechecknameavailability +@try_manual +def step_kustodatabasechecknameavailability(test, rg): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: kustodatabaseslistbycluster +@try_manual +def step_kustodatabaseslistbycluster(test, rg): + test.cmd('az kusto database list ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustodatabasesget +@try_manual +def step_kustodatabasesget(test, rg): + test.cmd('az kusto database show ' + '--cluster-name "{Clusters_3}" ' + '--database-name "KustoDatabase8" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustodatabasesupdate +@try_manual +def step_kustodatabasesupdate(test, rg): + test.cmd('az kusto database update ' + '--cluster-name "{Clusters_3}" ' + '--database-name "KustoDatabase8" ' + '--read-write-database soft-delete-period="P1D" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustodatabaseprincipalassignmentscreateorupdate +@try_manual +def step_kustodatabaseprincipalassignmentscreateorupdate(test, rg): + test.cmd('az kusto database-principal-assignment create ' + '--cluster-name "{Clusters_3}" ' + '--database-name "Kustodatabase8" ' + '--principal-id "d9a1f322-1293-4595-91e3-f54f8bb34725" ' + '--principal-type "App" ' + '--role "Admin" ' + '--tenant-id "33e01921-4d64-4f8c-a055-5bdaffd5e33d" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + test.cmd('az kusto database-principal-assignment wait --created ' + '--cluster-name "{Clusters_3}" ' + '--database-name "Kustodatabase8" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustodatabaselistprincipals +@try_manual +def step_kustodatabaselistprincipals(test, rg): + test.cmd('az kusto database list-principal ' + '--cluster-name "{Clusters_3}" ' + '--database-name "Kustodatabase8" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustodatabaseprincipalassignmentsget +@try_manual +def step_kustodatabaseprincipalassignmentsget(test, rg): + test.cmd('az kusto database-principal-assignment show ' + '--cluster-name "{Clusters_3}" ' + '--database-name "Kustodatabase8" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustodatabaseprincipalassignmentsdelete +@try_manual +def step_kustodatabaseprincipalassignmentsdelete(test, rg): + test.cmd('az kusto database-principal-assignment delete ' + '--cluster-name "{Clusters_3}" ' + '--database-name "Kustodatabase8" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclusterprincipalassignmentscreateorupdate +@try_manual +def step_kustoclusterprincipalassignmentscreateorupdate(test, rg): + test.cmd('az kusto cluster-principal-assignment create ' + '--cluster-name "{Clusters_3}" ' + '--principal-id "d9a1f322-1293-4595-91e3-f54f8bb34725" ' + '--principal-type "App" ' + '--role "AllDatabasesViewer" ' + '--tenant-id "33e01921-4d64-4f8c-a055-5bdaffd5e33d" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + test.cmd('az kusto cluster-principal-assignment wait --created ' + '--principal-assignment-name "kustoprincipal1" ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclusterprincipalassignmentsget +@try_manual +def step_kustoclusterprincipalassignmentsget(test, rg): + test.cmd('az kusto cluster-principal-assignment show ' + '--cluster-name "{Clusters_3}" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: attacheddatabaseconfigurationscreateorupdate +@try_manual +def step_attacheddatabaseconfigurationscreateorupdate(test, rg): + test.cmd('az kusto attached-database-configuration create ' + '--attached-database-configuration-name "{attachedDatabaseConfigurations_1}" ' + '--cluster-name "{Clusters_2}" ' + '--location "westus" ' + '--cluster-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Kusto/Clu' + 'sters/{Clusters_3}" ' + '--database-name "Kustodatabase8" ' + '--default-principals-modification-kind "Union" ' + '--resource-group "{rg}"', + checks=[]) + test.cmd('az kusto attached-database-configuration wait --created ' + '--cluster-name "{Clusters_2}" ' + '--attached-database-configuration-name "{attachedDatabaseConfigurations_1}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: attacheddatabaseconfigurationsget +@try_manual +def step_attacheddatabaseconfigurationsget(test, rg): + test.cmd('az kusto attached-database-configuration show ' + '--attached-database-configuration-name "{attachedDatabaseConfigurations_1}" ' + '--cluster-name "{Clusters_2}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoattacheddatabaseconfigurationslistbycluster +@try_manual +def step_kustoattacheddatabaseconfigurationslistbycluster(test, rg): + test.cmd('az kusto attached-database-configuration list ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclusterlistfollowerdatabases +@try_manual +def step_kustoclusterlistfollowerdatabases(test, rg): + test.cmd('az kusto cluster list-follower-database ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclusterdetachfollowerdatabases +@try_manual +def step_kustoclusterdetachfollowerdatabases(test, rg): + test.cmd('az kusto cluster detach-follower-database ' + '--cluster-name "{Clusters_3}" ' + '--attached-database-configuration-name "{attachedDatabaseConfigurations_1}" ' + '--cluster-resource-id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Kusto/clu' + 'sters/{Clusters_2}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustooperationslist +@try_manual +def step_kustooperationslist(test, rg): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: kustodatabasesdelete +@try_manual +def step_kustodatabasesdelete(test, rg): + test.cmd('az kusto database delete ' + '--cluster-name "{Clusters_3}" ' + '--database-name "KustoDatabase8" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclustersdelete +@try_manual +def step_kustoclustersdelete(test, rg): + test.cmd('az kusto cluster delete ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDataConnectionValidation +@try_manual +def step_kustodataconnectionvalidation(test, rg): + test.cmd('az kusto data-connection event-hub data-connection-validation ' + '--cluster-name "{Clusters_3}" ' + '--database-name "KustoDatabase8" ' + '--data-connection-name "{DataConnections8}" ' + '--consumer-group "$Default" ' + '--event-hub-resource-id "/subscriptions/fbccad30-f0ed-4ac4-9497-93bf6141062f/resourceGroups/cliautogeneration-rg/providers/Microsoft.EventHub/namespaces/cliautogeneration/eventhubs/cliautogeneration-evenhub" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDataConnectionsCreateOrUpdate +@try_manual +def step_kustodataconnectionscreateorupdate(test, rg): + test.cmd('az kusto data-connection event-hub create ' + '--cluster-name "{Clusters_3}" ' + '--data-connection-name "{DataConnections8}" ' + '--database-name "KustoDatabase8" ' + '--location "westus" ' + '--consumer-group "$Default" ' + '--event-hub-resource-id "/subscriptions/fbccad30-f0ed-4ac4-9497-93bf6141062f/resourceGroups/cliautogeneration-rg/providers/Microsoft.EventHub/namespaces/cliautogeneration/eventhubs/cliautogeneration-evenhub" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDataConnectionsGet +@try_manual +def step_kustodataconnectionsget(test, rg): + test.cmd('az kusto data-connection show ' + '--cluster-name "{Clusters_3}" ' + '--data-connection-name "{DataConnections8}" ' + '--database-name "KustoDatabase8" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDataConnectionsUpdate +@try_manual +def step_kustodataconnectionsupdate(test, rg): + test.cmd('az kusto data-connection event-hub update ' + '--cluster-name "{Clusters_3}" ' + '--data-connection-name "{DataConnections8}" ' + '--database-name "KustoDatabase8" ' + '--location "westus" ' + '--consumer-group "$Default" ' + '--event-hub-resource-id "/subscriptions/fbccad30-f0ed-4ac4-9497-93bf6141062f/resourceGroups/cliautogeneration-rg/providers/Microsoft.EventHub/namespaces/cliautogeneration/eventhubs/cliautogeneration-evenhub" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: KustoDataConnectionsDelete +@try_manual +def step_kustodataconnectionsdelete(test, rg): + test.cmd('az kusto data-connection delete ' + '--cluster-name "{Clusters_3}" ' + '--data-connection-name "{DataConnections8}" ' + '--database-name "KustoDatabase8" ' + '--resource-group "{rg}"', + checks=[]) + + +@try_manual +def cleanup(test, rg): + pass + + +@try_manual +def call_scenario(test, rg): + setup(test, rg) + step_kustoclusterscreateorupdate2(test, rg) + step_kustoclusterscreateorupdate(test, rg) + step_kustoclusterschecknameavailability(test, rg) + step_kustoclustersget(test, rg) + step_kustoclusterslist(test, rg) + step_kustoclusterslistbyresourcegroup(test, rg) + step_kustoclusterslistresourceskus(test, rg) + step_kustoclusterslistskus(test, rg) + step_kustodatabasescreateorupdate(test, rg) + step_kustodatabasechecknameavailability(test, rg) + step_kustodatabaseslistbycluster(test, rg) + step_kustodatabasesget(test, rg) + step_kustodatabasesupdate(test, rg) + step_kustodatabaseprincipalassignmentscreateorupdate(test, rg) + step_kustodatabaselistprincipals(test, rg) + step_kustodatabaseprincipalassignmentsget(test, rg) + step_kustodatabaseprincipalassignmentsdelete(test, rg) + step_kustoclusterprincipalassignmentscreateorupdate(test, rg) + step_kustoclusterprincipalassignmentsget(test, rg) + step_attacheddatabaseconfigurationscreateorupdate(test, rg) + step_attacheddatabaseconfigurationsget(test, rg) + step_kustoattacheddatabaseconfigurationslistbycluster(test, rg) + step_kustoclusterlistfollowerdatabases(test, rg) + step_kustoclusterdetachfollowerdatabases(test, rg) + step_kustodataconnectionvalidation(test, rg) + step_kustodataconnectionscreateorupdate(test, rg) + step_kustodataconnectionsget(test, rg) + step_kustodataconnectionsupdate(test, rg) + step_kustodataconnectionsdelete(test, rg) + step_kustooperationslist(test, rg) + step_kustoclustersstop(test, rg) + step_kustoclustersstart(test, rg) + step_kustodatabasesdelete(test, rg) + step_kustoclustersdelete(test, rg) + cleanup(test, rg) + + +@try_manual +class KustoManagementClientScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestkusto_kustorptest'[:7], key='rg', parameter_name='rg') + def test_kusto(self, rg): + + self.kwargs.update({ + 'subscription_id': self.get_subscription_id() + }) + + self.kwargs.update({ + 'Clusters_2': 'testcliclusterfollower', + 'Clusters_3': 'testcliclusterleader', + 'attachedDatabaseConfigurations_1': 'attachedDatabaseConfigurations2', + 'DataConnections8': 'DataConnections8', + }) + + call_scenario(self, rg) diff --git a/src/kusto/azext_kusto/tests/__init__.py b/src/kusto/azext_kusto/tests/__init__.py new file mode 100644 index 00000000000..9a6531122f6 --- /dev/null +++ b/src/kusto/azext_kusto/tests/__init__.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +import inspect +import os + + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func) + module_path = __path__[0] + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + print("running {}()...".format(func.__name__)) + return func_to_call(*args, **kwargs) + + if inspect.isclass(func): + return get_func_to_call() + return wrapper diff --git a/src/kusto/azext_kusto/tests/latest/__init__.py b/src/kusto/azext_kusto/tests/latest/__init__.py new file mode 100644 index 00000000000..ee0c4f36bd0 --- /dev/null +++ b/src/kusto/azext_kusto/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/kusto/azext_kusto/tests/latest/preparers.py b/src/kusto/azext_kusto/tests/latest/preparers.py new file mode 100644 index 00000000000..93cae98db6b --- /dev/null +++ b/src/kusto/azext_kusto/tests/latest/preparers.py @@ -0,0 +1,116 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import os +from datetime import datetime +from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer +from azure_devtools.scenario_tests import SingleValueReplacer +from azure.cli.testsdk.exceptions import CliTestError +from azure.cli.testsdk.reverse_dependency import get_dummy_cli + +KEY_RESOURCE_GROUP = 'rg' +KEY_VIRTUAL_NETWORK = 'vnet' +KEY_VNET_SUBNET = 'subnet' + + +class VirtualNetworkPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.vn', + parameter_name='virtual_network', + resource_group_name=None, + resource_group_key=KEY_RESOURCE_GROUP, + dev_setting_name='AZURE_CLI_TEST_DEV_VIRTUAL_NETWORK_NAME', + random_name_length=24, key=KEY_VIRTUAL_NETWORK): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VirtualNetworkPreparer, self).__init__( + name_prefix, random_name_length) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group_name = resource_group_name + self.resource_group_key = resource_group_key + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **kwargs): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group_name: + self.resource_group_name = self.test_class_instance.kwargs.get( + self.resource_group_key) + if not self.resource_group_name: + raise CliTestError("Error: No resource group configured!") + + tags = {'product': 'azurecli', 'cause': 'automation', + 'date': datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')} + if 'ENV_JOB_NAME' in os.environ: + tags['job'] = os.environ['ENV_JOB_NAME'] + tags = ' '.join(['{}={}'.format(key, value) + for key, value in tags.items()]) + template = 'az network vnet create --resource-group {} --name {} --tag ' + tags + self.live_only_execute(self.cli_ctx, template.format( + self.resource_group_name, name)) + + self.test_class_instance.kwargs[self.key] = name + return {self.parameter_name: name} + + def remove_resource(self, name, **kwargs): + # delete vnet if test is being recorded and if the vnet is not a dev rg + if not self.dev_setting_name: + self.live_only_execute( + self.cli_ctx, 'az network vnet delete --name {} --resource-group {}' + .format(name, self.resource_group_name)) + + +class VnetSubnetPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.vn', + parameter_name='subnet', + resource_group_name=None, + resource_group_key=KEY_RESOURCE_GROUP, + vnet_name=None, + vnet_key=KEY_VIRTUAL_NETWORK, + address_prefixes="11.0.0.0/24", + dev_setting_name='AZURE_CLI_TEST_DEV_VNET_SUBNET_NAME', + random_name_length=24, key=KEY_VNET_SUBNET): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VnetSubnetPreparer, self).__init__( + name_prefix, random_name_length) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group_name = resource_group_name + self.resource_group_key = resource_group_key + self.vnet_name = vnet_name + self.vnet_key = vnet_key + self.address_prefixes = address_prefixes + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **kwargs): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group_name: + self.resource_group_name = self.test_class_instance.kwargs.get( + self.resource_group_key) + if not self.resource_group_name: + raise CliTestError("Error: No resource group configured!") + if not self.vnet_name: + self.vnet_name = self.test_class_instance.kwargs.get(self.vnet_key) + if not self.vnet_name: + raise CliTestError("Error: No vnet configured!") + + self.test_class_instance.kwargs[self.key] = 'default' + return {self.parameter_name: name} + + def remove_resource(self, name, **kwargs): + pass diff --git a/src/kusto/azext_kusto/tests/latest/recordings/test_kusto.yaml b/src/kusto/azext_kusto/tests/latest/recordings/test_kusto.yaml new file mode 100644 index 00000000000..fa49f1d7cdb --- /dev/null +++ b/src/kusto/azext_kusto/tests/latest/recordings/test_kusto.yaml @@ -0,0 +1,6221 @@ +interactions: +- request: + body: '{"location": "westus", "sku": {"name": "Standard_L8s", "capacity": 2, "tier": + "Standard"}, "properties": {"enableStreamingIngest": true, "keyVaultProperties": + {"keyName": "", "keyVersion": "", "keyVaultUri": ""}, "enablePurge": true}, + "identity": {"type": "SystemAssigned"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + Content-Length: + - '274' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1","name":"clitestcluster1","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"westus","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"properties":{"enableStreamingIngest":true,"keyVaultProperties":{"keyName":"","keyVersion":"","keyVaultUri":""},"enablePurge":true,"state":"Creating","provisioningState":"Creating"},"identity":{"type":"SystemAssigned"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '575' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:09:53 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '199' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:10:24 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:10:53 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '298' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:11:24 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '297' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:11:55 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '296' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:12:26 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '295' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:12:55 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '294' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:13:26 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '293' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:13:57 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '292' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:14:28 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '291' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:14:57 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '290' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:15:28 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:15:59 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '288' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:16:29 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '287' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:16:59 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '286' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:17:43 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:18:15 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:18:44 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '298' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:19:15 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '297' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Running","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:09:55.946449Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '468' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:19:45 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '296' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/fa5a2bf3-1536-435b-b991-36f5a3771a50?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/fa5a2bf3-1536-435b-b991-36f5a3771a50","name":"fa5a2bf3-1536-435b-b991-36f5a3771a50","status":"Succeeded","startTime":"2020-04-26T14:09:52.5245332Z","endTime":"2020-04-26T14:19:46.9146722Z","percentComplete":1.0,"properties":{"OperationKind":"ClusterCreateExternal","RootActivityId":"933e6cf1-6b39-47de-90d0-c3fb2e2873a0","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '473' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:20:16 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '295' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --identity-type --location --enable-purge --enable-streaming-ingest + --key-vault-properties --sku --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1","name":"clitestcluster1","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://clitestcluster1.westus.kusto.windows.net","dataIngestionUri":"https://ingest-clitestcluster1.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"ed505612-ad56-4399-975f-e98ec3493dcf","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}}' + headers: + cache-control: + - no-cache + content-length: + - '951' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:20:17 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster wait + Connection: + - keep-alive + ParameterSetName: + - --created --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1","name":"clitestcluster1","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://clitestcluster1.westus.kusto.windows.net","dataIngestionUri":"https://ingest-clitestcluster1.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"ed505612-ad56-4399-975f-e98ec3493dcf","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}}' + headers: + cache-control: + - no-cache + content-length: + - '951' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:20:18 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster show + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1","name":"clitestcluster1","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://clitestcluster1.westus.kusto.windows.net","dataIngestionUri":"https://ingest-clitestcluster1.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"ed505612-ad56-4399-975f-e98ec3493dcf","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}}' + headers: + cache-control: + - no-cache + content-length: + - '951' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:20:20 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/clusters?api-version=2020-02-15 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/noamgotest/providers/Microsoft.Kusto/Clusters/noamgotest1","name":"noamgotest1","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + Europe","sku":{"name":"Standard_D14_v2","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Stopped","stateReason":"Suspended + at 3/22/2020 11:23:02 AM","uri":"https://noamgotest1.westeurope.kusto.windows.net","dataIngestionUri":"https://ingest-noamgotest1.westeurope.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/kubill-kustointernalppe/providers/Microsoft.Kusto/Clusters/royi","name":"royi","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"East + US 2","sku":{"name":"Dev(No SLA)_Standard_D11_v2","tier":"Basic","capacity":1},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://royi.eastus2.kusto.windows.net","dataIngestionUri":"https://ingest-royi.eastus2.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/royikusto/providers/Microsoft.Kusto/Clusters/royitest","name":"royitest","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"East + US 2","sku":{"name":"Dev(No SLA)_Standard_D11_v2","tier":"Basic","capacity":1},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://royitest.eastus2.kusto.windows.net","dataIngestionUri":"https://ingest-royitest.eastus2.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":{"keyVaultUri":"https://royitestkv.vault.azure.net","keyName":"TestKey","keyVersion":"0efe068347d641f4bfd20c692f05ca62"},"languageExtensions":{"value":[]},"enablePurge":null,"provisioningState":"Succeeded"},"identity":{"principalId":"a9a04853-74ee-4bde-b14c-25f100bb0d50","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/astauben-tests/providers/Microsoft.Kusto/Clusters/astaubencli","name":"astaubencli","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Dev(No SLA)_Standard_D11_v2","tier":"Basic","capacity":1},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://astaubencli.westus.kusto.windows.net","dataIngestionUri":"https://ingest-astaubencli.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":null,"provisioningState":"Succeeded"},"identity":{"principalId":"fddf12de-e076-4898-853b-c45b21242035","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/astauben-tests/providers/Microsoft.Kusto/Clusters/astaubentestcli","name":"astaubentestcli","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_D12_v2","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://astaubentestcli.westus.kusto.windows.net","dataIngestionUri":"https://ingest-astaubentestcli.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Failed"},"identity":{"principalId":"6b62bb67-0f54-4211-acf7-3f882cca2437","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitestgcjzdmbmffg63ofutofl5dbnfwb2exetloz6e3f2eqiyzlof2p7zqtbabgm7gf3qnr55/providers/Microsoft.Kusto/Clusters/clitestcluster","name":"clitestcluster","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://clitestcluster.westus.kusto.windows.net","dataIngestionUri":"https://ingest-clitestcluster.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"9f650181-5483-4436-b925-ab60f7735b5c","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1","name":"clitestcluster1","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://clitestcluster1.westus.kusto.windows.net","dataIngestionUri":"https://ingest-clitestcluster1.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"ed505612-ad56-4399-975f-e98ec3493dcf","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Kusto/Clusters/testnewkustocluster2","name":"testnewkustocluster2","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"East + US","sku":{"name":"Standard_D11_v2","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://testnewkustocluster2.eastus.kusto.windows.net","dataIngestionUri":"https://ingest-testnewkustocluster2.eastus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/Microsoft.Kusto/Clusters/testnewkustocluster","name":"testnewkustocluster","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"East + US","sku":{"name":"Standard_D11_v2","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://testnewkustocluster.eastus.kusto.windows.net","dataIngestionUri":"https://ingest-testnewkustocluster.eastus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[{"languageExtensionName":"PYTHON"}]},"enablePurge":null,"provisioningState":"Succeeded"},"identity":{"principalId":"e599ae33-a117-4952-bb30-5fab29f6334f","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/gildev/providers/Microsoft.Kusto/Clusters/gilcluster","name":"gilcluster","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"East + US","sku":{"name":"Dev(No SLA)_Standard_D11_v2","tier":"Basic","capacity":1},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://gilcluster.eastus.kusto.windows.net","dataIngestionUri":"https://ingest-gilcluster.eastus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":null,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/orenrgilaysub/providers/Microsoft.Kusto/Clusters/oren2104","name":"oren2104","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"East + US","sku":{"name":"Standard_D11_v2","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://oren2104.eastus.kusto.windows.net","dataIngestionUri":"https://ingest-oren2104.eastus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/noamDRI/providers/Microsoft.Kusto/Clusters/noamskuissue","name":"noamskuissue","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"Australia + East","sku":{"name":"Standard_D14_v2","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Stopped","stateReason":"Suspended + at 3/22/2020 11:20:03 AM","uri":"https://noamskuissue.australiaeast.kusto.windows.net","dataIngestionUri":"https://ingest-noamskuissue.australiaeast.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":false,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":null,"provisioningState":"Succeeded"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '10149' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:20:22 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: + - 9bc1b2c4-aeba-4819-b8fd-62f94f521268 + - f0de48c3-de1d-4686-9863-eeb52647ec02 + - ccf129ca-a033-456d-8f36-dfe9e29c3e3b + - 76cd14a5-72af-4ad9-83e5-8c42b7e47a92 + - c676ce11-1dfc-4083-8399-caed64142e08 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters?api-version=2020-02-15 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1","name":"clitestcluster1","type":"Microsoft.Kusto/Clusters","etag":"\"\"","location":"West + US","sku":{"name":"Standard_L8s","tier":"Standard","capacity":2},"tags":{},"properties":{"state":"Running","stateReason":null,"uri":"https://clitestcluster1.westus.kusto.windows.net","dataIngestionUri":"https://ingest-clitestcluster1.westus.kusto.windows.net","trustedExternalTenants":[],"virtualNetworkConfiguration":null,"optimizedAutoscale":null,"enableDiskEncryption":false,"enableStreamingIngest":true,"keyVaultProperties":null,"languageExtensions":{"value":[]},"enablePurge":true,"provisioningState":"Succeeded"},"identity":{"principalId":"ed505612-ad56-4399-975f-e98ec3493dcf","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","type":"SystemAssigned"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '963' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:20:24 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/stop?api-version=2020-02-15 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '0' + date: + - Sun, 26 Apr 2020 14:20:26 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15&operationResultResponseType=Location + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:20:56 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:21:26 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '298' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:21:57 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '297' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:22:27 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '296' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:22:57 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '295' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:23:28 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '294' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:23:58 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '293' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:24:29 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '292' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:25:00 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '291' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:25:30 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '290' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:26:00 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:26:31 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '288' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:27:01 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '287' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:27:32 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '286' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:28:02 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '285' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:28:33 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '284' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:29:03 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '283' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:29:33 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '282' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:30:04 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:30:35 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '288' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:31:05 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '287' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:31:35 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '286' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Running","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:20:26.9153567Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '463' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:32:06 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '285' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/9b2a246f-120f-43b8-9daf-a3acbb735502","name":"9b2a246f-120f-43b8-9daf-a3acbb735502","status":"Succeeded","startTime":"2020-04-26T14:20:26.2434761Z","endTime":"2020-04-26T14:32:09.042843Z","percentComplete":1.0,"properties":{"OperationKind":"ClusterSuspend","RootActivityId":"61770c44-d8d7-4ad9-932c-4b87f9d38389","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '466' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:32:37 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '284' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster stop + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/9b2a246f-120f-43b8-9daf-a3acbb735502?api-version=2020-02-15&operationResultResponseType=Location + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Sun, 26 Apr 2020 14:32:37 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '283' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/start?api-version=2020-02-15 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '0' + date: + - Sun, 26 Apr 2020 14:32:40 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15&operationResultResponseType=Location + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Running","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:32:41.7309008Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:33:10 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Running","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:32:41.7309008Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:33:40 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '298' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Running","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:32:41.7309008Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:34:11 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '297' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Running","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:32:41.7309008Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:34:42 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '296' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Running","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:32:41.7309008Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:35:12 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '295' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Running","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:32:41.7309008Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:35:45 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '294' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Running","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:32:41.7309008Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:36:16 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '293' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Running","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:32:41.7309008Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:36:46 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '292' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Running","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:32:41.7309008Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:37:17 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '291' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Running","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:32:41.7309008Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:37:48 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '290' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Running","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:32:41.7309008Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:38:17 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Running","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:32:41.7309008Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:38:48 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '288' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Running","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:32:41.7309008Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:39:19 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '287' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Running","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:32:41.7309008Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:39:50 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '286' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Running","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:32:41.7309008Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:40:20 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216","name":"ce96f0e6-aa0d-4157-bfd8-20845d9bc216","status":"Succeeded","startTime":"2020-04-26T14:32:40.7152748Z","endTime":"2020-04-26T14:40:46.5162919Z","percentComplete":1.0,"properties":{"OperationKind":"ClusterResume","RootActivityId":"fef514d5-3fd1-4577-860d-a4506c687d0c","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '466' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:40:51 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '288' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster start + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/ce96f0e6-aa0d-4157-bfd8-20845d9bc216?api-version=2020-02-15&operationResultResponseType=Location + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Sun, 26 Apr 2020 14:40:51 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '287' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster list-sku + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/skus?api-version=2020-02-15 + response: + body: + string: '{"value":[{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_D14_v2","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_D13_v2","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_L8s","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_L16s","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_D11_v2","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":8,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_D12_v2","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":16,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_L4s","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":16,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_L8s_v2","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_L16s_v2","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E2a_v4","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E4a_v4","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E8a_v4","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E16a_v4","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E8as_v4+1TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E8as_v4+2TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E16as_v4+3TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}},{"resourceType":"Microsoft.Kusto/clusters","sku":{"name":"Standard_E16as_v4+4TB_PS","tier":"Standard","locationInfo":[{"location":"West + US","zones":[]}]},"capacity":{"minimum":2,"maximum":1000,"default":2,"scaleType":"Automatic"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '4726' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:40:53 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster list-sku + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/skus?api-version=2020-02-15 + response: + body: + string: '{"value":[{"resourceType":"clusters","name":"Dev(No SLA)_Standard_D11_v2","tier":"Basic","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["centralus"],"locationInfo":[{"location":"centralus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["westeurope"],"locationInfo":[{"location":"westeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["northeurope"],"locationInfo":[{"location":"northeurope","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["eastus2"],"locationInfo":[{"location":"eastus2","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["westcentralus"],"locationInfo":[{"location":"westcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["germanywestcentral"],"locationInfo":[{"location":"germanywestcentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["westus"],"locationInfo":[{"location":"westus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["southeastasia"],"locationInfo":[{"location":"southeastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["eastus"],"locationInfo":[{"location":"eastus","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["westus2"],"locationInfo":[{"location":"westus2","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["southcentralus"],"locationInfo":[{"location":"southcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["northcentralus"],"locationInfo":[{"location":"northcentralus","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["eastasia"],"locationInfo":[{"location":"eastasia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["japaneast"],"locationInfo":[{"location":"japaneast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["canadacentral"],"locationInfo":[{"location":"canadacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["uksouth"],"locationInfo":[{"location":"uksouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["uksouth"],"locationInfo":[{"location":"uksouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["uksouth"],"locationInfo":[{"location":"uksouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["australiaeast"],"locationInfo":[{"location":"australiaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["brazilsouth"],"locationInfo":[{"location":"brazilsouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["japanwest"],"locationInfo":[{"location":"japanwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["southindia"],"locationInfo":[{"location":"southindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["centralindia"],"locationInfo":[{"location":"centralindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["centralindia"],"locationInfo":[{"location":"centralindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["centralindia"],"locationInfo":[{"location":"centralindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["centralindia"],"locationInfo":[{"location":"centralindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["centralindia"],"locationInfo":[{"location":"centralindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["westindia"],"locationInfo":[{"location":"westindia","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L4s","tier":"Standard","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L8s","tier":"Standard","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_L16s","tier":"Standard","locations":["canadaeast"],"locationInfo":[{"location":"canadaeast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["koreacentral"],"locationInfo":[{"location":"koreacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["francecentral"],"locationInfo":[{"location":"francecentral","zones":["2","3","1"],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["ukwest"],"locationInfo":[{"location":"ukwest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["koreasouth"],"locationInfo":[{"location":"koreasouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["francesouth"],"locationInfo":[{"location":"francesouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["francesouth"],"locationInfo":[{"location":"francesouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["francesouth"],"locationInfo":[{"location":"francesouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["francesouth"],"locationInfo":[{"location":"francesouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["francesouth"],"locationInfo":[{"location":"francesouth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["australiasoutheast"],"locationInfo":[{"location":"australiasoutheast","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["southafricanorth"],"locationInfo":[{"location":"southafricanorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["southafricanorth"],"locationInfo":[{"location":"southafricanorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["southafricanorth"],"locationInfo":[{"location":"southafricanorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["southafricanorth"],"locationInfo":[{"location":"southafricanorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["southafricanorth"],"locationInfo":[{"location":"southafricanorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["southafricawest"],"locationInfo":[{"location":"southafricawest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["southafricawest"],"locationInfo":[{"location":"southafricawest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["southafricawest"],"locationInfo":[{"location":"southafricawest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["southafricawest"],"locationInfo":[{"location":"southafricawest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["southafricawest"],"locationInfo":[{"location":"southafricawest","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["australiacentral"],"locationInfo":[{"location":"australiacentral","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["switzerlandnorth"],"locationInfo":[{"location":"switzerlandnorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Dev(No + SLA)_Standard_D11_v2","tier":"Basic","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D11_v2","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D12_v2","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D13_v2","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_D14_v2","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+1TB_PS","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS13_v2+2TB_PS","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+3TB_PS","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]},{"resourceType":"clusters","name":"Standard_DS14_v2+4TB_PS","tier":"Standard","locations":["uaenorth"],"locationInfo":[{"location":"uaenorth","zones":[],"zoneDetails":[]}],"restrictions":[]}]}' + headers: + cache-control: + - no-cache + content-length: + - '60499' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:40:54 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", "kind": "ReadWrite", "properties": {"softDeletePeriod": + "P1D"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database create + Connection: + - keep-alive + Content-Length: + - '86' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name --database-name --read-write-database --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/databases/KustoDatabase8?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1/Databases/KustoDatabase8","name":"clitestcluster1/KustoDatabase8","type":"Microsoft.Kusto/Clusters/Databases","etag":"\"\"","location":"westus","kind":"ReadWrite","properties":{"softDeletePeriod":"P1D","provisioningState":"Creating"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/ce74dd85-6a29-4afc-9a45-730dc4063881?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '435' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:40:56 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '199' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --read-write-database --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationResults/ce74dd85-6a29-4afc-9a45-730dc4063881?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/westus/operationresults/ce74dd85-6a29-4afc-9a45-730dc4063881","name":"ce74dd85-6a29-4afc-9a45-730dc4063881","status":"Succeeded","startTime":"2020-04-26T14:40:57.2819996Z","endTime":"2020-04-26T14:40:59.0007528Z","percentComplete":1.0,"properties":{"OperationKind":"DatabaseCreate","RootActivityId":"175e0306-73bc-4dae-ac11-6ad2ab3c7174","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '466' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:41:26 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --read-write-database --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/databases/KustoDatabase8?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1/Databases/KustoDatabase8","name":"clitestcluster1/KustoDatabase8","type":"Microsoft.Kusto/Clusters/Databases","etag":"\"\"","location":"West + US","kind":"ReadWrite","tags":{},"properties":{"isFollowed":false,"softDeletePeriodInDays":1,"softDeletePeriod":"P1D","hotCachePeriodInDays":0,"hotCachePeriod":null,"statistics":{"size":0.0},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '566' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:41:27 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database list + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/databases?api-version=2020-02-15 + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1/Databases/KustoDatabase8","name":"clitestcluster1/KustoDatabase8","type":"Microsoft.Kusto/Clusters/Databases","etag":"\"\"","location":"West + US","kind":"ReadWrite","properties":{"isFollowed":false,"softDeletePeriodInDays":1,"softDeletePeriod":"P1D","hotCachePeriodInDays":0,"hotCachePeriod":null,"statistics":{"size":0.0},"provisioningState":"Succeeded"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '568' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:41:29 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database show + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/databases/KustoDatabase8?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1/Databases/KustoDatabase8","name":"clitestcluster1/KustoDatabase8","type":"Microsoft.Kusto/Clusters/Databases","etag":"\"\"","location":"West + US","kind":"ReadWrite","tags":{},"properties":{"isFollowed":false,"softDeletePeriodInDays":1,"softDeletePeriod":"P1D","hotCachePeriodInDays":0,"hotCachePeriod":null,"statistics":{"size":0.0},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '566' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:41:31 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"kind": "ReadWrite", "properties": {"softDeletePeriod": "P1D"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database update + Connection: + - keep-alive + Content-Length: + - '64' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name --database-name --read-write-database --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/databases/KustoDatabase8?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1/Databases/KustoDatabase8","name":"clitestcluster1/KustoDatabase8","type":"Microsoft.Kusto/Clusters/Databases","etag":"\"\"","location":"West + US","kind":"ReadWrite","tags":{},"properties":{"softDeletePeriod":"P1D","provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/cb091126-c134-49eb-af0b-579fe6a6d285?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '446' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:41:33 GMT + etag: + - '""' + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cb091126-c134-49eb-af0b-579fe6a6d285?api-version=2020-02-15&operationResultResponseType=Location + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '199' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database update + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --read-write-database --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cb091126-c134-49eb-af0b-579fe6a6d285?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cb091126-c134-49eb-af0b-579fe6a6d285","name":"cb091126-c134-49eb-af0b-579fe6a6d285","status":"Succeeded","startTime":"2020-04-26T14:41:34.2460324Z","endTime":"2020-04-26T14:41:36.6376793Z","percentComplete":1.0,"properties":{"OperationKind":"DatabaseCreate","RootActivityId":"58958202-8da1-4028-8440-aaad800038bf","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '467' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:42:04 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database update + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --read-write-database --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/databases/KustoDatabase8?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1/Databases/KustoDatabase8","name":"clitestcluster1/KustoDatabase8","type":"Microsoft.Kusto/Clusters/Databases","etag":"\"\"","location":"West + US","kind":"ReadWrite","tags":{},"properties":{"isFollowed":false,"softDeletePeriodInDays":1,"softDeletePeriod":"P1D","hotCachePeriodInDays":0,"hotCachePeriod":null,"statistics":{"size":0.0},"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '566' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:42:04 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"principalId": "d9a1f322-1293-4595-91e3-f54f8bb34725", + "role": "Admin", "tenantId": "33e01921-4d64-4f8c-a055-5bdaffd5e33d", "principalType": + "App"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database-principal-assignment create + Connection: + - keep-alive + Content-Length: + - '164' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name --database-name --principal-id --principal-type --role --tenant-id + --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/databases/Kustodatabase8/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1/Databases/Kustodatabase8/PrincipalAssignments/kustoprincipal1","name":"clitestcluster1/Kustodatabase8/kustoprincipal1","type":"Microsoft.Kusto/Clusters/Databases/PrincipalAssignments","etag":"\"\"","properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"Admin","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","principalType":"App","provisioningState":"Creating"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/4f27fac6-979e-460e-a903-6e82f39e1de5?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '585' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:42:07 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '199' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database-principal-assignment create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --principal-id --principal-type --role --tenant-id + --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/4f27fac6-979e-460e-a903-6e82f39e1de5?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/4f27fac6-979e-460e-a903-6e82f39e1de5","name":"4f27fac6-979e-460e-a903-6e82f39e1de5","status":"Succeeded","startTime":"2020-04-26T14:42:07.8283352Z","endTime":"2020-04-26T14:42:07.9845836Z","percentComplete":1.0,"properties":{"OperationKind":"DatabaseAddPrincipals","RootActivityId":"0dd674f5-e23a-4f02-a3e5-3d0b43406789","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '474' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:42:37 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database-principal-assignment create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --principal-id --principal-type --role --tenant-id + --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/databases/Kustodatabase8/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1/Databases/Kustodatabase8/PrincipalAssignments/kustoprincipal1","name":"clitestcluster1/Kustodatabase8/kustoprincipal1","type":"Microsoft.Kusto/Clusters/Databases/PrincipalAssignments","etag":"\"\"","tags":{},"properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"Admin","principalType":"App","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","tenantName":"MS + Azure Cloud","principalName":"KustoResourceProvider","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '666' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:42:37 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database-principal-assignment wait + Connection: + - keep-alive + ParameterSetName: + - --created --cluster-name --database-name --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/databases/Kustodatabase8/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1/Databases/Kustodatabase8/PrincipalAssignments/kustoprincipal1","name":"clitestcluster1/Kustodatabase8/kustoprincipal1","type":"Microsoft.Kusto/Clusters/Databases/PrincipalAssignments","etag":"\"\"","tags":{},"properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"Admin","principalType":"App","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","tenantName":"MS + Azure Cloud","principalName":"KustoResourceProvider","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '666' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:42:40 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database list-principal + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --cluster-name --database-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/databases/Kustodatabase8/listPrincipals?api-version=2020-02-15 + response: + body: + string: '{"value":[{"name":"KustoResourceProvider","role":"Admin","type":"App","fqn":"aadapp=d9a1f322-1293-4595-91e3-f54f8bb34725;33e01921-4d64-4f8c-a055-5bdaffd5e33d","email":"","appId":"d9a1f322-1293-4595-91e3-f54f8bb34725","tenantName":"MS + Azure Cloud"},{"name":"Assaf Taubenfeld","role":"Admin","type":"User","fqn":"aaduser=53d8fc23-618e-49fa-ae3f-ae65cc60aa37;72f988bf-86f1-41af-91ab-2d7cd011db47","email":"astauben@microsoft.com","appId":"","tenantName":"Microsoft"}]}' + headers: + cache-control: + - no-cache + content-length: + - '465' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:42:42 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database-principal-assignment show + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/databases/Kustodatabase8/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1/Databases/Kustodatabase8/PrincipalAssignments/kustoprincipal1","name":"clitestcluster1/Kustodatabase8/kustoprincipal1","type":"Microsoft.Kusto/Clusters/Databases/PrincipalAssignments","etag":"\"\"","tags":{},"properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"Admin","principalType":"App","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","tenantName":"MS + Azure Cloud","principalName":"KustoResourceProvider","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '666' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:42:44 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database-principal-assignment delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --cluster-name --database-name --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/databases/Kustodatabase8/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/4c7c7ec0-cf10-4c22-852a-b0b9f7c37736?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '0' + date: + - Sun, 26 Apr 2020 14:42:46 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/4c7c7ec0-cf10-4c22-852a-b0b9f7c37736?api-version=2020-02-15&operationResultResponseType=Location + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database-principal-assignment delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/4c7c7ec0-cf10-4c22-852a-b0b9f7c37736?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/4c7c7ec0-cf10-4c22-852a-b0b9f7c37736","name":"4c7c7ec0-cf10-4c22-852a-b0b9f7c37736","status":"Succeeded","startTime":"2020-04-26T14:42:46.7078712Z","endTime":"2020-04-26T14:42:46.8484653Z","percentComplete":1.0,"properties":{"OperationKind":"DatabaseDropPrincipals","RootActivityId":"0ce88987-e4a2-4ccb-8c0f-36be5debd3bc","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '475' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:43:16 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"principalId": "d9a1f322-1293-4595-91e3-f54f8bb34725", + "role": "AllDatabasesViewer", "tenantId": "33e01921-4d64-4f8c-a055-5bdaffd5e33d", + "principalType": "App"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster-principal-assignment create + Connection: + - keep-alive + Content-Length: + - '177' + Content-Type: + - application/json + ParameterSetName: + - --cluster-name --principal-id --principal-type --role --tenant-id --principal-assignment-name + --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1/PrincipalAssignments/kustoprincipal1","name":"clitestcluster1/kustoprincipal1","type":"Microsoft.Kusto/Clusters/PrincipalAssignments","etag":"\"\"","properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"AllDatabasesViewer","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","principalType":"App","provisioningState":"Creating"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/75ccf262-4034-433a-be79-fbe18d12cd7e?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '548' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:43:19 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '199' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster-principal-assignment create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --principal-id --principal-type --role --tenant-id --principal-assignment-name + --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/75ccf262-4034-433a-be79-fbe18d12cd7e?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/75ccf262-4034-433a-be79-fbe18d12cd7e","name":"75ccf262-4034-433a-be79-fbe18d12cd7e","status":"Succeeded","startTime":"2020-04-26T14:43:19.9996134Z","endTime":"2020-04-26T14:43:22.4373187Z","percentComplete":1.0,"properties":{"OperationKind":"ServicePrincipalAssignmentsAdd","RootActivityId":"7b48090d-0bda-477a-ba77-88eb91089971","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '483' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:43:49 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster-principal-assignment create + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --principal-id --principal-type --role --tenant-id --principal-assignment-name + --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1/PrincipalAssignments/kustoprincipal1","name":"clitestcluster1/kustoprincipal1","type":"Microsoft.Kusto/Clusters/PrincipalAssignments","etag":"\"\"","tags":{},"properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"AllDatabasesViewer","principalType":"App","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","tenantName":"MS + Azure Cloud","principalName":"KustoResourceProvider","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '629' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:43:50 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster-principal-assignment wait + Connection: + - keep-alive + ParameterSetName: + - --created --principal-assignment-name --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1/PrincipalAssignments/kustoprincipal1","name":"clitestcluster1/kustoprincipal1","type":"Microsoft.Kusto/Clusters/PrincipalAssignments","etag":"\"\"","tags":{},"properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"AllDatabasesViewer","principalType":"App","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","tenantName":"MS + Azure Cloud","principalName":"KustoResourceProvider","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '629' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:43:52 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster-principal-assignment show + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --principal-assignment-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/principalAssignments/kustoprincipal1?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/Clusters/clitestcluster1/PrincipalAssignments/kustoprincipal1","name":"clitestcluster1/kustoprincipal1","type":"Microsoft.Kusto/Clusters/PrincipalAssignments","etag":"\"\"","tags":{},"properties":{"principalId":"d9a1f322-1293-4595-91e3-f54f8bb34725","role":"AllDatabasesViewer","principalType":"App","tenantId":"33e01921-4d64-4f8c-a055-5bdaffd5e33d","tenantName":"MS + Azure Cloud","principalName":"KustoResourceProvider","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '629' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:43:54 GMT + etag: + - '""' + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --cluster-name --database-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1/databases/KustoDatabase8?api-version=2020-02-15 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/58a2ad21-df5f-470a-8150-76f38a0b6327?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '0' + date: + - Sun, 26 Apr 2020 14:43:56 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/58a2ad21-df5f-470a-8150-76f38a0b6327?api-version=2020-02-15&operationResultResponseType=Location + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto database delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --database-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/58a2ad21-df5f-470a-8150-76f38a0b6327?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/58a2ad21-df5f-470a-8150-76f38a0b6327","name":"58a2ad21-df5f-470a-8150-76f38a0b6327","status":"Succeeded","startTime":"2020-04-26T14:43:56.875914Z","endTime":"2020-04-26T14:44:02.1435944Z","percentComplete":1.0,"properties":{"OperationKind":"DatabaseDelete","RootActivityId":"7f220583-471c-41a2-849c-4599127f954b","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '466' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:44:27 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '286' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.Kusto/clusters/clitestcluster1?api-version=2020-02-15 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + cache-control: + - no-cache + content-length: + - '0' + date: + - Sun, 26 Apr 2020 14:44:30 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15&operationResultResponseType=Location + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:44:59 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '299' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:45:30 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '298' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:46:02 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '297' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:46:32 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '296' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:47:02 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '295' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:47:34 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '294' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:48:03 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '293' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:48:34 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=5e5ff28fa92b1291bfb4f40aa52246624376877d08d84d2a201c9bf6f1ffae6d;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '292' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:49:05 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '291' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:49:36 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '290' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:50:05 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=d29ec50e2353fd96ac8ed72619c1a2fb36a21ed6c3f22a5075cd2c606bb89829;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:50:37 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '288' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:51:07 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '287' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:51:37 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=bf171968557f7483abc0913a42c0207b9017c552b91766911eca876583df224c;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '286' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:52:09 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '285' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:52:38 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '284' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:53:09 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=322636332396dc9c2c583f1f95d6956f84718edf355825979649eda7bf94886e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '283' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:53:40 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=3e9a49b330654e4ac57f196a7fb95bb367210c5ce4e9c674a332fb882012a73e;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '282' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:54:11 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=68eda2333691511c17b2574619a79876611dd86be1c55aa848d58cf2408b7c02;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '281' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:54:41 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=be0e0d186a8dd7beec8fdedbe9912fb4fc8ea63ab4795c4847feb9495ca10dd5;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '280' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:55:12 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=0b3e7bab7bc253429b01a84fcfe52f9eaf7487da416b1f2a0af2bf3349b35509;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '289' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:55:42 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=f977ea28325f4c100ed19c1a7ed6395c7554e0af5ce62499bbee5975165c7757;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '288' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Running","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:44:31.2169563Z","percentComplete":0.5,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Running"}}' + headers: + cache-control: + - no-cache + content-length: + - '462' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:56:12 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '287' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - kusto cluster delete + Connection: + - keep-alive + ParameterSetName: + - --cluster-name --resource-group + User-Agent: + - AZURECLI/2.4.0 azsdk-python-mgmt-kusto/0.1.0 Python/3.8.2 (Windows-10-10.0.18362-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West%20US/operationResults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2?api-version=2020-02-15 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Kusto/locations/West + US/operationresults/cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","name":"cbf5ecae-0d07-4240-87eb-0e1c6e7320a2","status":"Succeeded","startTime":"2020-04-26T14:44:30.4669341Z","endTime":"2020-04-26T14:56:24.5873744Z","percentComplete":1.0,"properties":{"OperationKind":"ClusterDelete","RootActivityId":"b2ef3fc0-8651-4131-8d91-90eca8d6a9b3","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '466' + content-type: + - application/json; charset=utf-8 + date: + - Sun, 26 Apr 2020 14:56:44 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - ARRAffinity=348d1e7264ad0063baa3036f92cd47d46e91963aabd2dc4d51adfdac15009271;Path=/;HttpOnly;Domain=rp-kustorpwus-website.azurewebsites.net + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '286' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/kusto/azext_kusto/tests/latest/test_kusto_scenario.py b/src/kusto/azext_kusto/tests/latest/test_kusto_scenario.py new file mode 100644 index 00000000000..4747812c0b2 --- /dev/null +++ b/src/kusto/azext_kusto/tests/latest/test_kusto_scenario.py @@ -0,0 +1,323 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import os +import unittest + +from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk import ScenarioTest +from .. import try_manual +from azure.cli.testsdk import ResourceGroupPreparer + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +@try_manual +def setup(test, rg): + pass + + +# EXAMPLE: kustoclusterscreateorupdate +@try_manual +def step_kustoclusterscreateorupdate(test, rg): + test.cmd('az kusto cluster create ' + '--cluster-name "{Clusters_3}" ' + '--identity-type "SystemAssigned" ' + '--location "westus" ' + '--enable-purge true ' + '--enable-streaming-ingest true ' + '--key-vault-properties key-name="" key-vault-uri="" key-version="" ' + '--sku name="Standard_L8s" capacity=2 tier="Standard" ' + '--resource-group "{rg}"', + checks=[]) + test.cmd('az kusto cluster wait --created ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclusterschecknameavailability +@try_manual +def step_kustoclusterschecknameavailability(test, rg): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: kustoclustersget +@try_manual +def step_kustoclustersget(test, rg): + test.cmd('az kusto cluster show ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclusterslist +@try_manual +def step_kustoclusterslist(test, rg): + test.cmd('az kusto cluster list', + checks=[]) + + +# EXAMPLE: kustoclusterslistbyresourcegroup +@try_manual +def step_kustoclusterslistbyresourcegroup(test, rg): + test.cmd('az kusto cluster list ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclustersstop +@try_manual +def step_kustoclustersstop(test, rg): + test.cmd('az kusto cluster stop ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclustersstart +@try_manual +def step_kustoclustersstart(test, rg): + test.cmd('az kusto cluster start ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclusterslistresourceskus +@try_manual +def step_kustoclusterslistresourceskus(test, rg): + test.cmd('az kusto cluster list-sku ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclusterslistskus +@try_manual +def step_kustoclusterslistskus(test, rg): + test.cmd('az kusto cluster list-sku', + checks=[]) + + +# EXAMPLE: kustodatabasescreateorupdate +@try_manual +def step_kustodatabasescreateorupdate(test, rg): + test.cmd('az kusto database create ' + '--cluster-name "{Clusters_3}" ' + '--database-name "KustoDatabase8" ' + '--read-write-database location="westus" soft-delete-period="P1D" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustodatabasechecknameavailability +@try_manual +def step_kustodatabasechecknameavailability(test, rg): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: kustodatabaseslistbycluster +@try_manual +def step_kustodatabaseslistbycluster(test, rg): + test.cmd('az kusto database list ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustodatabasesget +@try_manual +def step_kustodatabasesget(test, rg): + test.cmd('az kusto database show ' + '--cluster-name "{Clusters_3}" ' + '--database-name "KustoDatabase8" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustodatabasesupdate +@try_manual +def step_kustodatabasesupdate(test, rg): + test.cmd('az kusto database update ' + '--cluster-name "{Clusters_3}" ' + '--database-name "KustoDatabase8" ' + '--read-write-database soft-delete-period="P1D" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustodatabaseprincipalassignmentscreateorupdate +@try_manual +def step_kustodatabaseprincipalassignmentscreateorupdate(test, rg): + test.cmd('az kusto database-principal-assignment create ' + '--cluster-name "{Clusters_3}" ' + '--database-name "Kustodatabase8" ' + '--principal-id "d9a1f322-1293-4595-91e3-f54f8bb34725" ' + '--principal-type "App" ' + '--role "Admin" ' + '--tenant-id "33e01921-4d64-4f8c-a055-5bdaffd5e33d" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + test.cmd('az kusto database-principal-assignment wait --created ' + '--cluster-name "{Clusters_3}" ' + '--database-name "Kustodatabase8" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustodatabaselistprincipals +@try_manual +def step_kustodatabaselistprincipals(test, rg): + test.cmd('az kusto database list-principal ' + '--cluster-name "{Clusters_3}" ' + '--database-name "Kustodatabase8" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustodatabaseprincipalassignmentsget +@try_manual +def step_kustodatabaseprincipalassignmentsget(test, rg): + test.cmd('az kusto database-principal-assignment show ' + '--cluster-name "{Clusters_3}" ' + '--database-name "Kustodatabase8" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustodatabaseprincipalassignmentsdelete +@try_manual +def step_kustodatabaseprincipalassignmentsdelete(test, rg): + test.cmd('az kusto database-principal-assignment delete ' + '--cluster-name "{Clusters_3}" ' + '--database-name "Kustodatabase8" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclusterprincipalassignmentscreateorupdate +@try_manual +def step_kustoclusterprincipalassignmentscreateorupdate(test, rg): + test.cmd('az kusto cluster-principal-assignment create ' + '--cluster-name "{Clusters_3}" ' + '--principal-id "d9a1f322-1293-4595-91e3-f54f8bb34725" ' + '--principal-type "App" ' + '--role "AllDatabasesViewer" ' + '--tenant-id "33e01921-4d64-4f8c-a055-5bdaffd5e33d" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + test.cmd('az kusto cluster-principal-assignment wait --created ' + '--principal-assignment-name "kustoprincipal1" ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclusterprincipalassignmentsget +@try_manual +def step_kustoclusterprincipalassignmentsget(test, rg): + test.cmd('az kusto cluster-principal-assignment show ' + '--cluster-name "{Clusters_3}" ' + '--principal-assignment-name "kustoprincipal1" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustooperationslist +@try_manual +def step_kustooperationslist(test, rg): + # EXAMPLE NOT FOUND! + pass + + +# EXAMPLE: kustodatabasesdelete +@try_manual +def step_kustodatabasesdelete(test, rg): + test.cmd('az kusto database delete ' + '--cluster-name "{Clusters_3}" ' + '--database-name "KustoDatabase8" ' + '--resource-group "{rg}"', + checks=[]) + + +# EXAMPLE: kustoclustersdelete +@try_manual +def step_kustoclustersdelete(test, rg): + test.cmd('az kusto cluster delete ' + '--cluster-name "{Clusters_3}" ' + '--resource-group "{rg}"', + checks=[]) + + +@try_manual +def cleanup(test, rg): + pass + + +@try_manual +def call_scenario(test, rg): + setup(test, rg) + step_kustoclusterscreateorupdate(test, rg) + step_kustoclusterschecknameavailability(test, rg) + step_kustoclustersget(test, rg) + step_kustoclusterslist(test, rg) + step_kustoclusterslistbyresourcegroup(test, rg) + step_kustoclustersstop(test, rg) + step_kustoclustersstart(test, rg) + step_kustoclusterslistresourceskus(test, rg) + step_kustoclusterslistskus(test, rg) + step_kustodatabasescreateorupdate(test, rg) + step_kustodatabasechecknameavailability(test, rg) + step_kustodatabaseslistbycluster(test, rg) + step_kustodatabasesget(test, rg) + step_kustodatabasesupdate(test, rg) + step_kustodatabaseprincipalassignmentscreateorupdate(test, rg) + step_kustodatabaselistprincipals(test, rg) + step_kustodatabaseprincipalassignmentsget(test, rg) + step_kustodatabaseprincipalassignmentsdelete(test, rg) + step_kustoclusterprincipalassignmentscreateorupdate(test, rg) + step_kustoclusterprincipalassignmentsget(test, rg) + step_kustooperationslist(test, rg) + step_kustodatabasesdelete(test, rg) + step_kustoclustersdelete(test, rg) + cleanup(test, rg) + + +@try_manual +class KustoManagementClientScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='clitestkusto_kustorptest'[:7], key='rg', parameter_name='rg') + def test_kusto(self, rg): + + self.kwargs.update({ + 'subscription_id': self.get_subscription_id() + }) + + self.kwargs.update({ + 'Clusters_5': 'Clusters_5', + 'AttachedDatabaseConfigurations_3': 'AttachedDatabaseConfigurations_3', + 'leader4': 'leader4', + 'Clusters_2': 'testcli2', + 'Clusters_3': 'clitestcluster1', + 'Clusters_4': 'Clusters_4', + 'attachedDatabaseConfigurations_1': 'attachedDatabaseConfigurations2', + 'AttachedDatabaseConfigurations_2': 'AttachedDatabaseConfigurations_2', + }) + + call_scenario(self, rg) diff --git a/src/kusto/azext_kusto/vendored_sdks/__init__.py b/src/kusto/azext_kusto/vendored_sdks/__init__.py new file mode 100644 index 00000000000..ee0c4f36bd0 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/__init__.py b/src/kusto/azext_kusto/vendored_sdks/kusto/__init__.py new file mode 100644 index 00000000000..b4ef76736c1 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/__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 ._kusto_management_client import KustoManagementClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['KustoManagementClient'] + +try: + from .patch import patch_sdk + patch_sdk() +except ImportError: + pass diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/_configuration.py b/src/kusto/azext_kusto/vendored_sdks/kusto/_configuration.py new file mode 100644 index 00000000000..2e2c7a15d75 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/_configuration.py @@ -0,0 +1,69 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class KustoManagementClientConfiguration(Configuration): + """Configuration for KustoManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: 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 + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(KustoManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-02-15" + self.credential_scopes = ['https://management.azure.com/.default'] + kwargs.setdefault('sdk_moniker', 'mgmt-kusto/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/_kusto_management_client.py b/src/kusto/azext_kusto/vendored_sdks/kusto/_kusto_management_client.py new file mode 100644 index 00000000000..ec0cbd5ae63 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/_kusto_management_client.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + +from ._configuration import KustoManagementClientConfiguration +from .operations import ClusterOperations +from .operations import ClusterPrincipalAssignmentOperations +from .operations import DatabaseOperations +from .operations import DatabasePrincipalAssignmentOperations +from .operations import AttachedDatabaseConfigurationOperations +from .operations import DataConnectionOperations +from .operations import OperationOperations +from . import models + + +class KustoManagementClient(object): + """The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. + + :ivar cluster: ClusterOperations operations + :vartype cluster: azure.mgmt.kusto.operations.ClusterOperations + :ivar cluster_principal_assignment: ClusterPrincipalAssignmentOperations operations + :vartype cluster_principal_assignment: azure.mgmt.kusto.operations.ClusterPrincipalAssignmentOperations + :ivar database: DatabaseOperations operations + :vartype database: azure.mgmt.kusto.operations.DatabaseOperations + :ivar database_principal_assignment: DatabasePrincipalAssignmentOperations operations + :vartype database_principal_assignment: azure.mgmt.kusto.operations.DatabasePrincipalAssignmentOperations + :ivar attached_database_configuration: AttachedDatabaseConfigurationOperations operations + :vartype attached_database_configuration: azure.mgmt.kusto.operations.AttachedDatabaseConfigurationOperations + :ivar data_connection: DataConnectionOperations operations + :vartype data_connection: azure.mgmt.kusto.operations.DataConnectionOperations + :ivar operation: OperationOperations operations + :vartype operation: azure.mgmt.kusto.operations.OperationOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :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 str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = KustoManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.cluster = ClusterOperations( + self._client, self._config, self._serialize, self._deserialize) + self.cluster_principal_assignment = ClusterPrincipalAssignmentOperations( + self._client, self._config, self._serialize, self._deserialize) + self.database = DatabaseOperations( + self._client, self._config, self._serialize, self._deserialize) + self.database_principal_assignment = DatabasePrincipalAssignmentOperations( + self._client, self._config, self._serialize, self._deserialize) + self.attached_database_configuration = AttachedDatabaseConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.data_connection = DataConnectionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> KustoManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/_version.py b/src/kusto/azext_kusto/vendored_sdks/kusto/_version.py new file mode 100644 index 00000000000..eae7c95b6fb --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/__init__.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/__init__.py new file mode 100644 index 00000000000..1fb64aee341 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._kusto_management_client_async import KustoManagementClient +__all__ = ['KustoManagementClient'] diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_configuration_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_configuration_async.py new file mode 100644 index 00000000000..e8322c1d173 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_configuration_async.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 typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials import TokenCredential + + +class KustoManagementClientConfiguration(Configuration): + """Configuration for KustoManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: 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 + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(KustoManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-02-15" + self.credential_scopes = ['https://management.azure.com/.default'] + kwargs.setdefault('sdk_moniker', 'mgmt-kusto/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_kusto_management_client_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_kusto_management_client_async.py new file mode 100644 index 00000000000..15a0a57d813 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/_kusto_management_client_async.py @@ -0,0 +1,88 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +from ._configuration_async import KustoManagementClientConfiguration +from .operations_async import ClusterOperations +from .operations_async import ClusterPrincipalAssignmentOperations +from .operations_async import DatabaseOperations +from .operations_async import DatabasePrincipalAssignmentOperations +from .operations_async import AttachedDatabaseConfigurationOperations +from .operations_async import DataConnectionOperations +from .operations_async import OperationOperations +from .. import models + + +class KustoManagementClient(object): + """The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. + + :ivar cluster: ClusterOperations operations + :vartype cluster: azure.mgmt.kusto.aio.operations_async.ClusterOperations + :ivar cluster_principal_assignment: ClusterPrincipalAssignmentOperations operations + :vartype cluster_principal_assignment: azure.mgmt.kusto.aio.operations_async.ClusterPrincipalAssignmentOperations + :ivar database: DatabaseOperations operations + :vartype database: azure.mgmt.kusto.aio.operations_async.DatabaseOperations + :ivar database_principal_assignment: DatabasePrincipalAssignmentOperations operations + :vartype database_principal_assignment: azure.mgmt.kusto.aio.operations_async.DatabasePrincipalAssignmentOperations + :ivar attached_database_configuration: AttachedDatabaseConfigurationOperations operations + :vartype attached_database_configuration: azure.mgmt.kusto.aio.operations_async.AttachedDatabaseConfigurationOperations + :ivar data_connection: DataConnectionOperations operations + :vartype data_connection: azure.mgmt.kusto.aio.operations_async.DataConnectionOperations + :ivar operation: OperationOperations operations + :vartype operation: azure.mgmt.kusto.aio.operations_async.OperationOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :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 str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = KustoManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.cluster = ClusterOperations( + self._client, self._config, self._serialize, self._deserialize) + self.cluster_principal_assignment = ClusterPrincipalAssignmentOperations( + self._client, self._config, self._serialize, self._deserialize) + self.database = DatabaseOperations( + self._client, self._config, self._serialize, self._deserialize) + self.database_principal_assignment = DatabasePrincipalAssignmentOperations( + self._client, self._config, self._serialize, self._deserialize) + self.attached_database_configuration = AttachedDatabaseConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.data_connection = DataConnectionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "KustoManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/__init__.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/__init__.py new file mode 100644 index 00000000000..e173d033126 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/__init__.py @@ -0,0 +1,25 @@ +# 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 ._cluster_operations_async import ClusterOperations +from ._cluster_principal_assignment_operations_async import ClusterPrincipalAssignmentOperations +from ._database_operations_async import DatabaseOperations +from ._database_principal_assignment_operations_async import DatabasePrincipalAssignmentOperations +from ._attached_database_configuration_operations_async import AttachedDatabaseConfigurationOperations +from ._data_connection_operations_async import DataConnectionOperations +from ._operation_operations_async import OperationOperations + +__all__ = [ + 'ClusterOperations', + 'ClusterPrincipalAssignmentOperations', + 'DatabaseOperations', + 'DatabasePrincipalAssignmentOperations', + 'AttachedDatabaseConfigurationOperations', + 'DataConnectionOperations', + 'OperationOperations', +] diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_attached_database_configuration_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_attached_database_configuration_operations_async.py new file mode 100644 index 00000000000..cb1fd41a1b2 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_attached_database_configuration_operations_async.py @@ -0,0 +1,398 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AttachedDatabaseConfigurationOperations: + """AttachedDatabaseConfigurationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_cluster( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> "models.AttachedDatabaseConfigurationListResult": + """Returns the list of attached database configurations of the given Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AttachedDatabaseConfigurationListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.AttachedDatabaseConfigurationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfigurationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_cluster.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AttachedDatabaseConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations'} + + async def get( + self, + resource_group_name: str, + cluster_name: str, + attached_database_configuration_name: str, + **kwargs + ) -> "models.AttachedDatabaseConfiguration": + """Returns an attached database configuration. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param attached_database_configuration_name: The name of the attached database configuration. + :type attached_database_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AttachedDatabaseConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.AttachedDatabaseConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'attachedDatabaseConfigurationName': self._serialize.url("attached_database_configuration_name", attached_database_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + + async def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + attached_database_configuration_name: str, + location: Optional[str] = None, + database_name: Optional[str] = None, + cluster_resource_id: Optional[str] = None, + default_principals_modification_kind: Optional[Union[str, "models.DefaultPrincipalsModificationKind"]] = None, + **kwargs + ) -> "models.AttachedDatabaseConfiguration": + cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.AttachedDatabaseConfiguration(location=location, database_name=database_name, cluster_resource_id=cluster_resource_id, default_principals_modification_kind=default_principals_modification_kind) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'attachedDatabaseConfigurationName': self._serialize.url("attached_database_configuration_name", attached_database_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'AttachedDatabaseConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + + async def create_or_update( + self, + resource_group_name: str, + cluster_name: str, + attached_database_configuration_name: str, + location: Optional[str] = None, + database_name: Optional[str] = None, + cluster_resource_id: Optional[str] = None, + default_principals_modification_kind: Optional[Union[str, "models.DefaultPrincipalsModificationKind"]] = None, + **kwargs + ) -> "models.AttachedDatabaseConfiguration": + """Creates or updates an attached database configuration. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param attached_database_configuration_name: The name of the attached database configuration. + :type attached_database_configuration_name: str + :param location: Resource location. + :type location: str + :param database_name: The name of the database which you would like to attach, use * if you + want to follow all current and future databases. + :type database_name: str + :param cluster_resource_id: The resource id of the cluster where the databases you would like + to attach reside. + :type cluster_resource_id: str + :param default_principals_modification_kind: The default principals modification kind. + :type default_principals_modification_kind: str or ~azure.mgmt.kusto.models.DefaultPrincipalsModificationKind + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns AttachedDatabaseConfiguration + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfiguration"] + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + location=location, + database_name=database_name, + cluster_resource_id=cluster_resource_id, + default_principals_modification_kind=default_principals_modification_kind, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + + async def _delete_initial( + self, + resource_group_name: str, + cluster_name: str, + attached_database_configuration_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._delete_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'attachedDatabaseConfigurationName': self._serialize.url("attached_database_configuration_name", attached_database_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + + async def delete( + self, + resource_group_name: str, + cluster_name: str, + attached_database_configuration_name: str, + **kwargs + ) -> None: + """Deletes the attached database configuration with the given name. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param attached_database_configuration_name: The name of the attached database configuration. + :type attached_database_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_operations_async.py new file mode 100644 index 00000000000..4df01ed2005 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_operations_async.py @@ -0,0 +1,1561 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ClusterOperations: + """ClusterOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> "models.Cluster": + """Gets a Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Cluster or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.Cluster + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + async def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + location: str, + sku: "models.AzureSku", + tags: Optional[Dict[str, str]] = None, + zones: Optional[List[str]] = None, + trusted_external_tenants: Optional[List["TrustedExternalTenant"]] = None, + optimized_autoscale: Optional["models.OptimizedAutoscale"] = None, + enable_disk_encryption: Optional[bool] = None, + enable_streaming_ingest: Optional[bool] = False, + virtual_network_configuration: Optional["models.VirtualNetworkConfiguration"] = None, + key_vault_properties: Optional["models.KeyVaultProperties"] = None, + enable_purge: Optional[bool] = False, + value: Optional[List["LanguageExtension"]] = None, + type: Optional[Union[str, "models.IdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + **kwargs + ) -> "models.Cluster": + cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.Cluster(tags=tags, location=location, sku=sku, zones=zones, trusted_external_tenants=trusted_external_tenants, optimized_autoscale=optimized_autoscale, enable_disk_encryption=enable_disk_encryption, enable_streaming_ingest=enable_streaming_ingest, virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, value=value, type_identity_type=type, user_assigned_identities=user_assigned_identities) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'Cluster') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Cluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + async def create_or_update( + self, + resource_group_name: str, + cluster_name: str, + location: str, + sku: "models.AzureSku", + tags: Optional[Dict[str, str]] = None, + zones: Optional[List[str]] = None, + trusted_external_tenants: Optional[List["TrustedExternalTenant"]] = None, + optimized_autoscale: Optional["models.OptimizedAutoscale"] = None, + enable_disk_encryption: Optional[bool] = None, + enable_streaming_ingest: Optional[bool] = False, + virtual_network_configuration: Optional["models.VirtualNetworkConfiguration"] = None, + key_vault_properties: Optional["models.KeyVaultProperties"] = None, + enable_purge: Optional[bool] = False, + value: Optional[List["LanguageExtension"]] = None, + type: Optional[Union[str, "models.IdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + **kwargs + ) -> "models.Cluster": + """Create or update a Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param location: The geo-location where the resource lives. + :type location: str + :param sku: The SKU of the cluster. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :param tags: Resource tags. + :type tags: dict[str, str] + :param zones: The availability zones of the cluster. + :type zones: list[str] + :param trusted_external_tenants: The cluster's external tenants. + :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :param optimized_autoscale: Optimized auto scale definition. + :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are + encrypted. + :type enable_disk_encryption: bool + :param enable_streaming_ingest: A boolean value that indicates if the streaming ingest is + enabled. + :type enable_streaming_ingest: bool + :param virtual_network_configuration: Virtual network definition. + :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :param key_vault_properties: KeyVault properties for the cluster encryption. + :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :param enable_purge: A boolean value that indicates if the purge operations are enabled. + :type enable_purge: bool + :param value: The list of language extensions. + :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :param type: The identity type. + :type type: str or ~azure.mgmt.kusto.models.IdentityType + :param user_assigned_identities: The list of user identities associated with the Kusto cluster. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, ~azure.mgmt.kusto.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns Cluster + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Cluster] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + location=location, + sku=sku, + tags=tags, + zones=zones, + trusted_external_tenants=trusted_external_tenants, + optimized_autoscale=optimized_autoscale, + enable_disk_encryption=enable_disk_encryption, + enable_streaming_ingest=enable_streaming_ingest, + virtual_network_configuration=virtual_network_configuration, + key_vault_properties=key_vault_properties, + enable_purge=enable_purge, + value=value, + type=type, + user_assigned_identities=user_assigned_identities, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + async def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + tags: Optional[Dict[str, str]] = None, + location: Optional[str] = None, + sku: Optional["models.AzureSku"] = None, + trusted_external_tenants: Optional[List["TrustedExternalTenant"]] = None, + optimized_autoscale: Optional["models.OptimizedAutoscale"] = None, + enable_disk_encryption: Optional[bool] = None, + enable_streaming_ingest: Optional[bool] = False, + virtual_network_configuration: Optional["models.VirtualNetworkConfiguration"] = None, + key_vault_properties: Optional["models.KeyVaultProperties"] = None, + enable_purge: Optional[bool] = False, + value: Optional[List["LanguageExtension"]] = None, + type: Optional[Union[str, "models.IdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + **kwargs + ) -> "models.Cluster": + cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ClusterUpdate(tags=tags, location=location, sku=sku, trusted_external_tenants=trusted_external_tenants, optimized_autoscale=optimized_autoscale, enable_disk_encryption=enable_disk_encryption, enable_streaming_ingest=enable_streaming_ingest, virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, value=value, type_identity_type=type, user_assigned_identities=user_assigned_identities) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ClusterUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Cluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Cluster', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + async def update( + self, + resource_group_name: str, + cluster_name: str, + tags: Optional[Dict[str, str]] = None, + location: Optional[str] = None, + sku: Optional["models.AzureSku"] = None, + trusted_external_tenants: Optional[List["TrustedExternalTenant"]] = None, + optimized_autoscale: Optional["models.OptimizedAutoscale"] = None, + enable_disk_encryption: Optional[bool] = None, + enable_streaming_ingest: Optional[bool] = False, + virtual_network_configuration: Optional["models.VirtualNetworkConfiguration"] = None, + key_vault_properties: Optional["models.KeyVaultProperties"] = None, + enable_purge: Optional[bool] = False, + value: Optional[List["LanguageExtension"]] = None, + type: Optional[Union[str, "models.IdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + **kwargs + ) -> "models.Cluster": + """Update a Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Resource location. + :type location: str + :param sku: The SKU of the cluster. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :param trusted_external_tenants: The cluster's external tenants. + :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :param optimized_autoscale: Optimized auto scale definition. + :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are + encrypted. + :type enable_disk_encryption: bool + :param enable_streaming_ingest: A boolean value that indicates if the streaming ingest is + enabled. + :type enable_streaming_ingest: bool + :param virtual_network_configuration: Virtual network definition. + :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :param key_vault_properties: KeyVault properties for the cluster encryption. + :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :param enable_purge: A boolean value that indicates if the purge operations are enabled. + :type enable_purge: bool + :param value: The list of language extensions. + :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :param type: The identity type. + :type type: str or ~azure.mgmt.kusto.models.IdentityType + :param user_assigned_identities: The list of user identities associated with the Kusto cluster. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, ~azure.mgmt.kusto.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns Cluster + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Cluster] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + tags=tags, + location=location, + sku=sku, + trusted_external_tenants=trusted_external_tenants, + optimized_autoscale=optimized_autoscale, + enable_disk_encryption=enable_disk_encryption, + enable_streaming_ingest=enable_streaming_ingest, + virtual_network_configuration=virtual_network_configuration, + key_vault_properties=key_vault_properties, + enable_purge=enable_purge, + value=value, + type=type, + user_assigned_identities=user_assigned_identities, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + async def _delete_initial( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._delete_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + async def delete( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> None: + """Deletes a Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + async def _stop_initial( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._stop_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} + + async def stop( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> None: + """Stops a Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = await self._stop_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} + + async def _start_initial( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._start_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} + + async def start( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> None: + """Starts a Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = await self._start_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} + + def list_follower_database( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> "models.FollowerDatabaseListResult": + """Returns a list of databases that are owned by this cluster and were followed by another cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FollowerDatabaseListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.FollowerDatabaseListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FollowerDatabaseListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_follower_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('FollowerDatabaseListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_follower_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases'} + + async def _detach_follower_database_initial( + self, + resource_group_name: str, + cluster_name: str, + cluster_resource_id: str, + attached_database_configuration_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _follower_database_to_remove = models.FollowerDatabaseDefinition(cluster_resource_id=cluster_resource_id, attached_database_configuration_name=attached_database_configuration_name) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._detach_follower_database_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_follower_database_to_remove, 'FollowerDatabaseDefinition') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _detach_follower_database_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} + + async def detach_follower_database( + self, + resource_group_name: str, + cluster_name: str, + cluster_resource_id: str, + attached_database_configuration_name: str, + **kwargs + ) -> None: + """Detaches all followers of a database owned by this cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param cluster_resource_id: Resource id of the cluster that follows a database owned by this + cluster. + :type cluster_resource_id: str + :param attached_database_configuration_name: Resource name of the attached database + configuration in the follower cluster. + :type attached_database_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = await self._detach_follower_database_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_resource_id=cluster_resource_id, + attached_database_configuration_name=attached_database_configuration_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + detach_follower_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} + + async def _diagnose_virtual_network_initial( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> "models.DiagnoseVirtualNetworkResult": + cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnoseVirtualNetworkResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._diagnose_virtual_network_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DiagnoseVirtualNetworkResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _diagnose_virtual_network_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} + + async def diagnose_virtual_network( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> "models.DiagnoseVirtualNetworkResult": + """Diagnoses network connectivity status for external resources on which the service is dependent on. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns DiagnoseVirtualNetworkResult + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DiagnoseVirtualNetworkResult] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnoseVirtualNetworkResult"] + raw_result = await self._diagnose_virtual_network_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DiagnoseVirtualNetworkResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + diagnose_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> "models.ClusterListResult": + """Lists all Kusto clusters within a resource group. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ClusterListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.ClusterListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ClusterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters'} + + def list( + self, + **kwargs + ) -> "models.ClusterListResult": + """Lists all Kusto clusters within a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ClusterListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.ClusterListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ClusterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters'} + + def list_sku( + self, + **kwargs + ) -> "models.SkuDescriptionList": + """Lists eligible SKUs for Kusto resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuDescriptionList or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.SkuDescriptionList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SkuDescriptionList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_sku.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) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('SkuDescriptionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_sku.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus'} + + async def check_name_availability( + self, + location: str, + name: str, + type: Union[str, "models.Type"], + **kwargs + ) -> "models.CheckNameResult": + """Checks that the cluster name is valid and is not already in use. + + :param location: Azure location. + :type location: str + :param name: Cluster name. + :type name: str + :param type: The type of resource, Microsoft.Kusto/clusters. + :type type: str or ~azure.mgmt.kusto.models.Type + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _cluster_name = models.ClusterCheckNameRequest(name=name, type=type) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_cluster_name, 'ClusterCheckNameRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability'} + + def list_sku_by_resource( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> "models.ListResourceSkusResult": + """Returns the SKUs available for the provided resource. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListResourceSkusResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.ListResourceSkusResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListResourceSkusResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_sku_by_resource.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ListResourceSkusResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_sku_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus'} + + def list_language_extension( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> "models.LanguageExtensionsList": + """Returns a list of language extensions that can run within KQL queries. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LanguageExtensionsList or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.LanguageExtensionsList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LanguageExtensionsList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_language_extension.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('LanguageExtensionsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listLanguageExtensions'} + + async def _add_language_extension_initial( + self, + resource_group_name: str, + cluster_name: str, + value: Optional[List["LanguageExtension"]] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _language_extensions_to_add = models.LanguageExtensionsList(value=value) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._add_language_extension_initial.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_language_extensions_to_add, 'LanguageExtensionsList') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _add_language_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} + + async def add_language_extension( + self, + resource_group_name: str, + cluster_name: str, + value: Optional[List["LanguageExtension"]] = None, + **kwargs + ) -> None: + """Add a list of language extensions that can run within KQL queries. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param value: The list of language extensions. + :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = await self._add_language_extension_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + value=value, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + add_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} + + async def _remove_language_extension_initial( + self, + resource_group_name: str, + cluster_name: str, + value: Optional[List["LanguageExtension"]] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _language_extensions_to_remove = models.LanguageExtensionsList(value=value) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._remove_language_extension_initial.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_language_extensions_to_remove, 'LanguageExtensionsList') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _remove_language_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} + + async def remove_language_extension( + self, + resource_group_name: str, + cluster_name: str, + value: Optional[List["LanguageExtension"]] = None, + **kwargs + ) -> None: + """Remove a list of language extensions that can run within KQL queries. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param value: The list of language extensions. + :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = await self._remove_language_extension_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + value=value, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + remove_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_principal_assignment_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_principal_assignment_operations_async.py new file mode 100644 index 00000000000..7a71deffb4f --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_principal_assignment_operations_async.py @@ -0,0 +1,463 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ClusterPrincipalAssignmentOperations: + """ClusterPrincipalAssignmentOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def check_name_availability( + self, + resource_group_name: str, + cluster_name: str, + name: str, + type: Union[str, "models.Type"], + **kwargs + ) -> "models.CheckNameResult": + """Checks that the principal assignment name is valid and is not already in use. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param name: Principal Assignment resource name. + :type name: str + :param type: The type of resource, Microsoft.Kusto/clusters/principalAssignments. + :type type: str or ~azure.mgmt.kusto.models.Type + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _principal_assignment_name = models.ClusterPrincipalAssignmentCheckNameRequest(name=name, type=type) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_principal_assignment_name, 'ClusterPrincipalAssignmentCheckNameRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability'} + + async def get( + self, + resource_group_name: str, + cluster_name: str, + principal_assignment_name: str, + **kwargs + ) -> "models.ClusterPrincipalAssignment": + """Gets a Kusto cluster principalAssignment. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param principal_assignment_name: The name of the Kusto principalAssignment. + :type principal_assignment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ClusterPrincipalAssignment or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.ClusterPrincipalAssignment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignment"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # 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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + + async def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + principal_assignment_name: str, + principal_id: Optional[str] = None, + role: Optional[Union[str, "models.ClusterPrincipalRole"]] = None, + tenant_id: Optional[str] = None, + principal_type: Optional[Union[str, "models.PrincipalType"]] = None, + **kwargs + ) -> "models.ClusterPrincipalAssignment": + cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignment"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ClusterPrincipalAssignment(principal_id=principal_id, role=role, tenant_id=tenant_id, principal_type=principal_type) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ClusterPrincipalAssignment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + + async def create_or_update( + self, + resource_group_name: str, + cluster_name: str, + principal_assignment_name: str, + principal_id: Optional[str] = None, + role: Optional[Union[str, "models.ClusterPrincipalRole"]] = None, + tenant_id: Optional[str] = None, + principal_type: Optional[Union[str, "models.PrincipalType"]] = None, + **kwargs + ) -> "models.ClusterPrincipalAssignment": + """Create a Kusto cluster principalAssignment. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param principal_assignment_name: The name of the Kusto principalAssignment. + :type principal_assignment_name: str + :param principal_id: The principal ID assigned to the cluster principal. It can be a user + email, application ID, or security group name. + :type principal_id: str + :param role: Cluster principal role. + :type role: str or ~azure.mgmt.kusto.models.ClusterPrincipalRole + :param tenant_id: The tenant id of the principal. + :type tenant_id: str + :param principal_type: Principal type. + :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns ClusterPrincipalAssignment + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.ClusterPrincipalAssignment] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignment"] + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + + async def _delete_initial( + self, + resource_group_name: str, + cluster_name: str, + principal_assignment_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._delete_initial.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + + async def delete( + self, + resource_group_name: str, + cluster_name: str, + principal_assignment_name: str, + **kwargs + ) -> None: + """Deletes a Kusto cluster principalAssignment. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param principal_assignment_name: The name of the Kusto principalAssignment. + :type principal_assignment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + + def list( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> "models.ClusterPrincipalAssignmentListResult": + """Lists all Kusto cluster principalAssignments. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ClusterPrincipalAssignmentListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.ClusterPrincipalAssignmentListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignmentListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ClusterPrincipalAssignmentListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments'} diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_data_connection_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_data_connection_operations_async.py new file mode 100644 index 00000000000..6b9ddbd68f6 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_data_connection_operations_async.py @@ -0,0 +1,667 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DataConnectionOperations: + """DataConnectionOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_database( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + **kwargs + ) -> "models.DataConnectionListResult": + """Returns the list of data connections of the given Kusto database. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataConnectionListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DataConnectionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnectionListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DataConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections'} + + async def data_connection_validation( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + data_connection_name: Optional[str] = None, + properties: Optional["models.DataConnection"] = None, + **kwargs + ) -> "models.DataConnectionValidationListResult": + """Checks that the data connection parameters are valid. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param properties: The data connection properties to validate. + :type properties: ~azure.mgmt.kusto.models.DataConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataConnectionValidationListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DataConnectionValidationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnectionValidationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.DataConnectionValidation(data_connection_name=data_connection_name, properties=properties) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.data_connection_validation.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'DataConnectionValidation') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataConnectionValidationListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + data_connection_validation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} + + async def check_name_availability( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + name: str, + type: Union[str, "models.Type"], + **kwargs + ) -> "models.CheckNameResult": + """Checks that the data connection name is valid and is not already in use. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param name: Data Connection name. + :type name: str + :param type: The type of resource, Microsoft.Kusto/clusters/databases/dataConnections. + :type type: str or ~azure.mgmt.kusto.models.Type + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _data_connection_name = models.DataConnectionCheckNameRequest(name=name, type=type) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_data_connection_name, 'DataConnectionCheckNameRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability'} + + async def get( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + data_connection_name: str, + **kwargs + ) -> "models.DataConnection": + """Returns a data connection. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataConnection or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DataConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'dataConnectionName': self._serialize.url("data_connection_name", data_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + + async def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + data_connection_name: str, + parameters: "models.DataConnection", + **kwargs + ) -> "models.DataConnection": + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'dataConnectionName': self._serialize.url("data_connection_name", data_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DataConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataConnection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('DataConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + + async def create_or_update( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + data_connection_name: str, + parameters: "models.DataConnection", + **kwargs + ) -> "models.DataConnection": + """Creates or updates a data connection. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param parameters: The data connection parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.kusto.models.DataConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns DataConnection + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DataConnection] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DataConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + + async def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + data_connection_name: str, + parameters: "models.DataConnection", + **kwargs + ) -> "models.DataConnection": + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'dataConnectionName': self._serialize.url("data_connection_name", data_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataConnection') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DataConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataConnection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('DataConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + + async def update( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + data_connection_name: str, + parameters: "models.DataConnection", + **kwargs + ) -> "models.DataConnection": + """Updates a data connection. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param parameters: The data connection parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.kusto.models.DataConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns DataConnection + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DataConnection] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DataConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + + async def _delete_initial( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + data_connection_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._delete_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'dataConnectionName': self._serialize.url("data_connection_name", data_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + + async def delete( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + data_connection_name: str, + **kwargs + ) -> None: + """Deletes the data connection with the given name. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_operations_async.py new file mode 100644 index 00000000000..95d28aefc80 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_operations_async.py @@ -0,0 +1,778 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DatabaseOperations: + """DatabaseOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def check_name_availability( + self, + resource_group_name: str, + cluster_name: str, + name: str, + type: Union[str, "models.Type"], + **kwargs + ) -> "models.CheckNameResult": + """Checks that the database name is valid and is not already in use. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param name: Resource name. + :type name: str + :param type: The type of resource, for instance Microsoft.Kusto/clusters/databases. + :type type: str or ~azure.mgmt.kusto.models.Type + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _resource_name = models.CheckNameRequest(name=name, type=type) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_resource_name, 'CheckNameRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability'} + + def list_by_cluster( + self, + resource_group_name: str, + cluster_name: str, + **kwargs + ) -> "models.DatabaseListResult": + """Returns the list of databases of the given Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabaseListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DatabaseListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabaseListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_cluster.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DatabaseListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases'} + + async def get( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + **kwargs + ) -> "models.Database": + """Returns a database. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Database or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.Database + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Database', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + async def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + parameters: "models.Database", + **kwargs + ) -> "models.Database": + cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Database') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Database', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Database', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Database', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + async def create_or_update( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + parameters: "models.Database", + **kwargs + ) -> "models.Database": + """Creates or updates a database. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param parameters: The database parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.kusto.models.Database + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns Database + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Database] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Database', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + async def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + parameters: "models.Database", + **kwargs + ) -> "models.Database": + cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Database') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Database', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Database', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Database', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + async def update( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + parameters: "models.Database", + **kwargs + ) -> "models.Database": + """Updates a database. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param parameters: The database parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.kusto.models.Database + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns Database + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Database] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Database', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + async def _delete_initial( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._delete_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + async def delete( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + **kwargs + ) -> None: + """Deletes the database with the given name. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + def list_principal( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + **kwargs + ) -> "models.DatabasePrincipalListResult": + """Returns a list of database principals of the given Kusto cluster and database. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabasePrincipalListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_principal.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DatabasePrincipalListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals'} + + async def add_principal( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + value: Optional[List["DatabasePrincipal"]] = None, + **kwargs + ) -> "models.DatabasePrincipalListResult": + """Add Database principals permissions. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param value: The list of Kusto database principals. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabasePrincipalListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _database_principals_to_add = models.DatabasePrincipalListRequest(value=value) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.add_principal.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_database_principals_to_add, 'DatabasePrincipalListRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DatabasePrincipalListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + add_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals'} + + async def remove_principal( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + value: Optional[List["DatabasePrincipal"]] = None, + **kwargs + ) -> "models.DatabasePrincipalListResult": + """Remove Database principals permissions. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param value: The list of Kusto database principals. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabasePrincipalListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _database_principals_to_remove = models.DatabasePrincipalListRequest(value=value) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.remove_principal.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_database_principals_to_remove, 'DatabasePrincipalListRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DatabasePrincipalListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + remove_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals'} diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_principal_assignment_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_principal_assignment_operations_async.py new file mode 100644 index 00000000000..bf6348e6a3d --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_principal_assignment_operations_async.py @@ -0,0 +1,487 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DatabasePrincipalAssignmentOperations: + """DatabasePrincipalAssignmentOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def check_name_availability( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + name: str, + type: Union[str, "models.Type"], + **kwargs + ) -> "models.CheckNameResult": + """Checks that the database principal assignment is valid and is not already in use. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param name: Principal Assignment resource name. + :type name: str + :param type: The type of resource, Microsoft.Kusto/clusters/databases/principalAssignments. + :type type: str or ~azure.mgmt.kusto.models.Type + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _principal_assignment_name = models.DatabasePrincipalAssignmentCheckNameRequest(name=name, type=type) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_principal_assignment_name, 'DatabasePrincipalAssignmentCheckNameRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability'} + + async def get( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + principal_assignment_name: str, + **kwargs + ) -> "models.DatabasePrincipalAssignment": + """Gets a Kusto cluster database principalAssignment. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param principal_assignment_name: The name of the Kusto principalAssignment. + :type principal_assignment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabasePrincipalAssignment or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalAssignment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignment"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # 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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + + async def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + principal_assignment_name: str, + principal_id: Optional[str] = None, + role: Optional[Union[str, "models.DatabasePrincipalRole"]] = None, + tenant_id: Optional[str] = None, + principal_type: Optional[Union[str, "models.PrincipalType"]] = None, + **kwargs + ) -> "models.DatabasePrincipalAssignment": + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignment"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.DatabasePrincipalAssignment(principal_id=principal_id, role=role, tenant_id=tenant_id, principal_type=principal_type) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'DatabasePrincipalAssignment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + + async def create_or_update( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + principal_assignment_name: str, + principal_id: Optional[str] = None, + role: Optional[Union[str, "models.DatabasePrincipalRole"]] = None, + tenant_id: Optional[str] = None, + principal_type: Optional[Union[str, "models.PrincipalType"]] = None, + **kwargs + ) -> "models.DatabasePrincipalAssignment": + """Creates a Kusto cluster database principalAssignment. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param principal_assignment_name: The name of the Kusto principalAssignment. + :type principal_assignment_name: str + :param principal_id: The principal ID assigned to the database principal. It can be a user + email, application ID, or security group name. + :type principal_id: str + :param role: Database principal role. + :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :param tenant_id: The tenant id of the principal. + :type tenant_id: str + :param principal_type: Principal type. + :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns DatabasePrincipalAssignment + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DatabasePrincipalAssignment] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignment"] + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + + async def _delete_initial( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + principal_assignment_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._delete_initial.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + + async def delete( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + principal_assignment_name: str, + **kwargs + ) -> None: + """Deletes a Kusto principalAssignment. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param principal_assignment_name: The name of the Kusto principalAssignment. + :type principal_assignment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + + def list( + self, + resource_group_name: str, + cluster_name: str, + database_name: str, + **kwargs + ) -> "models.DatabasePrincipalAssignmentListResult": + """Lists all Kusto cluster database principalAssignments. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabasePrincipalAssignmentListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalAssignmentListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignmentListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DatabasePrincipalAssignmentListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments'} diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_operation_operations_async.py b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_operation_operations_async.py new file mode 100644 index 00000000000..bc31ebca19b --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/aio/operations_async/_operation_operations_async.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations: + """OperationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> "models.OperationListResult": + """Lists available operations for the Microsoft.Kusto provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.OperationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Kusto/operations'} diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/models/__init__.py b/src/kusto/azext_kusto/vendored_sdks/kusto/models/__init__.py new file mode 100644 index 00000000000..f8bfbe3e4df --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/models/__init__.py @@ -0,0 +1,221 @@ +# 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 AttachedDatabaseConfiguration + from ._models_py3 import AttachedDatabaseConfigurationListResult + from ._models_py3 import AzureCapacity + from ._models_py3 import AzureResourceSku + from ._models_py3 import AzureSku + from ._models_py3 import CheckNameRequest + from ._models_py3 import CheckNameResult + from ._models_py3 import CloudErrorBody + from ._models_py3 import Cluster + from ._models_py3 import ClusterCheckNameRequest + from ._models_py3 import ClusterListResult + from ._models_py3 import ClusterPrincipalAssignment + from ._models_py3 import ClusterPrincipalAssignmentCheckNameRequest + from ._models_py3 import ClusterPrincipalAssignmentListResult + from ._models_py3 import ClusterUpdate + from ._models_py3 import ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties + from ._models_py3 import DataConnection + from ._models_py3 import DataConnectionCheckNameRequest + from ._models_py3 import DataConnectionListResult + from ._models_py3 import DataConnectionValidation + from ._models_py3 import DataConnectionValidationListResult + from ._models_py3 import DataConnectionValidationResult + from ._models_py3 import Database + from ._models_py3 import DatabaseListResult + from ._models_py3 import DatabasePrincipal + from ._models_py3 import DatabasePrincipalAssignment + from ._models_py3 import DatabasePrincipalAssignmentCheckNameRequest + from ._models_py3 import DatabasePrincipalAssignmentListResult + from ._models_py3 import DatabasePrincipalListRequest + from ._models_py3 import DatabasePrincipalListResult + from ._models_py3 import DatabaseStatistics + from ._models_py3 import DiagnoseVirtualNetworkResult + from ._models_py3 import EventGridDataConnection + from ._models_py3 import EventHubDataConnection + from ._models_py3 import FollowerDatabaseDefinition + from ._models_py3 import FollowerDatabaseListResult + from ._models_py3 import IotHubDataConnection + from ._models_py3 import KeyVaultProperties + from ._models_py3 import LanguageExtension + from ._models_py3 import LanguageExtensionsList + from ._models_py3 import ListResourceSkusResult + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult + from ._models_py3 import OptimizedAutoscale + from ._models_py3 import ProxyResource + from ._models_py3 import ReadOnlyFollowingDatabase + from ._models_py3 import ReadWriteDatabase + from ._models_py3 import Resource + from ._models_py3 import SkuDescription + from ._models_py3 import SkuDescriptionList + from ._models_py3 import SkuLocationInfoItem + from ._models_py3 import TrackedResource + from ._models_py3 import TrustedExternalTenant + from ._models_py3 import VirtualNetworkConfiguration +except (SyntaxError, ImportError): + from ._models import AttachedDatabaseConfiguration # type: ignore + from ._models import AttachedDatabaseConfigurationListResult # type: ignore + from ._models import AzureCapacity # type: ignore + from ._models import AzureResourceSku # type: ignore + from ._models import AzureSku # type: ignore + from ._models import CheckNameRequest # type: ignore + from ._models import CheckNameResult # type: ignore + from ._models import CloudErrorBody # type: ignore + from ._models import Cluster # type: ignore + from ._models import ClusterCheckNameRequest # type: ignore + from ._models import ClusterListResult # type: ignore + from ._models import ClusterPrincipalAssignment # type: ignore + from ._models import ClusterPrincipalAssignmentCheckNameRequest # type: ignore + from ._models import ClusterPrincipalAssignmentListResult # type: ignore + from ._models import ClusterUpdate # type: ignore + from ._models import ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore + from ._models import DataConnection # type: ignore + from ._models import DataConnectionCheckNameRequest # type: ignore + from ._models import DataConnectionListResult # type: ignore + from ._models import DataConnectionValidation # type: ignore + from ._models import DataConnectionValidationListResult # type: ignore + from ._models import DataConnectionValidationResult # type: ignore + from ._models import Database # type: ignore + from ._models import DatabaseListResult # type: ignore + from ._models import DatabasePrincipal # type: ignore + from ._models import DatabasePrincipalAssignment # type: ignore + from ._models import DatabasePrincipalAssignmentCheckNameRequest # type: ignore + from ._models import DatabasePrincipalAssignmentListResult # type: ignore + from ._models import DatabasePrincipalListRequest # type: ignore + from ._models import DatabasePrincipalListResult # type: ignore + from ._models import DatabaseStatistics # type: ignore + from ._models import DiagnoseVirtualNetworkResult # type: ignore + from ._models import EventGridDataConnection # type: ignore + from ._models import EventHubDataConnection # type: ignore + from ._models import FollowerDatabaseDefinition # type: ignore + from ._models import FollowerDatabaseListResult # type: ignore + from ._models import IotHubDataConnection # type: ignore + from ._models import KeyVaultProperties # type: ignore + from ._models import LanguageExtension # type: ignore + from ._models import LanguageExtensionsList # type: ignore + from ._models import ListResourceSkusResult # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import OptimizedAutoscale # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import ReadOnlyFollowingDatabase # type: ignore + from ._models import ReadWriteDatabase # type: ignore + from ._models import Resource # type: ignore + from ._models import SkuDescription # type: ignore + from ._models import SkuDescriptionList # type: ignore + from ._models import SkuLocationInfoItem # type: ignore + from ._models import TrackedResource # type: ignore + from ._models import TrustedExternalTenant # type: ignore + from ._models import VirtualNetworkConfiguration # type: ignore + +from ._kusto_management_client_enums import ( + AzureScaleType, + AzureSkuName, + AzureSkuTier, + ClusterPrincipalRole, + Compression, + DatabasePrincipalRole, + DatabasePrincipalType, + DefaultPrincipalsModificationKind, + EventGridDataFormat, + EventHubDataFormat, + IdentityType, + IotHubDataFormat, + Kind, + LanguageExtensionName, + PrincipalType, + PrincipalsModificationKind, + ProvisioningState, + Reason, + State, + Type, +) + +__all__ = [ + 'AttachedDatabaseConfiguration', + 'AttachedDatabaseConfigurationListResult', + 'AzureCapacity', + 'AzureResourceSku', + 'AzureSku', + 'CheckNameRequest', + 'CheckNameResult', + 'CloudErrorBody', + 'Cluster', + 'ClusterCheckNameRequest', + 'ClusterListResult', + 'ClusterPrincipalAssignment', + 'ClusterPrincipalAssignmentCheckNameRequest', + 'ClusterPrincipalAssignmentListResult', + 'ClusterUpdate', + 'ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties', + 'DataConnection', + 'DataConnectionCheckNameRequest', + 'DataConnectionListResult', + 'DataConnectionValidation', + 'DataConnectionValidationListResult', + 'DataConnectionValidationResult', + 'Database', + 'DatabaseListResult', + 'DatabasePrincipal', + 'DatabasePrincipalAssignment', + 'DatabasePrincipalAssignmentCheckNameRequest', + 'DatabasePrincipalAssignmentListResult', + 'DatabasePrincipalListRequest', + 'DatabasePrincipalListResult', + 'DatabaseStatistics', + 'DiagnoseVirtualNetworkResult', + 'EventGridDataConnection', + 'EventHubDataConnection', + 'FollowerDatabaseDefinition', + 'FollowerDatabaseListResult', + 'IotHubDataConnection', + 'KeyVaultProperties', + 'LanguageExtension', + 'LanguageExtensionsList', + 'ListResourceSkusResult', + 'Operation', + 'OperationDisplay', + 'OperationListResult', + 'OptimizedAutoscale', + 'ProxyResource', + 'ReadOnlyFollowingDatabase', + 'ReadWriteDatabase', + 'Resource', + 'SkuDescription', + 'SkuDescriptionList', + 'SkuLocationInfoItem', + 'TrackedResource', + 'TrustedExternalTenant', + 'VirtualNetworkConfiguration', + 'AzureScaleType', + 'AzureSkuName', + 'AzureSkuTier', + 'ClusterPrincipalRole', + 'Compression', + 'DatabasePrincipalRole', + 'DatabasePrincipalType', + 'DefaultPrincipalsModificationKind', + 'EventGridDataFormat', + 'EventHubDataFormat', + 'IdentityType', + 'IotHubDataFormat', + 'Kind', + 'LanguageExtensionName', + 'PrincipalType', + 'PrincipalsModificationKind', + 'ProvisioningState', + 'Reason', + 'State', + 'Type', +] diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/models/_kusto_management_client_enums.py b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_kusto_management_client_enums.py new file mode 100644 index 00000000000..0d69900464b --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_kusto_management_client_enums.py @@ -0,0 +1,231 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + +class AzureScaleType(str, Enum): + """Scale type. + """ + + automatic = "automatic" + manual = "manual" + none = "none" + +class AzureSkuName(str, Enum): + """SKU name. + """ + + standard_ds13_v2_1_tb_ps = "Standard_DS13_v2+1TB_PS" + standard_ds13_v2_tb_ps = "Standard_DS13_v2+2TB_PS" + standard_ds14_v2_3_tb_ps = "Standard_DS14_v2+3TB_PS" + standard_ds14_v2_4_tb_ps = "Standard_DS14_v2+4TB_PS" + standard_d13_v2 = "Standard_D13_v2" + standard_d14_v2 = "Standard_D14_v2" + standard_l8_s = "Standard_L8s" + standard_l16_s = "Standard_L16s" + standard_d11_v2 = "Standard_D11_v2" + standard_d12_v2 = "Standard_D12_v2" + standard_l4_s = "Standard_L4s" + dev_no_sla_standard_d11_v2 = "Dev(No SLA)_Standard_D11_v2" + standard_e2_a_v4 = "Standard_E2a_v4" + standard_e4_a_v4 = "Standard_E4a_v4" + standard_e8_a_v4 = "Standard_E8a_v4" + standard_e16_a_v4 = "Standard_E16a_v4" + standard_e8_as_v4_1_tb_ps = "Standard_E8as_v4+1TB_PS" + standard_e8_as_v4_2_tb_ps = "Standard_E8as_v4+2TB_PS" + standard_e16_as_v4_3_tb_ps = "Standard_E16as_v4+3TB_PS" + standard_e16_as_v4_tb_ps = "Standard_E16as_v4+4TB_PS" + dev_no_sla_standard_e2_a_v4 = "Dev(No SLA)_Standard_E2a_v4" + +class AzureSkuTier(str, Enum): + """SKU tier. + """ + + basic = "Basic" + standard = "Standard" + +class ClusterPrincipalRole(str, Enum): + """Cluster principal role. + """ + + all_databases_admin = "AllDatabasesAdmin" + all_databases_viewer = "AllDatabasesViewer" + +class Compression(str, Enum): + """The compression type + """ + + none = "None" + g_zip = "GZip" + +class DatabasePrincipalRole(str, Enum): + """Database principal role. + """ + + admin = "Admin" + ingestor = "Ingestor" + monitor = "Monitor" + user = "User" + unrestricted_viewers = "UnrestrictedViewers" + viewer = "Viewer" + +class DatabasePrincipalType(str, Enum): + """Database principal type. + """ + + app = "App" + group = "Group" + user = "User" + +class DefaultPrincipalsModificationKind(str, Enum): + """The default principals modification kind + """ + + union = "Union" + replace = "Replace" + none = "None" + +class EventGridDataFormat(str, Enum): + """The data format of the message. Optionally the data format can be added to each message. + """ + + multijson = "MULTIJSON" + json = "JSON" + csv = "CSV" + tsv = "TSV" + scsv = "SCSV" + sohsv = "SOHSV" + psv = "PSV" + txt = "TXT" + raw = "RAW" + singlejson = "SINGLEJSON" + avro = "AVRO" + tsve = "TSVE" + parquet = "PARQUET" + orc = "ORC" + +class EventHubDataFormat(str, Enum): + """The data format of the message. Optionally the data format can be added to each message. + """ + + multijson = "MULTIJSON" + json = "JSON" + csv = "CSV" + tsv = "TSV" + scsv = "SCSV" + sohsv = "SOHSV" + psv = "PSV" + txt = "TXT" + raw = "RAW" + singlejson = "SINGLEJSON" + avro = "AVRO" + tsve = "TSVE" + parquet = "PARQUET" + orc = "ORC" + +class IdentityType(str, Enum): + """The identity type. + """ + + none = "None" + system_assigned = "SystemAssigned" + +class IotHubDataFormat(str, Enum): + """The data format of the message. Optionally the data format can be added to each message. + """ + + multijson = "MULTIJSON" + json = "JSON" + csv = "CSV" + tsv = "TSV" + scsv = "SCSV" + sohsv = "SOHSV" + psv = "PSV" + txt = "TXT" + raw = "RAW" + singlejson = "SINGLEJSON" + avro = "AVRO" + tsve = "TSVE" + parquet = "PARQUET" + orc = "ORC" + +class Kind(str, Enum): + """Kind of the database + """ + + read_write = "ReadWrite" + read_only_following = "ReadOnlyFollowing" + event_hub = "EventHub" + event_grid = "EventGrid" + iot_hub = "IotHub" + +class LanguageExtensionName(str, Enum): + """Language extension that can run within KQL query. + """ + + python = "PYTHON" + r = "R" + +class PrincipalsModificationKind(str, Enum): + """The principals modification kind of the database + """ + + union = "Union" + replace = "Replace" + none = "None" + +class PrincipalType(str, Enum): + """Principal type. + """ + + app = "App" + group = "Group" + user = "User" + +class ProvisioningState(str, Enum): + """The provisioned state of the resource. + """ + + running = "Running" + creating = "Creating" + deleting = "Deleting" + succeeded = "Succeeded" + failed = "Failed" + moving = "Moving" + +class Reason(str, Enum): + """Message providing the reason why the given name is invalid. + """ + + invalid = "Invalid" + already_exists = "AlreadyExists" + +class State(str, Enum): + """The state of the resource. + """ + + creating = "Creating" + unavailable = "Unavailable" + running = "Running" + deleting = "Deleting" + deleted = "Deleted" + stopping = "Stopping" + stopped = "Stopped" + starting = "Starting" + updating = "Updating" + +class Type(str, Enum): + """The type of resource, Microsoft.Kusto/clusters. + """ + + microsoft_kusto_clusters = "Microsoft.Kusto/clusters" + microsoft_kusto_clusters_databases = "Microsoft.Kusto/clusters/databases" + microsoft_kusto_clusters_attached_database_configurations = "Microsoft.Kusto/clusters/attachedDatabaseConfigurations" + microsoft_kusto_clusters_principal_assignments = "Microsoft.Kusto/clusters/principalAssignments" + microsoft_kusto_clusters_databases_data_connections = "Microsoft.Kusto/clusters/databases/dataConnections" + microsoft_kusto_clusters_databases_principal_assignments = "Microsoft.Kusto/clusters/databases/principalAssignments" diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models.py b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models.py new file mode 100644 index 00000000000..c38a705e717 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models.py @@ -0,0 +1,2211 @@ +# 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 msrest.serialization + + +class Resource(msrest.serialization.Model): + """Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class AttachedDatabaseConfiguration(ProxyResource): + """Class representing an attached database configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :param database_name: The name of the database which you would like to attach, use * if you + want to follow all current and future databases. + :type database_name: str + :param cluster_resource_id: The resource id of the cluster where the databases you would like + to attach reside. + :type cluster_resource_id: str + :ivar attached_database_names: The list of databases from the clusterResourceId which are + currently attached to the cluster. + :vartype attached_database_names: list[str] + :param default_principals_modification_kind: The default principals modification kind. Possible + values include: "Union", "Replace", "None". + :type default_principals_modification_kind: str or + ~azure.mgmt.kusto.models.DefaultPrincipalsModificationKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'attached_database_names': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'cluster_resource_id': {'key': 'properties.clusterResourceId', 'type': 'str'}, + 'attached_database_names': {'key': 'properties.attachedDatabaseNames', 'type': '[str]'}, + 'default_principals_modification_kind': {'key': 'properties.defaultPrincipalsModificationKind', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AttachedDatabaseConfiguration, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.provisioning_state = None + self.database_name = kwargs.get('database_name', None) + self.cluster_resource_id = kwargs.get('cluster_resource_id', None) + self.attached_database_names = None + self.default_principals_modification_kind = kwargs.get('default_principals_modification_kind', None) + + +class AttachedDatabaseConfigurationListResult(msrest.serialization.Model): + """The list attached database configurations operation response. + + :param value: The list of attached database configurations. + :type value: list[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AttachedDatabaseConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(AttachedDatabaseConfigurationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class AzureCapacity(msrest.serialization.Model): + """Azure capacity definition. + + All required parameters must be populated in order to send to Azure. + + :param scale_type: Required. Scale type. Possible values include: "automatic", "manual", + "none". + :type scale_type: str or ~azure.mgmt.kusto.models.AzureScaleType + :param minimum: Required. Minimum allowed capacity. + :type minimum: int + :param maximum: Required. Maximum allowed capacity. + :type maximum: int + :param default: Required. The default capacity that would be used. + :type default: int + """ + + _validation = { + 'scale_type': {'required': True}, + 'minimum': {'required': True}, + 'maximum': {'required': True}, + 'default': {'required': True}, + } + + _attribute_map = { + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureCapacity, self).__init__(**kwargs) + self.scale_type = kwargs['scale_type'] + self.minimum = kwargs['minimum'] + self.maximum = kwargs['maximum'] + self.default = kwargs['default'] + + +class AzureResourceSku(msrest.serialization.Model): + """Azure resource SKU definition. + + :param resource_type: Resource Namespace and Type. + :type resource_type: str + :param sku: The SKU details. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :param capacity: The number of instances of the cluster. + :type capacity: ~azure.mgmt.kusto.models.AzureCapacity + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AzureSku'}, + 'capacity': {'key': 'capacity', 'type': 'AzureCapacity'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureResourceSku, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.sku = kwargs.get('sku', None) + self.capacity = kwargs.get('capacity', None) + + +class AzureSku(msrest.serialization.Model): + """Azure SKU definition. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. SKU name. Possible values include: "Standard_DS13_v2+1TB_PS", + "Standard_DS13_v2+2TB_PS", "Standard_DS14_v2+3TB_PS", "Standard_DS14_v2+4TB_PS", + "Standard_D13_v2", "Standard_D14_v2", "Standard_L8s", "Standard_L16s", "Standard_D11_v2", + "Standard_D12_v2", "Standard_L4s", "Dev(No SLA)_Standard_D11_v2", "Standard_E2a_v4", + "Standard_E4a_v4", "Standard_E8a_v4", "Standard_E16a_v4", "Standard_E8as_v4+1TB_PS", + "Standard_E8as_v4+2TB_PS", "Standard_E16as_v4+3TB_PS", "Standard_E16as_v4+4TB_PS", "Dev(No + SLA)_Standard_E2a_v4". + :type name: str or ~azure.mgmt.kusto.models.AzureSkuName + :param capacity: The number of instances of the cluster. + :type capacity: int + :param tier: Required. SKU tier. Possible values include: "Basic", "Standard". + :type tier: str or ~azure.mgmt.kusto.models.AzureSkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureSku, self).__init__(**kwargs) + self.name = kwargs['name'] + self.capacity = kwargs.get('capacity', None) + self.tier = kwargs['tier'] + + +class CheckNameRequest(msrest.serialization.Model): + """The result returned from a database check name availability request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name. + :type name: str + :param type: Required. The type of resource, for instance Microsoft.Kusto/clusters/databases. + Possible values include: "Microsoft.Kusto/clusters", "Microsoft.Kusto/clusters/databases", + "Microsoft.Kusto/clusters/attachedDatabaseConfigurations", + "Microsoft.Kusto/clusters/principalAssignments", + "Microsoft.Kusto/clusters/databases/dataConnections", + "Microsoft.Kusto/clusters/databases/principalAssignments". + :type type: str or ~azure.mgmt.kusto.models.Type + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameRequest, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs['type'] + + +class CheckNameResult(msrest.serialization.Model): + """The result returned from a check name availability request. + + :param name_available: Specifies a Boolean value that indicates if the name is available. + :type name_available: bool + :param name: The name that was checked. + :type name: str + :param message: Message indicating an unavailable name due to a conflict, or a description of + the naming rules that are violated. + :type message: str + :param reason: Message providing the reason why the given name is invalid. Possible values + include: "Invalid", "AlreadyExists". + :type reason: str or ~azure.mgmt.kusto.models.Reason + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameResult, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.name = kwargs.get('name', None) + self.message = kwargs.get('message', None) + self.reason = kwargs.get('reason', None) + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from Kusto. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for displaying in a + user interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.kusto.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs['location'] + + +class Cluster(TrackedResource): + """Class representing a Kusto cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :param sku: Required. The SKU of the cluster. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :param zones: The availability zones of the cluster. + :type zones: list[str] + :ivar state: The state of the resource. Possible values include: "Creating", "Unavailable", + "Running", "Deleting", "Deleted", "Stopping", "Stopped", "Starting", "Updating". + :vartype state: str or ~azure.mgmt.kusto.models.State + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :ivar uri: The cluster URI. + :vartype uri: str + :ivar data_ingestion_uri: The cluster data ingestion URI. + :vartype data_ingestion_uri: str + :ivar state_reason: The reason for the cluster's current state. + :vartype state_reason: str + :param trusted_external_tenants: The cluster's external tenants. + :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :param optimized_autoscale: Optimized auto scale definition. + :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are + encrypted. + :type enable_disk_encryption: bool + :param enable_streaming_ingest: A boolean value that indicates if the streaming ingest is + enabled. + :type enable_streaming_ingest: bool + :param virtual_network_configuration: Virtual network definition. + :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :param key_vault_properties: KeyVault properties for the cluster encryption. + :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :param enable_purge: A boolean value that indicates if the purge operations are enabled. + :type enable_purge: bool + :param value: The list of language extensions. + :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type_identity_type: The identity type. Possible values include: "None", + "SystemAssigned". + :type type_identity_type: str or ~azure.mgmt.kusto.models.IdentityType + :param user_assigned_identities: The list of user identities associated with the Kusto cluster. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.kusto.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'uri': {'readonly': True}, + 'data_ingestion_uri': {'readonly': True}, + 'state_reason': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AzureSku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'data_ingestion_uri': {'key': 'properties.dataIngestionUri', 'type': 'str'}, + 'state_reason': {'key': 'properties.stateReason', 'type': 'str'}, + 'trusted_external_tenants': {'key': 'properties.trustedExternalTenants', 'type': '[TrustedExternalTenant]'}, + 'optimized_autoscale': {'key': 'properties.optimizedAutoscale', 'type': 'OptimizedAutoscale'}, + 'enable_disk_encryption': {'key': 'properties.enableDiskEncryption', 'type': 'bool'}, + 'enable_streaming_ingest': {'key': 'properties.enableStreamingIngest', 'type': 'bool'}, + 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'KeyVaultProperties'}, + 'enable_purge': {'key': 'properties.enablePurge', 'type': 'bool'}, + 'value': {'key': 'properties.languageExtensions.value', 'type': '[LanguageExtension]'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + **kwargs + ): + super(Cluster, self).__init__(**kwargs) + self.sku = kwargs['sku'] + self.zones = kwargs.get('zones', None) + self.state = None + self.provisioning_state = None + self.uri = None + self.data_ingestion_uri = None + self.state_reason = None + self.trusted_external_tenants = kwargs.get('trusted_external_tenants', None) + self.optimized_autoscale = kwargs.get('optimized_autoscale', None) + self.enable_disk_encryption = kwargs.get('enable_disk_encryption', None) + self.enable_streaming_ingest = kwargs.get('enable_streaming_ingest', False) + self.virtual_network_configuration = kwargs.get('virtual_network_configuration', None) + self.key_vault_properties = kwargs.get('key_vault_properties', None) + self.enable_purge = kwargs.get('enable_purge', False) + self.value = kwargs.get('value', None) + self.principal_id = None + self.tenant_id = None + self.type_identity_type = kwargs.get('type_identity_type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class ClusterCheckNameRequest(msrest.serialization.Model): + """The result returned from a cluster check name availability request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Cluster name. + :type name: str + :param type: Required. The type of resource, Microsoft.Kusto/clusters. Possible values include: + "Microsoft.Kusto/clusters", "Microsoft.Kusto/clusters/databases", + "Microsoft.Kusto/clusters/attachedDatabaseConfigurations", + "Microsoft.Kusto/clusters/principalAssignments", + "Microsoft.Kusto/clusters/databases/dataConnections", + "Microsoft.Kusto/clusters/databases/principalAssignments". + :type type: str or ~azure.mgmt.kusto.models.Type + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClusterCheckNameRequest, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs['type'] + + +class ClusterListResult(msrest.serialization.Model): + """The list Kusto clusters operation response. + + :param value: The list of Kusto clusters. + :type value: list[~azure.mgmt.kusto.models.Cluster] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Cluster]'}, + } + + def __init__( + self, + **kwargs + ): + super(ClusterListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ClusterPrincipalAssignment(ProxyResource): + """Class representing a cluster principal assignment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param principal_id: The principal ID assigned to the cluster principal. It can be a user + email, application ID, or security group name. + :type principal_id: str + :param role: Cluster principal role. Possible values include: "AllDatabasesAdmin", + "AllDatabasesViewer". + :type role: str or ~azure.mgmt.kusto.models.ClusterPrincipalRole + :param tenant_id: The tenant id of the principal. + :type tenant_id: str + :param principal_type: Principal type. Possible values include: "App", "Group", "User". + :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :ivar tenant_name: The tenant name of the principal. + :vartype tenant_name: str + :ivar principal_name: The principal name. + :vartype principal_name: str + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tenant_name': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'tenant_name': {'key': 'properties.tenantName', 'type': 'str'}, + 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClusterPrincipalAssignment, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.role = kwargs.get('role', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.principal_type = kwargs.get('principal_type', None) + self.tenant_name = None + self.principal_name = None + self.provisioning_state = None + + +class ClusterPrincipalAssignmentCheckNameRequest(msrest.serialization.Model): + """A principal assignment check name availability request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Principal Assignment resource name. + :type name: str + :param type: Required. The type of resource, Microsoft.Kusto/clusters/principalAssignments. + Possible values include: "Microsoft.Kusto/clusters", "Microsoft.Kusto/clusters/databases", + "Microsoft.Kusto/clusters/attachedDatabaseConfigurations", + "Microsoft.Kusto/clusters/principalAssignments", + "Microsoft.Kusto/clusters/databases/dataConnections", + "Microsoft.Kusto/clusters/databases/principalAssignments". + :type type: str or ~azure.mgmt.kusto.models.Type + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ClusterPrincipalAssignmentCheckNameRequest, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs['type'] + + +class ClusterPrincipalAssignmentListResult(msrest.serialization.Model): + """The list Kusto cluster principal assignments operation response. + + :param value: The list of Kusto cluster principal assignments. + :type value: list[~azure.mgmt.kusto.models.ClusterPrincipalAssignment] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ClusterPrincipalAssignment]'}, + } + + def __init__( + self, + **kwargs + ): + super(ClusterPrincipalAssignmentListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ClusterUpdate(Resource): + """Class representing an update to a Kusto cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Resource location. + :type location: str + :param sku: The SKU of the cluster. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :ivar state: The state of the resource. Possible values include: "Creating", "Unavailable", + "Running", "Deleting", "Deleted", "Stopping", "Stopped", "Starting", "Updating". + :vartype state: str or ~azure.mgmt.kusto.models.State + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :ivar uri: The cluster URI. + :vartype uri: str + :ivar data_ingestion_uri: The cluster data ingestion URI. + :vartype data_ingestion_uri: str + :ivar state_reason: The reason for the cluster's current state. + :vartype state_reason: str + :param trusted_external_tenants: The cluster's external tenants. + :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :param optimized_autoscale: Optimized auto scale definition. + :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are + encrypted. + :type enable_disk_encryption: bool + :param enable_streaming_ingest: A boolean value that indicates if the streaming ingest is + enabled. + :type enable_streaming_ingest: bool + :param virtual_network_configuration: Virtual network definition. + :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :param key_vault_properties: KeyVault properties for the cluster encryption. + :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :param enable_purge: A boolean value that indicates if the purge operations are enabled. + :type enable_purge: bool + :param value: The list of language extensions. + :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type_identity_type: The identity type. Possible values include: "None", + "SystemAssigned". + :type type_identity_type: str or ~azure.mgmt.kusto.models.IdentityType + :param user_assigned_identities: The list of user identities associated with the Kusto cluster. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.kusto.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'uri': {'readonly': True}, + 'data_ingestion_uri': {'readonly': True}, + 'state_reason': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AzureSku'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'data_ingestion_uri': {'key': 'properties.dataIngestionUri', 'type': 'str'}, + 'state_reason': {'key': 'properties.stateReason', 'type': 'str'}, + 'trusted_external_tenants': {'key': 'properties.trustedExternalTenants', 'type': '[TrustedExternalTenant]'}, + 'optimized_autoscale': {'key': 'properties.optimizedAutoscale', 'type': 'OptimizedAutoscale'}, + 'enable_disk_encryption': {'key': 'properties.enableDiskEncryption', 'type': 'bool'}, + 'enable_streaming_ingest': {'key': 'properties.enableStreamingIngest', 'type': 'bool'}, + 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'KeyVaultProperties'}, + 'enable_purge': {'key': 'properties.enablePurge', 'type': 'bool'}, + 'value': {'key': 'properties.languageExtensions.value', 'type': '[LanguageExtension]'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + **kwargs + ): + super(ClusterUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + self.sku = kwargs.get('sku', None) + self.state = None + self.provisioning_state = None + self.uri = None + self.data_ingestion_uri = None + self.state_reason = None + self.trusted_external_tenants = kwargs.get('trusted_external_tenants', None) + self.optimized_autoscale = kwargs.get('optimized_autoscale', None) + self.enable_disk_encryption = kwargs.get('enable_disk_encryption', None) + self.enable_streaming_ingest = kwargs.get('enable_streaming_ingest', False) + self.virtual_network_configuration = kwargs.get('virtual_network_configuration', None) + self.key_vault_properties = kwargs.get('key_vault_properties', None) + self.enable_purge = kwargs.get('enable_purge', False) + self.value = kwargs.get('value', None) + self.principal_id = None + self.tenant_id = None + self.type_identity_type = kwargs.get('type_identity_type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class Database(ProxyResource): + """Class representing a Kusto database. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ReadOnlyFollowingDatabase, ReadWriteDatabase. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Kind of the database.Constant filled by server. Possible values + include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". + :type kind: str or ~azure.mgmt.kusto.models.Kind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ReadOnlyFollowing': 'ReadOnlyFollowingDatabase', 'ReadWrite': 'ReadWriteDatabase'} + } + + def __init__( + self, + **kwargs + ): + super(Database, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.kind = 'Database' + + +class DatabaseListResult(msrest.serialization.Model): + """The list Kusto databases operation response. + + :param value: The list of Kusto databases. + :type value: list[~azure.mgmt.kusto.models.Database] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Database]'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class DatabasePrincipal(msrest.serialization.Model): + """A class representing database principal entity. + + 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 role: Required. Database principal role. Possible values include: "Admin", "Ingestor", + "Monitor", "User", "UnrestrictedViewers", "Viewer". + :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :param name: Required. Database principal name. + :type name: str + :param type: Required. Database principal type. Possible values include: "App", "Group", + "User". + :type type: str or ~azure.mgmt.kusto.models.DatabasePrincipalType + :param fqn: Database principal fully qualified name. + :type fqn: str + :param email: Database principal email if exists. + :type email: str + :param app_id: Application id - relevant only for application principal type. + :type app_id: str + :ivar tenant_name: The tenant name of the principal. + :vartype tenant_name: str + """ + + _validation = { + 'role': {'required': True}, + 'name': {'required': True}, + 'type': {'required': True}, + 'tenant_name': {'readonly': True}, + } + + _attribute_map = { + 'role': {'key': 'role', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'fqn': {'key': 'fqn', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + 'tenant_name': {'key': 'tenantName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabasePrincipal, self).__init__(**kwargs) + self.role = kwargs['role'] + self.name = kwargs['name'] + self.type = kwargs['type'] + self.fqn = kwargs.get('fqn', None) + self.email = kwargs.get('email', None) + self.app_id = kwargs.get('app_id', None) + self.tenant_name = None + + +class DatabasePrincipalAssignment(ProxyResource): + """Class representing a database principal assignment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param principal_id: The principal ID assigned to the database principal. It can be a user + email, application ID, or security group name. + :type principal_id: str + :param role: Database principal role. Possible values include: "Admin", "Ingestor", "Monitor", + "User", "UnrestrictedViewers", "Viewer". + :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :param tenant_id: The tenant id of the principal. + :type tenant_id: str + :param principal_type: Principal type. Possible values include: "App", "Group", "User". + :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :ivar tenant_name: The tenant name of the principal. + :vartype tenant_name: str + :ivar principal_name: The principal name. + :vartype principal_name: str + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tenant_name': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'tenant_name': {'key': 'properties.tenantName', 'type': 'str'}, + 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabasePrincipalAssignment, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.role = kwargs.get('role', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.principal_type = kwargs.get('principal_type', None) + self.tenant_name = None + self.principal_name = None + self.provisioning_state = None + + +class DatabasePrincipalAssignmentCheckNameRequest(msrest.serialization.Model): + """A principal assignment check name availability request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Principal Assignment resource name. + :type name: str + :param type: Required. The type of resource, + Microsoft.Kusto/clusters/databases/principalAssignments. Possible values include: + "Microsoft.Kusto/clusters", "Microsoft.Kusto/clusters/databases", + "Microsoft.Kusto/clusters/attachedDatabaseConfigurations", + "Microsoft.Kusto/clusters/principalAssignments", + "Microsoft.Kusto/clusters/databases/dataConnections", + "Microsoft.Kusto/clusters/databases/principalAssignments". + :type type: str or ~azure.mgmt.kusto.models.Type + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabasePrincipalAssignmentCheckNameRequest, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs['type'] + + +class DatabasePrincipalAssignmentListResult(msrest.serialization.Model): + """The list Kusto database principal assignments operation response. + + :param value: The list of Kusto database principal assignments. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipalAssignment] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DatabasePrincipalAssignment]'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabasePrincipalAssignmentListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class DatabasePrincipalListRequest(msrest.serialization.Model): + """The list Kusto database principals operation request. + + :param value: The list of Kusto database principals. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DatabasePrincipal]'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabasePrincipalListRequest, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class DatabasePrincipalListResult(msrest.serialization.Model): + """The list Kusto database principals operation response. + + :param value: The list of Kusto database principals. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DatabasePrincipal]'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabasePrincipalListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class DatabaseStatistics(msrest.serialization.Model): + """A class that contains database statistics information. + + :param size: The database size - the total size of compressed data and index in bytes. + :type size: float + """ + + _attribute_map = { + 'size': {'key': 'size', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseStatistics, self).__init__(**kwargs) + self.size = kwargs.get('size', None) + + +class DataConnection(ProxyResource): + """Class representing an data connection. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EventGridDataConnection, EventHubDataConnection, IotHubDataConnection. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. + Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". + :type kind: str or ~azure.mgmt.kusto.models.Kind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'EventGrid': 'EventGridDataConnection', 'EventHub': 'EventHubDataConnection', 'IotHub': 'IotHubDataConnection'} + } + + def __init__( + self, + **kwargs + ): + super(DataConnection, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.kind = 'DataConnection' + + +class DataConnectionCheckNameRequest(msrest.serialization.Model): + """A data connection check name availability request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Data Connection name. + :type name: str + :param type: Required. The type of resource, + Microsoft.Kusto/clusters/databases/dataConnections. Possible values include: + "Microsoft.Kusto/clusters", "Microsoft.Kusto/clusters/databases", + "Microsoft.Kusto/clusters/attachedDatabaseConfigurations", + "Microsoft.Kusto/clusters/principalAssignments", + "Microsoft.Kusto/clusters/databases/dataConnections", + "Microsoft.Kusto/clusters/databases/principalAssignments". + :type type: str or ~azure.mgmt.kusto.models.Type + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataConnectionCheckNameRequest, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs['type'] + + +class DataConnectionListResult(msrest.serialization.Model): + """The list Kusto data connections operation response. + + :param value: The list of Kusto data connections. + :type value: list[~azure.mgmt.kusto.models.DataConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class DataConnectionValidation(msrest.serialization.Model): + """Class representing an data connection validation. + + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param properties: The data connection properties to validate. + :type properties: ~azure.mgmt.kusto.models.DataConnection + """ + + _attribute_map = { + 'data_connection_name': {'key': 'dataConnectionName', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DataConnection'}, + } + + def __init__( + self, + **kwargs + ): + super(DataConnectionValidation, self).__init__(**kwargs) + self.data_connection_name = kwargs.get('data_connection_name', None) + self.properties = kwargs.get('properties', None) + + +class DataConnectionValidationListResult(msrest.serialization.Model): + """The list Kusto data connection validation result. + + :param value: The list of Kusto data connection validation errors. + :type value: list[~azure.mgmt.kusto.models.DataConnectionValidationResult] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataConnectionValidationResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataConnectionValidationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class DataConnectionValidationResult(msrest.serialization.Model): + """The result returned from a data connection validation request. + + :param error_message: A message which indicates a problem in data connection validation. + :type error_message: str + """ + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataConnectionValidationResult, self).__init__(**kwargs) + self.error_message = kwargs.get('error_message', None) + + +class DiagnoseVirtualNetworkResult(msrest.serialization.Model): + """DiagnoseVirtualNetworkResult. + + :param findings: The list of network connectivity diagnostic finding. + :type findings: list[str] + """ + + _attribute_map = { + 'findings': {'key': 'findings', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DiagnoseVirtualNetworkResult, self).__init__(**kwargs) + self.findings = kwargs.get('findings', None) + + +class EventGridDataConnection(DataConnection): + """Class representing an Event Grid data connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. + Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". + :type kind: str or ~azure.mgmt.kusto.models.Kind + :param storage_account_resource_id: The resource ID of the storage account where the data + resides. + :type storage_account_resource_id: str + :param event_hub_resource_id: The resource ID where the event grid is configured to send + events. + :type event_hub_resource_id: str + :param consumer_group: The event hub consumer group. + :type consumer_group: str + :param table_name: The table where the data should be ingested. Optionally the table + information can be added to each message. + :type table_name: str + :param mapping_rule_name: The mapping rule to be used to ingest the data. Optionally the + mapping information can be added to each message. + :type mapping_rule_name: str + :param data_format: The data format of the message. Optionally the data format can be added to + each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", + "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC". + :type data_format: str or ~azure.mgmt.kusto.models.EventGridDataFormat + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'event_hub_resource_id': {'key': 'properties.eventHubResourceId', 'type': 'str'}, + 'consumer_group': {'key': 'properties.consumerGroup', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + 'mapping_rule_name': {'key': 'properties.mappingRuleName', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EventGridDataConnection, self).__init__(**kwargs) + self.kind = 'EventGrid' + self.storage_account_resource_id = kwargs.get('storage_account_resource_id', None) + self.event_hub_resource_id = kwargs.get('event_hub_resource_id', None) + self.consumer_group = kwargs.get('consumer_group', None) + self.table_name = kwargs.get('table_name', None) + self.mapping_rule_name = kwargs.get('mapping_rule_name', None) + self.data_format = kwargs.get('data_format', None) + + +class EventHubDataConnection(DataConnection): + """Class representing an event hub data connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. + Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". + :type kind: str or ~azure.mgmt.kusto.models.Kind + :param event_hub_resource_id: The resource ID of the event hub to be used to create a data + connection. + :type event_hub_resource_id: str + :param consumer_group: The event hub consumer group. + :type consumer_group: str + :param table_name: The table where the data should be ingested. Optionally the table + information can be added to each message. + :type table_name: str + :param mapping_rule_name: The mapping rule to be used to ingest the data. Optionally the + mapping information can be added to each message. + :type mapping_rule_name: str + :param data_format: The data format of the message. Optionally the data format can be added to + each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", + "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC". + :type data_format: str or ~azure.mgmt.kusto.models.EventHubDataFormat + :param event_system_properties: System properties of the event hub. + :type event_system_properties: list[str] + :param compression: The event hub messages compression type. Possible values include: "None", + "GZip". + :type compression: str or ~azure.mgmt.kusto.models.Compression + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'event_hub_resource_id': {'key': 'properties.eventHubResourceId', 'type': 'str'}, + 'consumer_group': {'key': 'properties.consumerGroup', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + 'mapping_rule_name': {'key': 'properties.mappingRuleName', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'event_system_properties': {'key': 'properties.eventSystemProperties', 'type': '[str]'}, + 'compression': {'key': 'properties.compression', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EventHubDataConnection, self).__init__(**kwargs) + self.kind = 'EventHub' + self.event_hub_resource_id = kwargs.get('event_hub_resource_id', None) + self.consumer_group = kwargs.get('consumer_group', None) + self.table_name = kwargs.get('table_name', None) + self.mapping_rule_name = kwargs.get('mapping_rule_name', None) + self.data_format = kwargs.get('data_format', None) + self.event_system_properties = kwargs.get('event_system_properties', None) + self.compression = kwargs.get('compression', None) + + +class FollowerDatabaseDefinition(msrest.serialization.Model): + """A class representing follower database request. + + 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 cluster_resource_id: Required. Resource id of the cluster that follows a database owned + by this cluster. + :type cluster_resource_id: str + :param attached_database_configuration_name: Required. Resource name of the attached database + configuration in the follower cluster. + :type attached_database_configuration_name: str + :ivar database_name: The database name owned by this cluster that was followed. * in case + following all databases. + :vartype database_name: str + """ + + _validation = { + 'cluster_resource_id': {'required': True}, + 'attached_database_configuration_name': {'required': True}, + 'database_name': {'readonly': True}, + } + + _attribute_map = { + 'cluster_resource_id': {'key': 'clusterResourceId', 'type': 'str'}, + 'attached_database_configuration_name': {'key': 'attachedDatabaseConfigurationName', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(FollowerDatabaseDefinition, self).__init__(**kwargs) + self.cluster_resource_id = kwargs['cluster_resource_id'] + self.attached_database_configuration_name = kwargs['attached_database_configuration_name'] + self.database_name = None + + +class FollowerDatabaseListResult(msrest.serialization.Model): + """The list Kusto database principals operation response. + + :param value: The list of follower database result. + :type value: list[~azure.mgmt.kusto.models.FollowerDatabaseDefinition] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FollowerDatabaseDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(FollowerDatabaseListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class IotHubDataConnection(DataConnection): + """Class representing an iot hub data connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. + Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". + :type kind: str or ~azure.mgmt.kusto.models.Kind + :param iot_hub_resource_id: The resource ID of the Iot hub to be used to create a data + connection. + :type iot_hub_resource_id: str + :param consumer_group: The iot hub consumer group. + :type consumer_group: str + :param table_name: The table where the data should be ingested. Optionally the table + information can be added to each message. + :type table_name: str + :param mapping_rule_name: The mapping rule to be used to ingest the data. Optionally the + mapping information can be added to each message. + :type mapping_rule_name: str + :param data_format: The data format of the message. Optionally the data format can be added to + each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", + "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC". + :type data_format: str or ~azure.mgmt.kusto.models.IotHubDataFormat + :param event_system_properties: System properties of the iot hub. + :type event_system_properties: list[str] + :param shared_access_policy_name: The name of the share access policy. + :type shared_access_policy_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'iot_hub_resource_id': {'key': 'properties.iotHubResourceId', 'type': 'str'}, + 'consumer_group': {'key': 'properties.consumerGroup', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + 'mapping_rule_name': {'key': 'properties.mappingRuleName', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'event_system_properties': {'key': 'properties.eventSystemProperties', 'type': '[str]'}, + 'shared_access_policy_name': {'key': 'properties.sharedAccessPolicyName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IotHubDataConnection, self).__init__(**kwargs) + self.kind = 'IotHub' + self.iot_hub_resource_id = kwargs.get('iot_hub_resource_id', None) + self.consumer_group = kwargs.get('consumer_group', None) + self.table_name = kwargs.get('table_name', None) + self.mapping_rule_name = kwargs.get('mapping_rule_name', None) + self.data_format = kwargs.get('data_format', None) + self.event_system_properties = kwargs.get('event_system_properties', None) + self.shared_access_policy_name = kwargs.get('shared_access_policy_name', None) + + +class KeyVaultProperties(msrest.serialization.Model): + """Properties of the key vault. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of the key vault key. + :type key_name: str + :param key_version: Required. The version of the key vault key. + :type key_version: str + :param key_vault_uri: Required. The Uri of the key vault. + :type key_vault_uri: str + """ + + _validation = { + 'key_name': {'required': True}, + 'key_version': {'required': True}, + 'key_vault_uri': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_version': {'key': 'keyVersion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs['key_name'] + self.key_version = kwargs['key_version'] + self.key_vault_uri = kwargs['key_vault_uri'] + + +class LanguageExtension(msrest.serialization.Model): + """The language extension object. + + :param language_extension_name: The language extension name. Possible values include: "PYTHON", + "R". + :type language_extension_name: str or ~azure.mgmt.kusto.models.LanguageExtensionName + """ + + _attribute_map = { + 'language_extension_name': {'key': 'languageExtensionName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LanguageExtension, self).__init__(**kwargs) + self.language_extension_name = kwargs.get('language_extension_name', None) + + +class LanguageExtensionsList(msrest.serialization.Model): + """The list of language extension objects. + + :param value: The list of language extensions. + :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LanguageExtension]'}, + } + + def __init__( + self, + **kwargs + ): + super(LanguageExtensionsList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ListResourceSkusResult(msrest.serialization.Model): + """List of available SKUs for a Kusto Cluster. + + :param value: The collection of available SKUs for an existing resource. + :type value: list[~azure.mgmt.kusto.models.AzureResourceSku] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AzureResourceSku]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListResourceSkusResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class Operation(msrest.serialization.Model): + """A REST API operation. + + :param name: This is of the format {provider}/{resource}/{operation}. + :type name: str + :param display: The object that describes the operation. + :type display: ~azure.mgmt.kusto.models.OperationDisplay + :param origin: The intended executor of the operation. + :type origin: str + :param properties: Any object. + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) + + +class OperationDisplay(msrest.serialization.Model): + """The object that describes the operation. + + :param provider: Friendly name of the resource provider. + :type provider: str + :param operation: For example: read, write, delete. + :type operation: str + :param resource: The resource type on which the operation is performed. + :type resource: str + :param description: The friendly name of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.operation = kwargs.get('operation', None) + self.resource = kwargs.get('resource', None) + self.description = kwargs.get('description', None) + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next set of results. + + :param value: The list of operations supported by the resource provider. + :type value: list[~azure.mgmt.kusto.models.Operation] + :param next_link: The URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class OptimizedAutoscale(msrest.serialization.Model): + """A class that contains the optimized auto scale definition. + + All required parameters must be populated in order to send to Azure. + + :param version: Required. The version of the template defined, for instance 1. + :type version: int + :param is_enabled: Required. A boolean value that indicate if the optimized autoscale feature + is enabled or not. + :type is_enabled: bool + :param minimum: Required. Minimum allowed instances count. + :type minimum: int + :param maximum: Required. Maximum allowed instances count. + :type maximum: int + """ + + _validation = { + 'version': {'required': True}, + 'is_enabled': {'required': True}, + 'minimum': {'required': True}, + 'maximum': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'int'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(OptimizedAutoscale, self).__init__(**kwargs) + self.version = kwargs['version'] + self.is_enabled = kwargs['is_enabled'] + self.minimum = kwargs['minimum'] + self.maximum = kwargs['maximum'] + + +class ReadOnlyFollowingDatabase(Database): + """Class representing a read only following database. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Kind of the database.Constant filled by server. Possible values + include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". + :type kind: str or ~azure.mgmt.kusto.models.Kind + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :ivar soft_delete_period: The time the data should be kept before it stops being accessible to + queries in TimeSpan. + :vartype soft_delete_period: ~datetime.timedelta + :param hot_cache_period: The time the data should be kept in cache for fast queries in + TimeSpan. + :type hot_cache_period: ~datetime.timedelta + :ivar statistics: The statistics of the database. + :vartype statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + :ivar leader_cluster_resource_id: The name of the leader cluster. + :vartype leader_cluster_resource_id: str + :ivar attached_database_configuration_name: The name of the attached database configuration + cluster. + :vartype attached_database_configuration_name: str + :ivar principals_modification_kind: The principals modification kind of the database. Possible + values include: "Union", "Replace", "None". + :vartype principals_modification_kind: str or + ~azure.mgmt.kusto.models.PrincipalsModificationKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'soft_delete_period': {'readonly': True}, + 'statistics': {'readonly': True}, + 'leader_cluster_resource_id': {'readonly': True}, + 'attached_database_configuration_name': {'readonly': True}, + 'principals_modification_kind': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, + 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, + 'leader_cluster_resource_id': {'key': 'properties.leaderClusterResourceId', 'type': 'str'}, + 'attached_database_configuration_name': {'key': 'properties.attachedDatabaseConfigurationName', 'type': 'str'}, + 'principals_modification_kind': {'key': 'properties.principalsModificationKind', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReadOnlyFollowingDatabase, self).__init__(**kwargs) + self.kind = 'ReadOnlyFollowing' + self.provisioning_state = None + self.soft_delete_period = None + self.hot_cache_period = kwargs.get('hot_cache_period', None) + self.statistics = None + self.leader_cluster_resource_id = None + self.attached_database_configuration_name = None + self.principals_modification_kind = None + + +class ReadWriteDatabase(Database): + """Class representing a read write database. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Kind of the database.Constant filled by server. Possible values + include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". + :type kind: str or ~azure.mgmt.kusto.models.Kind + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :param soft_delete_period: The time the data should be kept before it stops being accessible to + queries in TimeSpan. + :type soft_delete_period: ~datetime.timedelta + :param hot_cache_period: The time the data should be kept in cache for fast queries in + TimeSpan. + :type hot_cache_period: ~datetime.timedelta + :ivar statistics: The statistics of the database. + :vartype statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + :ivar is_followed: Indicates whether the database is followed. + :vartype is_followed: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'statistics': {'readonly': True}, + 'is_followed': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, + 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, + 'is_followed': {'key': 'properties.isFollowed', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ReadWriteDatabase, self).__init__(**kwargs) + self.kind = 'ReadWrite' + self.provisioning_state = None + self.soft_delete_period = kwargs.get('soft_delete_period', None) + self.hot_cache_period = kwargs.get('hot_cache_period', None) + self.statistics = None + self.is_followed = None + + +class SkuDescription(msrest.serialization.Model): + """The Kusto SKU description of given resource type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The resource type. + :vartype resource_type: str + :ivar name: The name of the SKU. + :vartype name: str + :ivar tier: The tier of the SKU. + :vartype tier: str + :ivar locations: The set of locations that the SKU is available. + :vartype locations: list[str] + :ivar location_info: Locations and zones. + :vartype location_info: list[~azure.mgmt.kusto.models.SkuLocationInfoItem] + :ivar restrictions: The restrictions because of which SKU cannot be used. + :vartype restrictions: list[object] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfoItem]'}, + 'restrictions': {'key': 'restrictions', 'type': '[object]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuDescription, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.tier = None + self.locations = None + self.location_info = None + self.restrictions = None + + +class SkuDescriptionList(msrest.serialization.Model): + """The list of the EngagementFabric SKU descriptions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: SKU descriptions. + :vartype value: list[~azure.mgmt.kusto.models.SkuDescription] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuDescription]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuDescriptionList, self).__init__(**kwargs) + self.value = None + + +class SkuLocationInfoItem(msrest.serialization.Model): + """The locations and zones info for SKU. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The available location of the SKU. + :type location: str + :param zones: The available zone of the SKU. + :type zones: list[str] + """ + + _validation = { + 'location': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuLocationInfoItem, self).__init__(**kwargs) + self.location = kwargs['location'] + self.zones = kwargs.get('zones', None) + + +class TrustedExternalTenant(msrest.serialization.Model): + """Represents a tenant ID that is trusted by the cluster. + + :param value: GUID representing an external tenant. + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrustedExternalTenant, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class VirtualNetworkConfiguration(msrest.serialization.Model): + """A class that contains virtual network definition. + + All required parameters must be populated in order to send to Azure. + + :param subnet_id: Required. The subnet resource id. + :type subnet_id: str + :param engine_public_ip_id: Required. Engine service's public IP address resource id. + :type engine_public_ip_id: str + :param data_management_public_ip_id: Required. Data management's service public IP address + resource id. + :type data_management_public_ip_id: str + """ + + _validation = { + 'subnet_id': {'required': True}, + 'engine_public_ip_id': {'required': True}, + 'data_management_public_ip_id': {'required': True}, + } + + _attribute_map = { + 'subnet_id': {'key': 'subnetId', 'type': 'str'}, + 'engine_public_ip_id': {'key': 'enginePublicIpId', 'type': 'str'}, + 'data_management_public_ip_id': {'key': 'dataManagementPublicIpId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VirtualNetworkConfiguration, self).__init__(**kwargs) + self.subnet_id = kwargs['subnet_id'] + self.engine_public_ip_id = kwargs['engine_public_ip_id'] + self.data_management_public_ip_id = kwargs['data_management_public_ip_id'] diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models_py3.py b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models_py3.py new file mode 100644 index 00000000000..c0114c710a3 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/models/_models_py3.py @@ -0,0 +1,2412 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +import msrest.serialization + + +class Resource(msrest.serialization.Model): + """Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +class AttachedDatabaseConfiguration(ProxyResource): + """Class representing an attached database configuration. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :param database_name: The name of the database which you would like to attach, use * if you + want to follow all current and future databases. + :type database_name: str + :param cluster_resource_id: The resource id of the cluster where the databases you would like + to attach reside. + :type cluster_resource_id: str + :ivar attached_database_names: The list of databases from the clusterResourceId which are + currently attached to the cluster. + :vartype attached_database_names: list[str] + :param default_principals_modification_kind: The default principals modification kind. Possible + values include: "Union", "Replace", "None". + :type default_principals_modification_kind: str or + ~azure.mgmt.kusto.models.DefaultPrincipalsModificationKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'attached_database_names': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'cluster_resource_id': {'key': 'properties.clusterResourceId', 'type': 'str'}, + 'attached_database_names': {'key': 'properties.attachedDatabaseNames', 'type': '[str]'}, + 'default_principals_modification_kind': {'key': 'properties.defaultPrincipalsModificationKind', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + database_name: Optional[str] = None, + cluster_resource_id: Optional[str] = None, + default_principals_modification_kind: Optional[Union[str, "DefaultPrincipalsModificationKind"]] = None, + **kwargs + ): + super(AttachedDatabaseConfiguration, self).__init__(**kwargs) + self.location = location + self.provisioning_state = None + self.database_name = database_name + self.cluster_resource_id = cluster_resource_id + self.attached_database_names = None + self.default_principals_modification_kind = default_principals_modification_kind + + +class AttachedDatabaseConfigurationListResult(msrest.serialization.Model): + """The list attached database configurations operation response. + + :param value: The list of attached database configurations. + :type value: list[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AttachedDatabaseConfiguration]'}, + } + + def __init__( + self, + *, + value: Optional[List["AttachedDatabaseConfiguration"]] = None, + **kwargs + ): + super(AttachedDatabaseConfigurationListResult, self).__init__(**kwargs) + self.value = value + + +class AzureCapacity(msrest.serialization.Model): + """Azure capacity definition. + + All required parameters must be populated in order to send to Azure. + + :param scale_type: Required. Scale type. Possible values include: "automatic", "manual", + "none". + :type scale_type: str or ~azure.mgmt.kusto.models.AzureScaleType + :param minimum: Required. Minimum allowed capacity. + :type minimum: int + :param maximum: Required. Maximum allowed capacity. + :type maximum: int + :param default: Required. The default capacity that would be used. + :type default: int + """ + + _validation = { + 'scale_type': {'required': True}, + 'minimum': {'required': True}, + 'maximum': {'required': True}, + 'default': {'required': True}, + } + + _attribute_map = { + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + } + + def __init__( + self, + *, + scale_type: Union[str, "AzureScaleType"], + minimum: int, + maximum: int, + default: int, + **kwargs + ): + super(AzureCapacity, self).__init__(**kwargs) + self.scale_type = scale_type + self.minimum = minimum + self.maximum = maximum + self.default = default + + +class AzureResourceSku(msrest.serialization.Model): + """Azure resource SKU definition. + + :param resource_type: Resource Namespace and Type. + :type resource_type: str + :param sku: The SKU details. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :param capacity: The number of instances of the cluster. + :type capacity: ~azure.mgmt.kusto.models.AzureCapacity + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AzureSku'}, + 'capacity': {'key': 'capacity', 'type': 'AzureCapacity'}, + } + + def __init__( + self, + *, + resource_type: Optional[str] = None, + sku: Optional["AzureSku"] = None, + capacity: Optional["AzureCapacity"] = None, + **kwargs + ): + super(AzureResourceSku, self).__init__(**kwargs) + self.resource_type = resource_type + self.sku = sku + self.capacity = capacity + + +class AzureSku(msrest.serialization.Model): + """Azure SKU definition. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. SKU name. Possible values include: "Standard_DS13_v2+1TB_PS", + "Standard_DS13_v2+2TB_PS", "Standard_DS14_v2+3TB_PS", "Standard_DS14_v2+4TB_PS", + "Standard_D13_v2", "Standard_D14_v2", "Standard_L8s", "Standard_L16s", "Standard_D11_v2", + "Standard_D12_v2", "Standard_L4s", "Dev(No SLA)_Standard_D11_v2", "Standard_E2a_v4", + "Standard_E4a_v4", "Standard_E8a_v4", "Standard_E16a_v4", "Standard_E8as_v4+1TB_PS", + "Standard_E8as_v4+2TB_PS", "Standard_E16as_v4+3TB_PS", "Standard_E16as_v4+4TB_PS", "Dev(No + SLA)_Standard_E2a_v4". + :type name: str or ~azure.mgmt.kusto.models.AzureSkuName + :param capacity: The number of instances of the cluster. + :type capacity: int + :param tier: Required. SKU tier. Possible values include: "Basic", "Standard". + :type tier: str or ~azure.mgmt.kusto.models.AzureSkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Union[str, "AzureSkuName"], + tier: Union[str, "AzureSkuTier"], + capacity: Optional[int] = None, + **kwargs + ): + super(AzureSku, self).__init__(**kwargs) + self.name = name + self.capacity = capacity + self.tier = tier + + +class CheckNameRequest(msrest.serialization.Model): + """The result returned from a database check name availability request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Resource name. + :type name: str + :param type: Required. The type of resource, for instance Microsoft.Kusto/clusters/databases. + Possible values include: "Microsoft.Kusto/clusters", "Microsoft.Kusto/clusters/databases", + "Microsoft.Kusto/clusters/attachedDatabaseConfigurations", + "Microsoft.Kusto/clusters/principalAssignments", + "Microsoft.Kusto/clusters/databases/dataConnections", + "Microsoft.Kusto/clusters/databases/principalAssignments". + :type type: str or ~azure.mgmt.kusto.models.Type + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "Type"], + **kwargs + ): + super(CheckNameRequest, self).__init__(**kwargs) + self.name = name + self.type = type + + +class CheckNameResult(msrest.serialization.Model): + """The result returned from a check name availability request. + + :param name_available: Specifies a Boolean value that indicates if the name is available. + :type name_available: bool + :param name: The name that was checked. + :type name: str + :param message: Message indicating an unavailable name due to a conflict, or a description of + the naming rules that are violated. + :type message: str + :param reason: Message providing the reason why the given name is invalid. Possible values + include: "Invalid", "AlreadyExists". + :type reason: str or ~azure.mgmt.kusto.models.Reason + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__( + self, + *, + name_available: Optional[bool] = None, + name: Optional[str] = None, + message: Optional[str] = None, + reason: Optional[Union[str, "Reason"]] = None, + **kwargs + ): + super(CheckNameResult, self).__init__(**kwargs) + self.name_available = name_available + self.name = name + self.message = message + self.reason = reason + + +class CloudErrorBody(msrest.serialization.Model): + """An error response from Kusto. + + :param code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable for displaying in a + user interface. + :type message: str + :param target: The target of the particular error. For example, the name of the property in + error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.kusto.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[List["CloudErrorBody"]] = None, + **kwargs + ): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class Cluster(TrackedResource): + """Class representing a Kusto cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :param sku: Required. The SKU of the cluster. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :param zones: The availability zones of the cluster. + :type zones: list[str] + :ivar state: The state of the resource. Possible values include: "Creating", "Unavailable", + "Running", "Deleting", "Deleted", "Stopping", "Stopped", "Starting", "Updating". + :vartype state: str or ~azure.mgmt.kusto.models.State + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :ivar uri: The cluster URI. + :vartype uri: str + :ivar data_ingestion_uri: The cluster data ingestion URI. + :vartype data_ingestion_uri: str + :ivar state_reason: The reason for the cluster's current state. + :vartype state_reason: str + :param trusted_external_tenants: The cluster's external tenants. + :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :param optimized_autoscale: Optimized auto scale definition. + :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are + encrypted. + :type enable_disk_encryption: bool + :param enable_streaming_ingest: A boolean value that indicates if the streaming ingest is + enabled. + :type enable_streaming_ingest: bool + :param virtual_network_configuration: Virtual network definition. + :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :param key_vault_properties: KeyVault properties for the cluster encryption. + :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :param enable_purge: A boolean value that indicates if the purge operations are enabled. + :type enable_purge: bool + :param value: The list of language extensions. + :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type_identity_type: The identity type. Possible values include: "None", + "SystemAssigned". + :type type_identity_type: str or ~azure.mgmt.kusto.models.IdentityType + :param user_assigned_identities: The list of user identities associated with the Kusto cluster. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.kusto.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'uri': {'readonly': True}, + 'data_ingestion_uri': {'readonly': True}, + 'state_reason': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AzureSku'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'data_ingestion_uri': {'key': 'properties.dataIngestionUri', 'type': 'str'}, + 'state_reason': {'key': 'properties.stateReason', 'type': 'str'}, + 'trusted_external_tenants': {'key': 'properties.trustedExternalTenants', 'type': '[TrustedExternalTenant]'}, + 'optimized_autoscale': {'key': 'properties.optimizedAutoscale', 'type': 'OptimizedAutoscale'}, + 'enable_disk_encryption': {'key': 'properties.enableDiskEncryption', 'type': 'bool'}, + 'enable_streaming_ingest': {'key': 'properties.enableStreamingIngest', 'type': 'bool'}, + 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'KeyVaultProperties'}, + 'enable_purge': {'key': 'properties.enablePurge', 'type': 'bool'}, + 'value': {'key': 'properties.languageExtensions.value', 'type': '[LanguageExtension]'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + *, + location: str, + sku: "AzureSku", + tags: Optional[Dict[str, str]] = None, + zones: Optional[List[str]] = None, + trusted_external_tenants: Optional[List["TrustedExternalTenant"]] = None, + optimized_autoscale: Optional["OptimizedAutoscale"] = None, + enable_disk_encryption: Optional[bool] = None, + enable_streaming_ingest: Optional[bool] = False, + virtual_network_configuration: Optional["VirtualNetworkConfiguration"] = None, + key_vault_properties: Optional["KeyVaultProperties"] = None, + enable_purge: Optional[bool] = False, + value: Optional[List["LanguageExtension"]] = None, + type_identity_type: Optional[Union[str, "IdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + **kwargs + ): + super(Cluster, self).__init__(tags=tags, location=location, **kwargs) + self.sku = sku + self.zones = zones + self.state = None + self.provisioning_state = None + self.uri = None + self.data_ingestion_uri = None + self.state_reason = None + self.trusted_external_tenants = trusted_external_tenants + self.optimized_autoscale = optimized_autoscale + self.enable_disk_encryption = enable_disk_encryption + self.enable_streaming_ingest = enable_streaming_ingest + self.virtual_network_configuration = virtual_network_configuration + self.key_vault_properties = key_vault_properties + self.enable_purge = enable_purge + self.value = value + self.principal_id = None + self.tenant_id = None + self.type_identity_type = type_identity_type + self.user_assigned_identities = user_assigned_identities + + +class ClusterCheckNameRequest(msrest.serialization.Model): + """The result returned from a cluster check name availability request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Cluster name. + :type name: str + :param type: Required. The type of resource, Microsoft.Kusto/clusters. Possible values include: + "Microsoft.Kusto/clusters", "Microsoft.Kusto/clusters/databases", + "Microsoft.Kusto/clusters/attachedDatabaseConfigurations", + "Microsoft.Kusto/clusters/principalAssignments", + "Microsoft.Kusto/clusters/databases/dataConnections", + "Microsoft.Kusto/clusters/databases/principalAssignments". + :type type: str or ~azure.mgmt.kusto.models.Type + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "Type"], + **kwargs + ): + super(ClusterCheckNameRequest, self).__init__(**kwargs) + self.name = name + self.type = type + + +class ClusterListResult(msrest.serialization.Model): + """The list Kusto clusters operation response. + + :param value: The list of Kusto clusters. + :type value: list[~azure.mgmt.kusto.models.Cluster] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Cluster]'}, + } + + def __init__( + self, + *, + value: Optional[List["Cluster"]] = None, + **kwargs + ): + super(ClusterListResult, self).__init__(**kwargs) + self.value = value + + +class ClusterPrincipalAssignment(ProxyResource): + """Class representing a cluster principal assignment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param principal_id: The principal ID assigned to the cluster principal. It can be a user + email, application ID, or security group name. + :type principal_id: str + :param role: Cluster principal role. Possible values include: "AllDatabasesAdmin", + "AllDatabasesViewer". + :type role: str or ~azure.mgmt.kusto.models.ClusterPrincipalRole + :param tenant_id: The tenant id of the principal. + :type tenant_id: str + :param principal_type: Principal type. Possible values include: "App", "Group", "User". + :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :ivar tenant_name: The tenant name of the principal. + :vartype tenant_name: str + :ivar principal_name: The principal name. + :vartype principal_name: str + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tenant_name': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'tenant_name': {'key': 'properties.tenantName', 'type': 'str'}, + 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + principal_id: Optional[str] = None, + role: Optional[Union[str, "ClusterPrincipalRole"]] = None, + tenant_id: Optional[str] = None, + principal_type: Optional[Union[str, "PrincipalType"]] = None, + **kwargs + ): + super(ClusterPrincipalAssignment, self).__init__(**kwargs) + self.principal_id = principal_id + self.role = role + self.tenant_id = tenant_id + self.principal_type = principal_type + self.tenant_name = None + self.principal_name = None + self.provisioning_state = None + + +class ClusterPrincipalAssignmentCheckNameRequest(msrest.serialization.Model): + """A principal assignment check name availability request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Principal Assignment resource name. + :type name: str + :param type: Required. The type of resource, Microsoft.Kusto/clusters/principalAssignments. + Possible values include: "Microsoft.Kusto/clusters", "Microsoft.Kusto/clusters/databases", + "Microsoft.Kusto/clusters/attachedDatabaseConfigurations", + "Microsoft.Kusto/clusters/principalAssignments", + "Microsoft.Kusto/clusters/databases/dataConnections", + "Microsoft.Kusto/clusters/databases/principalAssignments". + :type type: str or ~azure.mgmt.kusto.models.Type + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "Type"], + **kwargs + ): + super(ClusterPrincipalAssignmentCheckNameRequest, self).__init__(**kwargs) + self.name = name + self.type = type + + +class ClusterPrincipalAssignmentListResult(msrest.serialization.Model): + """The list Kusto cluster principal assignments operation response. + + :param value: The list of Kusto cluster principal assignments. + :type value: list[~azure.mgmt.kusto.models.ClusterPrincipalAssignment] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ClusterPrincipalAssignment]'}, + } + + def __init__( + self, + *, + value: Optional[List["ClusterPrincipalAssignment"]] = None, + **kwargs + ): + super(ClusterPrincipalAssignmentListResult, self).__init__(**kwargs) + self.value = value + + +class ClusterUpdate(Resource): + """Class representing an update to a Kusto cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Resource location. + :type location: str + :param sku: The SKU of the cluster. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :ivar state: The state of the resource. Possible values include: "Creating", "Unavailable", + "Running", "Deleting", "Deleted", "Stopping", "Stopped", "Starting", "Updating". + :vartype state: str or ~azure.mgmt.kusto.models.State + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :ivar uri: The cluster URI. + :vartype uri: str + :ivar data_ingestion_uri: The cluster data ingestion URI. + :vartype data_ingestion_uri: str + :ivar state_reason: The reason for the cluster's current state. + :vartype state_reason: str + :param trusted_external_tenants: The cluster's external tenants. + :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :param optimized_autoscale: Optimized auto scale definition. + :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are + encrypted. + :type enable_disk_encryption: bool + :param enable_streaming_ingest: A boolean value that indicates if the streaming ingest is + enabled. + :type enable_streaming_ingest: bool + :param virtual_network_configuration: Virtual network definition. + :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :param key_vault_properties: KeyVault properties for the cluster encryption. + :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :param enable_purge: A boolean value that indicates if the purge operations are enabled. + :type enable_purge: bool + :param value: The list of language extensions. + :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :param type_identity_type: The identity type. Possible values include: "None", + "SystemAssigned". + :type type_identity_type: str or ~azure.mgmt.kusto.models.IdentityType + :param user_assigned_identities: The list of user identities associated with the Kusto cluster. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, + ~azure.mgmt.kusto.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'uri': {'readonly': True}, + 'data_ingestion_uri': {'readonly': True}, + 'state_reason': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'AzureSku'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'data_ingestion_uri': {'key': 'properties.dataIngestionUri', 'type': 'str'}, + 'state_reason': {'key': 'properties.stateReason', 'type': 'str'}, + 'trusted_external_tenants': {'key': 'properties.trustedExternalTenants', 'type': '[TrustedExternalTenant]'}, + 'optimized_autoscale': {'key': 'properties.optimizedAutoscale', 'type': 'OptimizedAutoscale'}, + 'enable_disk_encryption': {'key': 'properties.enableDiskEncryption', 'type': 'bool'}, + 'enable_streaming_ingest': {'key': 'properties.enableStreamingIngest', 'type': 'bool'}, + 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'KeyVaultProperties'}, + 'enable_purge': {'key': 'properties.enablePurge', 'type': 'bool'}, + 'value': {'key': 'properties.languageExtensions.value', 'type': '[LanguageExtension]'}, + 'principal_id': {'key': 'identity.principalId', 'type': 'str'}, + 'tenant_id': {'key': 'identity.tenantId', 'type': 'str'}, + 'type_identity_type': {'key': 'identity.type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'identity.userAssignedIdentities', 'type': '{ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + location: Optional[str] = None, + sku: Optional["AzureSku"] = None, + trusted_external_tenants: Optional[List["TrustedExternalTenant"]] = None, + optimized_autoscale: Optional["OptimizedAutoscale"] = None, + enable_disk_encryption: Optional[bool] = None, + enable_streaming_ingest: Optional[bool] = False, + virtual_network_configuration: Optional["VirtualNetworkConfiguration"] = None, + key_vault_properties: Optional["KeyVaultProperties"] = None, + enable_purge: Optional[bool] = False, + value: Optional[List["LanguageExtension"]] = None, + type_identity_type: Optional[Union[str, "IdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] = None, + **kwargs + ): + super(ClusterUpdate, self).__init__(**kwargs) + self.tags = tags + self.location = location + self.sku = sku + self.state = None + self.provisioning_state = None + self.uri = None + self.data_ingestion_uri = None + self.state_reason = None + self.trusted_external_tenants = trusted_external_tenants + self.optimized_autoscale = optimized_autoscale + self.enable_disk_encryption = enable_disk_encryption + self.enable_streaming_ingest = enable_streaming_ingest + self.virtual_network_configuration = virtual_network_configuration + self.key_vault_properties = key_vault_properties + self.enable_purge = enable_purge + self.value = value + self.principal_id = None + self.tenant_id = None + self.type_identity_type = type_identity_type + self.user_assigned_identities = user_assigned_identities + + +class ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class Database(ProxyResource): + """Class representing a Kusto database. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ReadOnlyFollowingDatabase, ReadWriteDatabase. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Kind of the database.Constant filled by server. Possible values + include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". + :type kind: str or ~azure.mgmt.kusto.models.Kind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'ReadOnlyFollowing': 'ReadOnlyFollowingDatabase', 'ReadWrite': 'ReadWriteDatabase'} + } + + def __init__( + self, + *, + location: Optional[str] = None, + **kwargs + ): + super(Database, self).__init__(**kwargs) + self.location = location + self.kind = 'Database' + + +class DatabaseListResult(msrest.serialization.Model): + """The list Kusto databases operation response. + + :param value: The list of Kusto databases. + :type value: list[~azure.mgmt.kusto.models.Database] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Database]'}, + } + + def __init__( + self, + *, + value: Optional[List["Database"]] = None, + **kwargs + ): + super(DatabaseListResult, self).__init__(**kwargs) + self.value = value + + +class DatabasePrincipal(msrest.serialization.Model): + """A class representing database principal entity. + + 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 role: Required. Database principal role. Possible values include: "Admin", "Ingestor", + "Monitor", "User", "UnrestrictedViewers", "Viewer". + :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :param name: Required. Database principal name. + :type name: str + :param type: Required. Database principal type. Possible values include: "App", "Group", + "User". + :type type: str or ~azure.mgmt.kusto.models.DatabasePrincipalType + :param fqn: Database principal fully qualified name. + :type fqn: str + :param email: Database principal email if exists. + :type email: str + :param app_id: Application id - relevant only for application principal type. + :type app_id: str + :ivar tenant_name: The tenant name of the principal. + :vartype tenant_name: str + """ + + _validation = { + 'role': {'required': True}, + 'name': {'required': True}, + 'type': {'required': True}, + 'tenant_name': {'readonly': True}, + } + + _attribute_map = { + 'role': {'key': 'role', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'fqn': {'key': 'fqn', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + 'app_id': {'key': 'appId', 'type': 'str'}, + 'tenant_name': {'key': 'tenantName', 'type': 'str'}, + } + + def __init__( + self, + *, + role: Union[str, "DatabasePrincipalRole"], + name: str, + type: Union[str, "DatabasePrincipalType"], + fqn: Optional[str] = None, + email: Optional[str] = None, + app_id: Optional[str] = None, + **kwargs + ): + super(DatabasePrincipal, self).__init__(**kwargs) + self.role = role + self.name = name + self.type = type + self.fqn = fqn + self.email = email + self.app_id = app_id + self.tenant_name = None + + +class DatabasePrincipalAssignment(ProxyResource): + """Class representing a database principal assignment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param principal_id: The principal ID assigned to the database principal. It can be a user + email, application ID, or security group name. + :type principal_id: str + :param role: Database principal role. Possible values include: "Admin", "Ingestor", "Monitor", + "User", "UnrestrictedViewers", "Viewer". + :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :param tenant_id: The tenant id of the principal. + :type tenant_id: str + :param principal_type: Principal type. Possible values include: "App", "Group", "User". + :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :ivar tenant_name: The tenant name of the principal. + :vartype tenant_name: str + :ivar principal_name: The principal name. + :vartype principal_name: str + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tenant_name': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'tenant_id': {'key': 'properties.tenantId', 'type': 'str'}, + 'principal_type': {'key': 'properties.principalType', 'type': 'str'}, + 'tenant_name': {'key': 'properties.tenantName', 'type': 'str'}, + 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + principal_id: Optional[str] = None, + role: Optional[Union[str, "DatabasePrincipalRole"]] = None, + tenant_id: Optional[str] = None, + principal_type: Optional[Union[str, "PrincipalType"]] = None, + **kwargs + ): + super(DatabasePrincipalAssignment, self).__init__(**kwargs) + self.principal_id = principal_id + self.role = role + self.tenant_id = tenant_id + self.principal_type = principal_type + self.tenant_name = None + self.principal_name = None + self.provisioning_state = None + + +class DatabasePrincipalAssignmentCheckNameRequest(msrest.serialization.Model): + """A principal assignment check name availability request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Principal Assignment resource name. + :type name: str + :param type: Required. The type of resource, + Microsoft.Kusto/clusters/databases/principalAssignments. Possible values include: + "Microsoft.Kusto/clusters", "Microsoft.Kusto/clusters/databases", + "Microsoft.Kusto/clusters/attachedDatabaseConfigurations", + "Microsoft.Kusto/clusters/principalAssignments", + "Microsoft.Kusto/clusters/databases/dataConnections", + "Microsoft.Kusto/clusters/databases/principalAssignments". + :type type: str or ~azure.mgmt.kusto.models.Type + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "Type"], + **kwargs + ): + super(DatabasePrincipalAssignmentCheckNameRequest, self).__init__(**kwargs) + self.name = name + self.type = type + + +class DatabasePrincipalAssignmentListResult(msrest.serialization.Model): + """The list Kusto database principal assignments operation response. + + :param value: The list of Kusto database principal assignments. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipalAssignment] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DatabasePrincipalAssignment]'}, + } + + def __init__( + self, + *, + value: Optional[List["DatabasePrincipalAssignment"]] = None, + **kwargs + ): + super(DatabasePrincipalAssignmentListResult, self).__init__(**kwargs) + self.value = value + + +class DatabasePrincipalListRequest(msrest.serialization.Model): + """The list Kusto database principals operation request. + + :param value: The list of Kusto database principals. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DatabasePrincipal]'}, + } + + def __init__( + self, + *, + value: Optional[List["DatabasePrincipal"]] = None, + **kwargs + ): + super(DatabasePrincipalListRequest, self).__init__(**kwargs) + self.value = value + + +class DatabasePrincipalListResult(msrest.serialization.Model): + """The list Kusto database principals operation response. + + :param value: The list of Kusto database principals. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DatabasePrincipal]'}, + } + + def __init__( + self, + *, + value: Optional[List["DatabasePrincipal"]] = None, + **kwargs + ): + super(DatabasePrincipalListResult, self).__init__(**kwargs) + self.value = value + + +class DatabaseStatistics(msrest.serialization.Model): + """A class that contains database statistics information. + + :param size: The database size - the total size of compressed data and index in bytes. + :type size: float + """ + + _attribute_map = { + 'size': {'key': 'size', 'type': 'float'}, + } + + def __init__( + self, + *, + size: Optional[float] = None, + **kwargs + ): + super(DatabaseStatistics, self).__init__(**kwargs) + self.size = size + + +class DataConnection(ProxyResource): + """Class representing an data connection. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EventGridDataConnection, EventHubDataConnection, IotHubDataConnection. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. + Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". + :type kind: str or ~azure.mgmt.kusto.models.Kind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'EventGrid': 'EventGridDataConnection', 'EventHub': 'EventHubDataConnection', 'IotHub': 'IotHubDataConnection'} + } + + def __init__( + self, + *, + location: Optional[str] = None, + **kwargs + ): + super(DataConnection, self).__init__(**kwargs) + self.location = location + self.kind = 'DataConnection' + + +class DataConnectionCheckNameRequest(msrest.serialization.Model): + """A data connection check name availability request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Data Connection name. + :type name: str + :param type: Required. The type of resource, + Microsoft.Kusto/clusters/databases/dataConnections. Possible values include: + "Microsoft.Kusto/clusters", "Microsoft.Kusto/clusters/databases", + "Microsoft.Kusto/clusters/attachedDatabaseConfigurations", + "Microsoft.Kusto/clusters/principalAssignments", + "Microsoft.Kusto/clusters/databases/dataConnections", + "Microsoft.Kusto/clusters/databases/principalAssignments". + :type type: str or ~azure.mgmt.kusto.models.Type + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "Type"], + **kwargs + ): + super(DataConnectionCheckNameRequest, self).__init__(**kwargs) + self.name = name + self.type = type + + +class DataConnectionListResult(msrest.serialization.Model): + """The list Kusto data connections operation response. + + :param value: The list of Kusto data connections. + :type value: list[~azure.mgmt.kusto.models.DataConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataConnection]'}, + } + + def __init__( + self, + *, + value: Optional[List["DataConnection"]] = None, + **kwargs + ): + super(DataConnectionListResult, self).__init__(**kwargs) + self.value = value + + +class DataConnectionValidation(msrest.serialization.Model): + """Class representing an data connection validation. + + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param properties: The data connection properties to validate. + :type properties: ~azure.mgmt.kusto.models.DataConnection + """ + + _attribute_map = { + 'data_connection_name': {'key': 'dataConnectionName', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DataConnection'}, + } + + def __init__( + self, + *, + data_connection_name: Optional[str] = None, + properties: Optional["DataConnection"] = None, + **kwargs + ): + super(DataConnectionValidation, self).__init__(**kwargs) + self.data_connection_name = data_connection_name + self.properties = properties + + +class DataConnectionValidationListResult(msrest.serialization.Model): + """The list Kusto data connection validation result. + + :param value: The list of Kusto data connection validation errors. + :type value: list[~azure.mgmt.kusto.models.DataConnectionValidationResult] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataConnectionValidationResult]'}, + } + + def __init__( + self, + *, + value: Optional[List["DataConnectionValidationResult"]] = None, + **kwargs + ): + super(DataConnectionValidationListResult, self).__init__(**kwargs) + self.value = value + + +class DataConnectionValidationResult(msrest.serialization.Model): + """The result returned from a data connection validation request. + + :param error_message: A message which indicates a problem in data connection validation. + :type error_message: str + """ + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__( + self, + *, + error_message: Optional[str] = None, + **kwargs + ): + super(DataConnectionValidationResult, self).__init__(**kwargs) + self.error_message = error_message + + +class DiagnoseVirtualNetworkResult(msrest.serialization.Model): + """DiagnoseVirtualNetworkResult. + + :param findings: The list of network connectivity diagnostic finding. + :type findings: list[str] + """ + + _attribute_map = { + 'findings': {'key': 'findings', 'type': '[str]'}, + } + + def __init__( + self, + *, + findings: Optional[List[str]] = None, + **kwargs + ): + super(DiagnoseVirtualNetworkResult, self).__init__(**kwargs) + self.findings = findings + + +class EventGridDataConnection(DataConnection): + """Class representing an Event Grid data connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. + Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". + :type kind: str or ~azure.mgmt.kusto.models.Kind + :param storage_account_resource_id: The resource ID of the storage account where the data + resides. + :type storage_account_resource_id: str + :param event_hub_resource_id: The resource ID where the event grid is configured to send + events. + :type event_hub_resource_id: str + :param consumer_group: The event hub consumer group. + :type consumer_group: str + :param table_name: The table where the data should be ingested. Optionally the table + information can be added to each message. + :type table_name: str + :param mapping_rule_name: The mapping rule to be used to ingest the data. Optionally the + mapping information can be added to each message. + :type mapping_rule_name: str + :param data_format: The data format of the message. Optionally the data format can be added to + each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", + "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC". + :type data_format: str or ~azure.mgmt.kusto.models.EventGridDataFormat + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'storage_account_resource_id': {'key': 'properties.storageAccountResourceId', 'type': 'str'}, + 'event_hub_resource_id': {'key': 'properties.eventHubResourceId', 'type': 'str'}, + 'consumer_group': {'key': 'properties.consumerGroup', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + 'mapping_rule_name': {'key': 'properties.mappingRuleName', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + storage_account_resource_id: Optional[str] = None, + event_hub_resource_id: Optional[str] = None, + consumer_group: Optional[str] = None, + table_name: Optional[str] = None, + mapping_rule_name: Optional[str] = None, + data_format: Optional[Union[str, "EventGridDataFormat"]] = None, + **kwargs + ): + super(EventGridDataConnection, self).__init__(location=location, **kwargs) + self.kind = 'EventGrid' + self.storage_account_resource_id = storage_account_resource_id + self.event_hub_resource_id = event_hub_resource_id + self.consumer_group = consumer_group + self.table_name = table_name + self.mapping_rule_name = mapping_rule_name + self.data_format = data_format + + +class EventHubDataConnection(DataConnection): + """Class representing an event hub data connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. + Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". + :type kind: str or ~azure.mgmt.kusto.models.Kind + :param event_hub_resource_id: The resource ID of the event hub to be used to create a data + connection. + :type event_hub_resource_id: str + :param consumer_group: The event hub consumer group. + :type consumer_group: str + :param table_name: The table where the data should be ingested. Optionally the table + information can be added to each message. + :type table_name: str + :param mapping_rule_name: The mapping rule to be used to ingest the data. Optionally the + mapping information can be added to each message. + :type mapping_rule_name: str + :param data_format: The data format of the message. Optionally the data format can be added to + each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", + "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC". + :type data_format: str or ~azure.mgmt.kusto.models.EventHubDataFormat + :param event_system_properties: System properties of the event hub. + :type event_system_properties: list[str] + :param compression: The event hub messages compression type. Possible values include: "None", + "GZip". + :type compression: str or ~azure.mgmt.kusto.models.Compression + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'event_hub_resource_id': {'key': 'properties.eventHubResourceId', 'type': 'str'}, + 'consumer_group': {'key': 'properties.consumerGroup', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + 'mapping_rule_name': {'key': 'properties.mappingRuleName', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'event_system_properties': {'key': 'properties.eventSystemProperties', 'type': '[str]'}, + 'compression': {'key': 'properties.compression', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + event_hub_resource_id: Optional[str] = None, + consumer_group: Optional[str] = None, + table_name: Optional[str] = None, + mapping_rule_name: Optional[str] = None, + data_format: Optional[Union[str, "EventHubDataFormat"]] = None, + event_system_properties: Optional[List[str]] = None, + compression: Optional[Union[str, "Compression"]] = None, + **kwargs + ): + super(EventHubDataConnection, self).__init__(location=location, **kwargs) + self.kind = 'EventHub' + self.event_hub_resource_id = event_hub_resource_id + self.consumer_group = consumer_group + self.table_name = table_name + self.mapping_rule_name = mapping_rule_name + self.data_format = data_format + self.event_system_properties = event_system_properties + self.compression = compression + + +class FollowerDatabaseDefinition(msrest.serialization.Model): + """A class representing follower database request. + + 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 cluster_resource_id: Required. Resource id of the cluster that follows a database owned + by this cluster. + :type cluster_resource_id: str + :param attached_database_configuration_name: Required. Resource name of the attached database + configuration in the follower cluster. + :type attached_database_configuration_name: str + :ivar database_name: The database name owned by this cluster that was followed. * in case + following all databases. + :vartype database_name: str + """ + + _validation = { + 'cluster_resource_id': {'required': True}, + 'attached_database_configuration_name': {'required': True}, + 'database_name': {'readonly': True}, + } + + _attribute_map = { + 'cluster_resource_id': {'key': 'clusterResourceId', 'type': 'str'}, + 'attached_database_configuration_name': {'key': 'attachedDatabaseConfigurationName', 'type': 'str'}, + 'database_name': {'key': 'databaseName', 'type': 'str'}, + } + + def __init__( + self, + *, + cluster_resource_id: str, + attached_database_configuration_name: str, + **kwargs + ): + super(FollowerDatabaseDefinition, self).__init__(**kwargs) + self.cluster_resource_id = cluster_resource_id + self.attached_database_configuration_name = attached_database_configuration_name + self.database_name = None + + +class FollowerDatabaseListResult(msrest.serialization.Model): + """The list Kusto database principals operation response. + + :param value: The list of follower database result. + :type value: list[~azure.mgmt.kusto.models.FollowerDatabaseDefinition] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FollowerDatabaseDefinition]'}, + } + + def __init__( + self, + *, + value: Optional[List["FollowerDatabaseDefinition"]] = None, + **kwargs + ): + super(FollowerDatabaseListResult, self).__init__(**kwargs) + self.value = value + + +class IotHubDataConnection(DataConnection): + """Class representing an iot hub data connection. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Kind of the endpoint for the data connection.Constant filled by server. + Possible values include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". + :type kind: str or ~azure.mgmt.kusto.models.Kind + :param iot_hub_resource_id: The resource ID of the Iot hub to be used to create a data + connection. + :type iot_hub_resource_id: str + :param consumer_group: The iot hub consumer group. + :type consumer_group: str + :param table_name: The table where the data should be ingested. Optionally the table + information can be added to each message. + :type table_name: str + :param mapping_rule_name: The mapping rule to be used to ingest the data. Optionally the + mapping information can be added to each message. + :type mapping_rule_name: str + :param data_format: The data format of the message. Optionally the data format can be added to + each message. Possible values include: "MULTIJSON", "JSON", "CSV", "TSV", "SCSV", "SOHSV", + "PSV", "TXT", "RAW", "SINGLEJSON", "AVRO", "TSVE", "PARQUET", "ORC". + :type data_format: str or ~azure.mgmt.kusto.models.IotHubDataFormat + :param event_system_properties: System properties of the iot hub. + :type event_system_properties: list[str] + :param shared_access_policy_name: The name of the share access policy. + :type shared_access_policy_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'iot_hub_resource_id': {'key': 'properties.iotHubResourceId', 'type': 'str'}, + 'consumer_group': {'key': 'properties.consumerGroup', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + 'mapping_rule_name': {'key': 'properties.mappingRuleName', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'event_system_properties': {'key': 'properties.eventSystemProperties', 'type': '[str]'}, + 'shared_access_policy_name': {'key': 'properties.sharedAccessPolicyName', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + iot_hub_resource_id: Optional[str] = None, + consumer_group: Optional[str] = None, + table_name: Optional[str] = None, + mapping_rule_name: Optional[str] = None, + data_format: Optional[Union[str, "IotHubDataFormat"]] = None, + event_system_properties: Optional[List[str]] = None, + shared_access_policy_name: Optional[str] = None, + **kwargs + ): + super(IotHubDataConnection, self).__init__(location=location, **kwargs) + self.kind = 'IotHub' + self.iot_hub_resource_id = iot_hub_resource_id + self.consumer_group = consumer_group + self.table_name = table_name + self.mapping_rule_name = mapping_rule_name + self.data_format = data_format + self.event_system_properties = event_system_properties + self.shared_access_policy_name = shared_access_policy_name + + +class KeyVaultProperties(msrest.serialization.Model): + """Properties of the key vault. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of the key vault key. + :type key_name: str + :param key_version: Required. The version of the key vault key. + :type key_version: str + :param key_vault_uri: Required. The Uri of the key vault. + :type key_vault_uri: str + """ + + _validation = { + 'key_name': {'required': True}, + 'key_version': {'required': True}, + 'key_vault_uri': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_version': {'key': 'keyVersion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, + } + + def __init__( + self, + *, + key_name: str, + key_version: str, + key_vault_uri: str, + **kwargs + ): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri + + +class LanguageExtension(msrest.serialization.Model): + """The language extension object. + + :param language_extension_name: The language extension name. Possible values include: "PYTHON", + "R". + :type language_extension_name: str or ~azure.mgmt.kusto.models.LanguageExtensionName + """ + + _attribute_map = { + 'language_extension_name': {'key': 'languageExtensionName', 'type': 'str'}, + } + + def __init__( + self, + *, + language_extension_name: Optional[Union[str, "LanguageExtensionName"]] = None, + **kwargs + ): + super(LanguageExtension, self).__init__(**kwargs) + self.language_extension_name = language_extension_name + + +class LanguageExtensionsList(msrest.serialization.Model): + """The list of language extension objects. + + :param value: The list of language extensions. + :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LanguageExtension]'}, + } + + def __init__( + self, + *, + value: Optional[List["LanguageExtension"]] = None, + **kwargs + ): + super(LanguageExtensionsList, self).__init__(**kwargs) + self.value = value + + +class ListResourceSkusResult(msrest.serialization.Model): + """List of available SKUs for a Kusto Cluster. + + :param value: The collection of available SKUs for an existing resource. + :type value: list[~azure.mgmt.kusto.models.AzureResourceSku] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AzureResourceSku]'}, + } + + def __init__( + self, + *, + value: Optional[List["AzureResourceSku"]] = None, + **kwargs + ): + super(ListResourceSkusResult, self).__init__(**kwargs) + self.value = value + + +class Operation(msrest.serialization.Model): + """A REST API operation. + + :param name: This is of the format {provider}/{resource}/{operation}. + :type name: str + :param display: The object that describes the operation. + :type display: ~azure.mgmt.kusto.models.OperationDisplay + :param origin: The intended executor of the operation. + :type origin: str + :param properties: Any object. + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + origin: Optional[str] = None, + properties: Optional[object] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.properties = properties + + +class OperationDisplay(msrest.serialization.Model): + """The object that describes the operation. + + :param provider: Friendly name of the resource provider. + :type provider: str + :param operation: For example: read, write, delete. + :type operation: str + :param resource: The resource type on which the operation is performed. + :type resource: str + :param description: The friendly name of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + operation: Optional[str] = None, + resource: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.operation = operation + self.resource = resource + self.description = description + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next set of results. + + :param value: The list of operations supported by the resource provider. + :type value: list[~azure.mgmt.kusto.models.Operation] + :param next_link: The URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Operation"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class OptimizedAutoscale(msrest.serialization.Model): + """A class that contains the optimized auto scale definition. + + All required parameters must be populated in order to send to Azure. + + :param version: Required. The version of the template defined, for instance 1. + :type version: int + :param is_enabled: Required. A boolean value that indicate if the optimized autoscale feature + is enabled or not. + :type is_enabled: bool + :param minimum: Required. Minimum allowed instances count. + :type minimum: int + :param maximum: Required. Maximum allowed instances count. + :type maximum: int + """ + + _validation = { + 'version': {'required': True}, + 'is_enabled': {'required': True}, + 'minimum': {'required': True}, + 'maximum': {'required': True}, + } + + _attribute_map = { + 'version': {'key': 'version', 'type': 'int'}, + 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + } + + def __init__( + self, + *, + version: int, + is_enabled: bool, + minimum: int, + maximum: int, + **kwargs + ): + super(OptimizedAutoscale, self).__init__(**kwargs) + self.version = version + self.is_enabled = is_enabled + self.minimum = minimum + self.maximum = maximum + + +class ReadOnlyFollowingDatabase(Database): + """Class representing a read only following database. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Kind of the database.Constant filled by server. Possible values + include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". + :type kind: str or ~azure.mgmt.kusto.models.Kind + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :ivar soft_delete_period: The time the data should be kept before it stops being accessible to + queries in TimeSpan. + :vartype soft_delete_period: ~datetime.timedelta + :param hot_cache_period: The time the data should be kept in cache for fast queries in + TimeSpan. + :type hot_cache_period: ~datetime.timedelta + :ivar statistics: The statistics of the database. + :vartype statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + :ivar leader_cluster_resource_id: The name of the leader cluster. + :vartype leader_cluster_resource_id: str + :ivar attached_database_configuration_name: The name of the attached database configuration + cluster. + :vartype attached_database_configuration_name: str + :ivar principals_modification_kind: The principals modification kind of the database. Possible + values include: "Union", "Replace", "None". + :vartype principals_modification_kind: str or + ~azure.mgmt.kusto.models.PrincipalsModificationKind + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'soft_delete_period': {'readonly': True}, + 'statistics': {'readonly': True}, + 'leader_cluster_resource_id': {'readonly': True}, + 'attached_database_configuration_name': {'readonly': True}, + 'principals_modification_kind': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, + 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, + 'leader_cluster_resource_id': {'key': 'properties.leaderClusterResourceId', 'type': 'str'}, + 'attached_database_configuration_name': {'key': 'properties.attachedDatabaseConfigurationName', 'type': 'str'}, + 'principals_modification_kind': {'key': 'properties.principalsModificationKind', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + hot_cache_period: Optional[datetime.timedelta] = None, + **kwargs + ): + super(ReadOnlyFollowingDatabase, self).__init__(location=location, **kwargs) + self.kind = 'ReadOnlyFollowing' + self.provisioning_state = None + self.soft_delete_period = None + self.hot_cache_period = hot_cache_period + self.statistics = None + self.leader_cluster_resource_id = None + self.attached_database_configuration_name = None + self.principals_modification_kind = None + + +class ReadWriteDatabase(Database): + """Class representing a read write database. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. Ex- Microsoft.Compute/virtualMachines or + Microsoft.Storage/storageAccounts. + :vartype type: str + :param location: Resource location. + :type location: str + :param kind: Required. Kind of the database.Constant filled by server. Possible values + include: "ReadWrite", "ReadOnlyFollowing", "EventHub", "EventGrid", "IotHub". + :type kind: str or ~azure.mgmt.kusto.models.Kind + :ivar provisioning_state: The provisioned state of the resource. Possible values include: + "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving". + :vartype provisioning_state: str or ~azure.mgmt.kusto.models.ProvisioningState + :param soft_delete_period: The time the data should be kept before it stops being accessible to + queries in TimeSpan. + :type soft_delete_period: ~datetime.timedelta + :param hot_cache_period: The time the data should be kept in cache for fast queries in + TimeSpan. + :type hot_cache_period: ~datetime.timedelta + :ivar statistics: The statistics of the database. + :vartype statistics: ~azure.mgmt.kusto.models.DatabaseStatistics + :ivar is_followed: Indicates whether the database is followed. + :vartype is_followed: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'statistics': {'readonly': True}, + 'is_followed': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'soft_delete_period': {'key': 'properties.softDeletePeriod', 'type': 'duration'}, + 'hot_cache_period': {'key': 'properties.hotCachePeriod', 'type': 'duration'}, + 'statistics': {'key': 'properties.statistics', 'type': 'DatabaseStatistics'}, + 'is_followed': {'key': 'properties.isFollowed', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + soft_delete_period: Optional[datetime.timedelta] = None, + hot_cache_period: Optional[datetime.timedelta] = None, + **kwargs + ): + super(ReadWriteDatabase, self).__init__(location=location, **kwargs) + self.kind = 'ReadWrite' + self.provisioning_state = None + self.soft_delete_period = soft_delete_period + self.hot_cache_period = hot_cache_period + self.statistics = None + self.is_followed = None + + +class SkuDescription(msrest.serialization.Model): + """The Kusto SKU description of given resource type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The resource type. + :vartype resource_type: str + :ivar name: The name of the SKU. + :vartype name: str + :ivar tier: The tier of the SKU. + :vartype tier: str + :ivar locations: The set of locations that the SKU is available. + :vartype locations: list[str] + :ivar location_info: Locations and zones. + :vartype location_info: list[~azure.mgmt.kusto.models.SkuLocationInfoItem] + :ivar restrictions: The restrictions because of which SKU cannot be used. + :vartype restrictions: list[object] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfoItem]'}, + 'restrictions': {'key': 'restrictions', 'type': '[object]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuDescription, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.tier = None + self.locations = None + self.location_info = None + self.restrictions = None + + +class SkuDescriptionList(msrest.serialization.Model): + """The list of the EngagementFabric SKU descriptions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: SKU descriptions. + :vartype value: list[~azure.mgmt.kusto.models.SkuDescription] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SkuDescription]'}, + } + + def __init__( + self, + **kwargs + ): + super(SkuDescriptionList, self).__init__(**kwargs) + self.value = None + + +class SkuLocationInfoItem(msrest.serialization.Model): + """The locations and zones info for SKU. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The available location of the SKU. + :type location: str + :param zones: The available zone of the SKU. + :type zones: list[str] + """ + + _validation = { + 'location': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__( + self, + *, + location: str, + zones: Optional[List[str]] = None, + **kwargs + ): + super(SkuLocationInfoItem, self).__init__(**kwargs) + self.location = location + self.zones = zones + + +class TrustedExternalTenant(msrest.serialization.Model): + """Represents a tenant ID that is trusted by the cluster. + + :param value: GUID representing an external tenant. + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[str] = None, + **kwargs + ): + super(TrustedExternalTenant, self).__init__(**kwargs) + self.value = value + + +class VirtualNetworkConfiguration(msrest.serialization.Model): + """A class that contains virtual network definition. + + All required parameters must be populated in order to send to Azure. + + :param subnet_id: Required. The subnet resource id. + :type subnet_id: str + :param engine_public_ip_id: Required. Engine service's public IP address resource id. + :type engine_public_ip_id: str + :param data_management_public_ip_id: Required. Data management's service public IP address + resource id. + :type data_management_public_ip_id: str + """ + + _validation = { + 'subnet_id': {'required': True}, + 'engine_public_ip_id': {'required': True}, + 'data_management_public_ip_id': {'required': True}, + } + + _attribute_map = { + 'subnet_id': {'key': 'subnetId', 'type': 'str'}, + 'engine_public_ip_id': {'key': 'enginePublicIpId', 'type': 'str'}, + 'data_management_public_ip_id': {'key': 'dataManagementPublicIpId', 'type': 'str'}, + } + + def __init__( + self, + *, + subnet_id: str, + engine_public_ip_id: str, + data_management_public_ip_id: str, + **kwargs + ): + super(VirtualNetworkConfiguration, self).__init__(**kwargs) + self.subnet_id = subnet_id + self.engine_public_ip_id = engine_public_ip_id + self.data_management_public_ip_id = data_management_public_ip_id diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/__init__.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/__init__.py new file mode 100644 index 00000000000..5750cdc82c5 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/__init__.py @@ -0,0 +1,25 @@ +# 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 ._cluster_operations import ClusterOperations +from ._cluster_principal_assignment_operations import ClusterPrincipalAssignmentOperations +from ._database_operations import DatabaseOperations +from ._database_principal_assignment_operations import DatabasePrincipalAssignmentOperations +from ._attached_database_configuration_operations import AttachedDatabaseConfigurationOperations +from ._data_connection_operations import DataConnectionOperations +from ._operation_operations import OperationOperations + +__all__ = [ + 'ClusterOperations', + 'ClusterPrincipalAssignmentOperations', + 'DatabaseOperations', + 'DatabasePrincipalAssignmentOperations', + 'AttachedDatabaseConfigurationOperations', + 'DataConnectionOperations', + 'OperationOperations', +] diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_attached_database_configuration_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_attached_database_configuration_operations.py new file mode 100644 index 00000000000..b3d7d5b634b --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_attached_database_configuration_operations.py @@ -0,0 +1,408 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class AttachedDatabaseConfigurationOperations(object): + """AttachedDatabaseConfigurationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_cluster( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AttachedDatabaseConfigurationListResult" + """Returns the list of attached database configurations of the given Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AttachedDatabaseConfigurationListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.AttachedDatabaseConfigurationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfigurationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_cluster.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AttachedDatabaseConfigurationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations'} + + def get( + self, + resource_group_name, # type: str + cluster_name, # type: str + attached_database_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AttachedDatabaseConfiguration" + """Returns an attached database configuration. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param attached_database_configuration_name: The name of the attached database configuration. + :type attached_database_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AttachedDatabaseConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.AttachedDatabaseConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'attachedDatabaseConfigurationName': self._serialize.url("attached_database_configuration_name", attached_database_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + + def _create_or_update_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + attached_database_configuration_name, # type: str + location=None, # type: Optional[str] + database_name=None, # type: Optional[str] + cluster_resource_id=None, # type: Optional[str] + default_principals_modification_kind=None, # type: Optional[Union[str, "models.DefaultPrincipalsModificationKind"]] + **kwargs # type: Any + ): + # type: (...) -> "models.AttachedDatabaseConfiguration" + cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.AttachedDatabaseConfiguration(location=location, database_name=database_name, cluster_resource_id=cluster_resource_id, default_principals_modification_kind=default_principals_modification_kind) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'attachedDatabaseConfigurationName': self._serialize.url("attached_database_configuration_name", attached_database_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'AttachedDatabaseConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + + def begin_create_or_update( + self, + resource_group_name, # type: str + cluster_name, # type: str + attached_database_configuration_name, # type: str + location=None, # type: Optional[str] + database_name=None, # type: Optional[str] + cluster_resource_id=None, # type: Optional[str] + default_principals_modification_kind=None, # type: Optional[Union[str, "models.DefaultPrincipalsModificationKind"]] + **kwargs # type: Any + ): + # type: (...) -> "models.AttachedDatabaseConfiguration" + """Creates or updates an attached database configuration. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param attached_database_configuration_name: The name of the attached database configuration. + :type attached_database_configuration_name: str + :param location: Resource location. + :type location: str + :param database_name: The name of the database which you would like to attach, use * if you + want to follow all current and future databases. + :type database_name: str + :param cluster_resource_id: The resource id of the cluster where the databases you would like + to attach reside. + :type cluster_resource_id: str + :param default_principals_modification_kind: The default principals modification kind. + :type default_principals_modification_kind: str or ~azure.mgmt.kusto.models.DefaultPrincipalsModificationKind + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns AttachedDatabaseConfiguration + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.AttachedDatabaseConfiguration] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.AttachedDatabaseConfiguration"] + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + location=location, + database_name=database_name, + cluster_resource_id=cluster_resource_id, + default_principals_modification_kind=default_principals_modification_kind, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('AttachedDatabaseConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + attached_database_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._delete_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'attachedDatabaseConfigurationName': self._serialize.url("attached_database_configuration_name", attached_database_configuration_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} + + def begin_delete( + self, + resource_group_name, # type: str + cluster_name, # type: str + attached_database_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the attached database configuration with the given name. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param attached_database_configuration_name: The name of the attached database configuration. + :type attached_database_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + attached_database_configuration_name=attached_database_configuration_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/attachedDatabaseConfigurations/{attachedDatabaseConfigurationName}'} diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_operations.py new file mode 100644 index 00000000000..c3f93184c5c --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_operations.py @@ -0,0 +1,1591 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ClusterOperations(object): + """ClusterOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Cluster" + """Gets a Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Cluster or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.Cluster + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + def _create_or_update_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + location, # type: str + sku, # type: "models.AzureSku" + tags=None, # type: Optional[Dict[str, str]] + zones=None, # type: Optional[List[str]] + trusted_external_tenants=None, # type: Optional[List["TrustedExternalTenant"]] + optimized_autoscale=None, # type: Optional["models.OptimizedAutoscale"] + enable_disk_encryption=None, # type: Optional[bool] + enable_streaming_ingest=False, # type: Optional[bool] + virtual_network_configuration=None, # type: Optional["models.VirtualNetworkConfiguration"] + key_vault_properties=None, # type: Optional["models.KeyVaultProperties"] + enable_purge=False, # type: Optional[bool] + value=None, # type: Optional[List["LanguageExtension"]] + type=None, # type: Optional[Union[str, "models.IdentityType"]] + user_assigned_identities=None, # type: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] + **kwargs # type: Any + ): + # type: (...) -> "models.Cluster" + cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.Cluster(tags=tags, location=location, sku=sku, zones=zones, trusted_external_tenants=trusted_external_tenants, optimized_autoscale=optimized_autoscale, enable_disk_encryption=enable_disk_encryption, enable_streaming_ingest=enable_streaming_ingest, virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, value=value, type_identity_type=type, user_assigned_identities=user_assigned_identities) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'Cluster') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Cluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + def begin_create_or_update( + self, + resource_group_name, # type: str + cluster_name, # type: str + location, # type: str + sku, # type: "models.AzureSku" + tags=None, # type: Optional[Dict[str, str]] + zones=None, # type: Optional[List[str]] + trusted_external_tenants=None, # type: Optional[List["TrustedExternalTenant"]] + optimized_autoscale=None, # type: Optional["models.OptimizedAutoscale"] + enable_disk_encryption=None, # type: Optional[bool] + enable_streaming_ingest=False, # type: Optional[bool] + virtual_network_configuration=None, # type: Optional["models.VirtualNetworkConfiguration"] + key_vault_properties=None, # type: Optional["models.KeyVaultProperties"] + enable_purge=False, # type: Optional[bool] + value=None, # type: Optional[List["LanguageExtension"]] + type=None, # type: Optional[Union[str, "models.IdentityType"]] + user_assigned_identities=None, # type: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] + **kwargs # type: Any + ): + # type: (...) -> "models.Cluster" + """Create or update a Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param location: The geo-location where the resource lives. + :type location: str + :param sku: The SKU of the cluster. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :param tags: Resource tags. + :type tags: dict[str, str] + :param zones: The availability zones of the cluster. + :type zones: list[str] + :param trusted_external_tenants: The cluster's external tenants. + :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :param optimized_autoscale: Optimized auto scale definition. + :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are + encrypted. + :type enable_disk_encryption: bool + :param enable_streaming_ingest: A boolean value that indicates if the streaming ingest is + enabled. + :type enable_streaming_ingest: bool + :param virtual_network_configuration: Virtual network definition. + :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :param key_vault_properties: KeyVault properties for the cluster encryption. + :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :param enable_purge: A boolean value that indicates if the purge operations are enabled. + :type enable_purge: bool + :param value: The list of language extensions. + :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :param type: The identity type. + :type type: str or ~azure.mgmt.kusto.models.IdentityType + :param user_assigned_identities: The list of user identities associated with the Kusto cluster. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, ~azure.mgmt.kusto.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns Cluster + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Cluster] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + location=location, + sku=sku, + tags=tags, + zones=zones, + trusted_external_tenants=trusted_external_tenants, + optimized_autoscale=optimized_autoscale, + enable_disk_encryption=enable_disk_encryption, + enable_streaming_ingest=enable_streaming_ingest, + virtual_network_configuration=virtual_network_configuration, + key_vault_properties=key_vault_properties, + enable_purge=enable_purge, + value=value, + type=type, + user_assigned_identities=user_assigned_identities, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + def _update_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + tags=None, # type: Optional[Dict[str, str]] + location=None, # type: Optional[str] + sku=None, # type: Optional["models.AzureSku"] + trusted_external_tenants=None, # type: Optional[List["TrustedExternalTenant"]] + optimized_autoscale=None, # type: Optional["models.OptimizedAutoscale"] + enable_disk_encryption=None, # type: Optional[bool] + enable_streaming_ingest=False, # type: Optional[bool] + virtual_network_configuration=None, # type: Optional["models.VirtualNetworkConfiguration"] + key_vault_properties=None, # type: Optional["models.KeyVaultProperties"] + enable_purge=False, # type: Optional[bool] + value=None, # type: Optional[List["LanguageExtension"]] + type=None, # type: Optional[Union[str, "models.IdentityType"]] + user_assigned_identities=None, # type: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] + **kwargs # type: Any + ): + # type: (...) -> "models.Cluster" + cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ClusterUpdate(tags=tags, location=location, sku=sku, trusted_external_tenants=trusted_external_tenants, optimized_autoscale=optimized_autoscale, enable_disk_encryption=enable_disk_encryption, enable_streaming_ingest=enable_streaming_ingest, virtual_network_configuration=virtual_network_configuration, key_vault_properties=key_vault_properties, enable_purge=enable_purge, value=value, type_identity_type=type, user_assigned_identities=user_assigned_identities) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ClusterUpdate') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Cluster', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Cluster', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + def begin_update( + self, + resource_group_name, # type: str + cluster_name, # type: str + tags=None, # type: Optional[Dict[str, str]] + location=None, # type: Optional[str] + sku=None, # type: Optional["models.AzureSku"] + trusted_external_tenants=None, # type: Optional[List["TrustedExternalTenant"]] + optimized_autoscale=None, # type: Optional["models.OptimizedAutoscale"] + enable_disk_encryption=None, # type: Optional[bool] + enable_streaming_ingest=False, # type: Optional[bool] + virtual_network_configuration=None, # type: Optional["models.VirtualNetworkConfiguration"] + key_vault_properties=None, # type: Optional["models.KeyVaultProperties"] + enable_purge=False, # type: Optional[bool] + value=None, # type: Optional[List["LanguageExtension"]] + type=None, # type: Optional[Union[str, "models.IdentityType"]] + user_assigned_identities=None, # type: Optional[Dict[str, "ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties"]] + **kwargs # type: Any + ): + # type: (...) -> "models.Cluster" + """Update a Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Resource location. + :type location: str + :param sku: The SKU of the cluster. + :type sku: ~azure.mgmt.kusto.models.AzureSku + :param trusted_external_tenants: The cluster's external tenants. + :type trusted_external_tenants: list[~azure.mgmt.kusto.models.TrustedExternalTenant] + :param optimized_autoscale: Optimized auto scale definition. + :type optimized_autoscale: ~azure.mgmt.kusto.models.OptimizedAutoscale + :param enable_disk_encryption: A boolean value that indicates if the cluster's disks are + encrypted. + :type enable_disk_encryption: bool + :param enable_streaming_ingest: A boolean value that indicates if the streaming ingest is + enabled. + :type enable_streaming_ingest: bool + :param virtual_network_configuration: Virtual network definition. + :type virtual_network_configuration: ~azure.mgmt.kusto.models.VirtualNetworkConfiguration + :param key_vault_properties: KeyVault properties for the cluster encryption. + :type key_vault_properties: ~azure.mgmt.kusto.models.KeyVaultProperties + :param enable_purge: A boolean value that indicates if the purge operations are enabled. + :type enable_purge: bool + :param value: The list of language extensions. + :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :param type: The identity type. + :type type: str or ~azure.mgmt.kusto.models.IdentityType + :param user_assigned_identities: The list of user identities associated with the Kusto cluster. + The user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, ~azure.mgmt.kusto.models.ComponentsSgqdofSchemasIdentityPropertiesUserassignedidentitiesAdditionalproperties] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns Cluster + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Cluster] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Cluster"] + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + tags=tags, + location=location, + sku=sku, + trusted_external_tenants=trusted_external_tenants, + optimized_autoscale=optimized_autoscale, + enable_disk_encryption=enable_disk_encryption, + enable_streaming_ingest=enable_streaming_ingest, + virtual_network_configuration=virtual_network_configuration, + key_vault_properties=key_vault_properties, + enable_purge=enable_purge, + value=value, + type=type, + user_assigned_identities=user_assigned_identities, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Cluster', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._delete_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + def begin_delete( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}'} + + def _stop_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._stop_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} + + def begin_stop( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Stops a Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/stop'} + + def _start_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._start_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} + + def begin_start( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Starts a Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = self._start_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/start'} + + def list_follower_database( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.FollowerDatabaseListResult" + """Returns a list of databases that are owned by this cluster and were followed by another cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: FollowerDatabaseListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.FollowerDatabaseListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.FollowerDatabaseListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_follower_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('FollowerDatabaseListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_follower_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listFollowerDatabases'} + + def _detach_follower_database_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + cluster_resource_id, # type: str + attached_database_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _follower_database_to_remove = models.FollowerDatabaseDefinition(cluster_resource_id=cluster_resource_id, attached_database_configuration_name=attached_database_configuration_name) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._detach_follower_database_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_follower_database_to_remove, 'FollowerDatabaseDefinition') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _detach_follower_database_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} + + def begin_detach_follower_database( + self, + resource_group_name, # type: str + cluster_name, # type: str + cluster_resource_id, # type: str + attached_database_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Detaches all followers of a database owned by this cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param cluster_resource_id: Resource id of the cluster that follows a database owned by this + cluster. + :type cluster_resource_id: str + :param attached_database_configuration_name: Resource name of the attached database + configuration in the follower cluster. + :type attached_database_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = self._detach_follower_database_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cluster_resource_id=cluster_resource_id, + attached_database_configuration_name=attached_database_configuration_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_detach_follower_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/detachFollowerDatabases'} + + def _diagnose_virtual_network_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DiagnoseVirtualNetworkResult" + cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnoseVirtualNetworkResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._diagnose_virtual_network_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DiagnoseVirtualNetworkResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _diagnose_virtual_network_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} + + def begin_diagnose_virtual_network( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DiagnoseVirtualNetworkResult" + """Diagnoses network connectivity status for external resources on which the service is dependent on. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns DiagnoseVirtualNetworkResult + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DiagnoseVirtualNetworkResult] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnoseVirtualNetworkResult"] + raw_result = self._diagnose_virtual_network_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DiagnoseVirtualNetworkResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_diagnose_virtual_network.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/diagnoseVirtualNetwork'} + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ClusterListResult" + """Lists all Kusto clusters within a resource group. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ClusterListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.ClusterListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ClusterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters'} + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.ClusterListResult" + """Lists all Kusto clusters within a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ClusterListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.ClusterListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ClusterListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/clusters'} + + def list_sku( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.SkuDescriptionList" + """Lists eligible SKUs for Kusto resource provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SkuDescriptionList or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.SkuDescriptionList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SkuDescriptionList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_sku.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) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('SkuDescriptionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_sku.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/skus'} + + def check_name_availability( + self, + location, # type: str + name, # type: str + type, # type: Union[str, "models.Type"] + **kwargs # type: Any + ): + # type: (...) -> "models.CheckNameResult" + """Checks that the cluster name is valid and is not already in use. + + :param location: Azure location. + :type location: str + :param name: Cluster name. + :type name: str + :param type: The type of resource, Microsoft.Kusto/clusters. + :type type: str or ~azure.mgmt.kusto.models.Type + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _cluster_name = models.ClusterCheckNameRequest(name=name, type=type) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_cluster_name, 'ClusterCheckNameRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Kusto/locations/{location}/checkNameAvailability'} + + def list_sku_by_resource( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ListResourceSkusResult" + """Returns the SKUs available for the provided resource. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListResourceSkusResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.ListResourceSkusResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ListResourceSkusResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_sku_by_resource.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ListResourceSkusResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_sku_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/skus'} + + def list_language_extension( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.LanguageExtensionsList" + """Returns a list of language extensions that can run within KQL queries. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LanguageExtensionsList or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.LanguageExtensionsList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.LanguageExtensionsList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_language_extension.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('LanguageExtensionsList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/listLanguageExtensions'} + + def _add_language_extension_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + value=None, # type: Optional[List["LanguageExtension"]] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _language_extensions_to_add = models.LanguageExtensionsList(value=value) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._add_language_extension_initial.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_language_extensions_to_add, 'LanguageExtensionsList') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _add_language_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} + + def begin_add_language_extension( + self, + resource_group_name, # type: str + cluster_name, # type: str + value=None, # type: Optional[List["LanguageExtension"]] + **kwargs # type: Any + ): + # type: (...) -> None + """Add a list of language extensions that can run within KQL queries. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param value: The list of language extensions. + :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = self._add_language_extension_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + value=value, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_add_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/addLanguageExtensions'} + + def _remove_language_extension_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + value=None, # type: Optional[List["LanguageExtension"]] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _language_extensions_to_remove = models.LanguageExtensionsList(value=value) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._remove_language_extension_initial.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_language_extensions_to_remove, 'LanguageExtensionsList') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _remove_language_extension_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} + + def begin_remove_language_extension( + self, + resource_group_name, # type: str + cluster_name, # type: str + value=None, # type: Optional[List["LanguageExtension"]] + **kwargs # type: Any + ): + # type: (...) -> None + """Remove a list of language extensions that can run within KQL queries. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param value: The list of language extensions. + :type value: list[~azure.mgmt.kusto.models.LanguageExtension] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = self._remove_language_extension_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + value=value, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_remove_language_extension.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/removeLanguageExtensions'} diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_principal_assignment_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_principal_assignment_operations.py new file mode 100644 index 00000000000..4bb9028c622 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_cluster_principal_assignment_operations.py @@ -0,0 +1,474 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ClusterPrincipalAssignmentOperations(object): + """ClusterPrincipalAssignmentOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def check_name_availability( + self, + resource_group_name, # type: str + cluster_name, # type: str + name, # type: str + type, # type: Union[str, "models.Type"] + **kwargs # type: Any + ): + # type: (...) -> "models.CheckNameResult" + """Checks that the principal assignment name is valid and is not already in use. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param name: Principal Assignment resource name. + :type name: str + :param type: The type of resource, Microsoft.Kusto/clusters/principalAssignments. + :type type: str or ~azure.mgmt.kusto.models.Type + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _principal_assignment_name = models.ClusterPrincipalAssignmentCheckNameRequest(name=name, type=type) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_principal_assignment_name, 'ClusterPrincipalAssignmentCheckNameRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkPrincipalAssignmentNameAvailability'} + + def get( + self, + resource_group_name, # type: str + cluster_name, # type: str + principal_assignment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ClusterPrincipalAssignment" + """Gets a Kusto cluster principalAssignment. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param principal_assignment_name: The name of the Kusto principalAssignment. + :type principal_assignment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ClusterPrincipalAssignment or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.ClusterPrincipalAssignment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignment"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # 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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + + def _create_or_update_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + principal_assignment_name, # type: str + principal_id=None, # type: Optional[str] + role=None, # type: Optional[Union[str, "models.ClusterPrincipalRole"]] + tenant_id=None, # type: Optional[str] + principal_type=None, # type: Optional[Union[str, "models.PrincipalType"]] + **kwargs # type: Any + ): + # type: (...) -> "models.ClusterPrincipalAssignment" + cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignment"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.ClusterPrincipalAssignment(principal_id=principal_id, role=role, tenant_id=tenant_id, principal_type=principal_type) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'ClusterPrincipalAssignment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + + def begin_create_or_update( + self, + resource_group_name, # type: str + cluster_name, # type: str + principal_assignment_name, # type: str + principal_id=None, # type: Optional[str] + role=None, # type: Optional[Union[str, "models.ClusterPrincipalRole"]] + tenant_id=None, # type: Optional[str] + principal_type=None, # type: Optional[Union[str, "models.PrincipalType"]] + **kwargs # type: Any + ): + # type: (...) -> "models.ClusterPrincipalAssignment" + """Create a Kusto cluster principalAssignment. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param principal_assignment_name: The name of the Kusto principalAssignment. + :type principal_assignment_name: str + :param principal_id: The principal ID assigned to the cluster principal. It can be a user + email, application ID, or security group name. + :type principal_id: str + :param role: Cluster principal role. + :type role: str or ~azure.mgmt.kusto.models.ClusterPrincipalRole + :param tenant_id: The tenant id of the principal. + :type tenant_id: str + :param principal_type: Principal type. + :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns ClusterPrincipalAssignment + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.ClusterPrincipalAssignment] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignment"] + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ClusterPrincipalAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + principal_assignment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._delete_initial.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + + def begin_delete( + self, + resource_group_name, # type: str + cluster_name, # type: str + principal_assignment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a Kusto cluster principalAssignment. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param principal_assignment_name: The name of the Kusto principalAssignment. + :type principal_assignment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + principal_assignment_name=principal_assignment_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments/{principalAssignmentName}'} + + def list( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ClusterPrincipalAssignmentListResult" + """Lists all Kusto cluster principalAssignments. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ClusterPrincipalAssignmentListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.ClusterPrincipalAssignmentListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ClusterPrincipalAssignmentListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ClusterPrincipalAssignmentListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/principalAssignments'} diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_data_connection_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_data_connection_operations.py new file mode 100644 index 00000000000..781c8811769 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_data_connection_operations.py @@ -0,0 +1,681 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DataConnectionOperations(object): + """DataConnectionOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_database( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DataConnectionListResult" + """Returns the list of data connections of the given Kusto database. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataConnectionListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DataConnectionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnectionListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DataConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections'} + + def data_connection_validation( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + data_connection_name=None, # type: Optional[str] + properties=None, # type: Optional["models.DataConnection"] + **kwargs # type: Any + ): + # type: (...) -> "models.DataConnectionValidationListResult" + """Checks that the data connection parameters are valid. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param properties: The data connection properties to validate. + :type properties: ~azure.mgmt.kusto.models.DataConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataConnectionValidationListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DataConnectionValidationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnectionValidationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.DataConnectionValidation(data_connection_name=data_connection_name, properties=properties) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.data_connection_validation.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'DataConnectionValidation') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataConnectionValidationListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + data_connection_validation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnectionValidation'} + + def check_name_availability( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + name, # type: str + type, # type: Union[str, "models.Type"] + **kwargs # type: Any + ): + # type: (...) -> "models.CheckNameResult" + """Checks that the data connection name is valid and is not already in use. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param name: Data Connection name. + :type name: str + :param type: The type of resource, Microsoft.Kusto/clusters/databases/dataConnections. + :type type: str or ~azure.mgmt.kusto.models.Type + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _data_connection_name = models.DataConnectionCheckNameRequest(name=name, type=type) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_data_connection_name, 'DataConnectionCheckNameRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkNameAvailability'} + + def get( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + data_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DataConnection" + """Returns a data connection. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DataConnection or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DataConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'dataConnectionName': self._serialize.url("data_connection_name", data_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DataConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + + def _create_or_update_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + data_connection_name, # type: str + parameters, # type: "models.DataConnection" + **kwargs # type: Any + ): + # type: (...) -> "models.DataConnection" + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'dataConnectionName': self._serialize.url("data_connection_name", data_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DataConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataConnection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('DataConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + + def begin_create_or_update( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + data_connection_name, # type: str + parameters, # type: "models.DataConnection" + **kwargs # type: Any + ): + # type: (...) -> "models.DataConnection" + """Creates or updates a data connection. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param parameters: The data connection parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.kusto.models.DataConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns DataConnection + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DataConnection] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DataConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + + def _update_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + data_connection_name, # type: str + parameters, # type: "models.DataConnection" + **kwargs # type: Any + ): + # type: (...) -> "models.DataConnection" + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'dataConnectionName': self._serialize.url("data_connection_name", data_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'DataConnection') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DataConnection', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DataConnection', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('DataConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + + def begin_update( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + data_connection_name, # type: str + parameters, # type: "models.DataConnection" + **kwargs # type: Any + ): + # type: (...) -> "models.DataConnection" + """Updates a data connection. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :param parameters: The data connection parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.kusto.models.DataConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns DataConnection + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DataConnection] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DataConnection"] + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DataConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + data_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._delete_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'dataConnectionName': self._serialize.url("data_connection_name", data_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} + + def begin_delete( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + data_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the data connection with the given name. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param data_connection_name: The name of the data connection. + :type data_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + data_connection_name=data_connection_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/dataConnections/{dataConnectionName}'} diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_operations.py new file mode 100644 index 00000000000..355d5fd9cbc --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_operations.py @@ -0,0 +1,794 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DatabaseOperations(object): + """DatabaseOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def check_name_availability( + self, + resource_group_name, # type: str + cluster_name, # type: str + name, # type: str + type, # type: Union[str, "models.Type"] + **kwargs # type: Any + ): + # type: (...) -> "models.CheckNameResult" + """Checks that the database name is valid and is not already in use. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param name: Resource name. + :type name: str + :param type: The type of resource, for instance Microsoft.Kusto/clusters/databases. + :type type: str or ~azure.mgmt.kusto.models.Type + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _resource_name = models.CheckNameRequest(name=name, type=type) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_resource_name, 'CheckNameRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/checkNameAvailability'} + + def list_by_cluster( + self, + resource_group_name, # type: str + cluster_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DatabaseListResult" + """Returns the list of databases of the given Kusto cluster. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabaseListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DatabaseListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabaseListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_cluster.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DatabaseListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases'} + + def get( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Database" + """Returns a database. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Database or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.Database + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Database', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + def _create_or_update_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + parameters, # type: "models.Database" + **kwargs # type: Any + ): + # type: (...) -> "models.Database" + cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Database') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Database', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Database', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Database', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + def begin_create_or_update( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + parameters, # type: "models.Database" + **kwargs # type: Any + ): + # type: (...) -> "models.Database" + """Creates or updates a database. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param parameters: The database parameters supplied to the CreateOrUpdate operation. + :type parameters: ~azure.mgmt.kusto.models.Database + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns Database + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Database] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Database', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + def _update_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + parameters, # type: "models.Database" + **kwargs # type: Any + ): + # type: (...) -> "models.Database" + cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._update_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'Database') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Database', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Database', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('Database', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + def begin_update( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + parameters, # type: "models.Database" + **kwargs # type: Any + ): + # type: (...) -> "models.Database" + """Updates a database. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param parameters: The database parameters supplied to the Update operation. + :type parameters: ~azure.mgmt.kusto.models.Database + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns Database + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.Database] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.Database"] + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('Database', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._delete_initial.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + def begin_delete( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the database with the given name. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}'} + + def list_principal( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DatabasePrincipalListResult" + """Returns a list of database principals of the given Kusto cluster and database. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabasePrincipalListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_principal.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DatabasePrincipalListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/listPrincipals'} + + def add_principal( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + value=None, # type: Optional[List["DatabasePrincipal"]] + **kwargs # type: Any + ): + # type: (...) -> "models.DatabasePrincipalListResult" + """Add Database principals permissions. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param value: The list of Kusto database principals. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabasePrincipalListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _database_principals_to_add = models.DatabasePrincipalListRequest(value=value) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.add_principal.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_database_principals_to_add, 'DatabasePrincipalListRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DatabasePrincipalListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + add_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/addPrincipals'} + + def remove_principal( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + value=None, # type: Optional[List["DatabasePrincipal"]] + **kwargs # type: Any + ): + # type: (...) -> "models.DatabasePrincipalListResult" + """Remove Database principals permissions. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param value: The list of Kusto database principals. + :type value: list[~azure.mgmt.kusto.models.DatabasePrincipal] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabasePrincipalListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _database_principals_to_remove = models.DatabasePrincipalListRequest(value=value) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.remove_principal.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_database_principals_to_remove, 'DatabasePrincipalListRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DatabasePrincipalListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + remove_principal.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/removePrincipals'} diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_principal_assignment_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_principal_assignment_operations.py new file mode 100644 index 00000000000..4fe55c98aa3 --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_database_principal_assignment_operations.py @@ -0,0 +1,498 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class DatabasePrincipalAssignmentOperations(object): + """DatabasePrincipalAssignmentOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def check_name_availability( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + name, # type: str + type, # type: Union[str, "models.Type"] + **kwargs # type: Any + ): + # type: (...) -> "models.CheckNameResult" + """Checks that the database principal assignment is valid and is not already in use. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param name: Principal Assignment resource name. + :type name: str + :param type: The type of resource, Microsoft.Kusto/clusters/databases/principalAssignments. + :type type: str or ~azure.mgmt.kusto.models.Type + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.CheckNameResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _principal_assignment_name = models.DatabasePrincipalAssignmentCheckNameRequest(name=name, type=type) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_principal_assignment_name, 'DatabasePrincipalAssignmentCheckNameRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/checkPrincipalAssignmentNameAvailability'} + + def get( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + principal_assignment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DatabasePrincipalAssignment" + """Gets a Kusto cluster database principalAssignment. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param principal_assignment_name: The name of the Kusto principalAssignment. + :type principal_assignment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabasePrincipalAssignment or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalAssignment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignment"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # 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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + + def _create_or_update_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + principal_assignment_name, # type: str + principal_id=None, # type: Optional[str] + role=None, # type: Optional[Union[str, "models.DatabasePrincipalRole"]] + tenant_id=None, # type: Optional[str] + principal_type=None, # type: Optional[Union[str, "models.PrincipalType"]] + **kwargs # type: Any + ): + # type: (...) -> "models.DatabasePrincipalAssignment" + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignment"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.DatabasePrincipalAssignment(principal_id=principal_id, role=role, tenant_id=tenant_id, principal_type=principal_type) + api_version = "2020-02-15" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'DatabasePrincipalAssignment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + + def begin_create_or_update( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + principal_assignment_name, # type: str + principal_id=None, # type: Optional[str] + role=None, # type: Optional[Union[str, "models.DatabasePrincipalRole"]] + tenant_id=None, # type: Optional[str] + principal_type=None, # type: Optional[Union[str, "models.PrincipalType"]] + **kwargs # type: Any + ): + # type: (...) -> "models.DatabasePrincipalAssignment" + """Creates a Kusto cluster database principalAssignment. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param principal_assignment_name: The name of the Kusto principalAssignment. + :type principal_assignment_name: str + :param principal_id: The principal ID assigned to the database principal. It can be a user + email, application ID, or security group name. + :type principal_id: str + :param role: Database principal role. + :type role: str or ~azure.mgmt.kusto.models.DatabasePrincipalRole + :param tenant_id: The tenant id of the principal. + :type tenant_id: str + :param principal_type: Principal type. + :type principal_type: str or ~azure.mgmt.kusto.models.PrincipalType + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns DatabasePrincipalAssignment + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.kusto.models.DatabasePrincipalAssignment] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignment"] + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + principal_id=principal_id, + role=role, + tenant_id=tenant_id, + principal_type=principal_type, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DatabasePrincipalAssignment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + + def _delete_initial( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + principal_assignment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + # Construct URL + url = self._delete_initial.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'principalAssignmentName': self._serialize.url("principal_assignment_name", principal_assignment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + + def begin_delete( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + principal_assignment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a Kusto principalAssignment. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :param principal_assignment_name: The name of the Kusto principalAssignment. + :type principal_assignment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + database_name=database_name, + principal_assignment_name=principal_assignment_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments/{principalAssignmentName}'} + + def list( + self, + resource_group_name, # type: str + cluster_name, # type: str + database_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DatabasePrincipalAssignmentListResult" + """Lists all Kusto cluster database principalAssignments. + + :param resource_group_name: The name of the resource group containing the Kusto cluster. + :type resource_group_name: str + :param cluster_name: The name of the Kusto cluster. + :type cluster_name: str + :param database_name: The name of the database in the Kusto cluster. + :type database_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DatabasePrincipalAssignmentListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.DatabasePrincipalAssignmentListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.DatabasePrincipalAssignmentListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('DatabasePrincipalAssignmentListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}/principalAssignments'} diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_operation_operations.py b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_operation_operations.py new file mode 100644 index 00000000000..0dccf9c0c3a --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/operations/_operation_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations(object): + """OperationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.kusto.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.OperationListResult" + """Lists available operations for the Microsoft.Kusto provider. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationListResult or the result of cls(response) + :rtype: ~azure.mgmt.kusto.models.OperationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2020-02-15" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Kusto/operations'} diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/py.typed b/src/kusto/azext_kusto/vendored_sdks/kusto/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/kusto/azext_kusto/vendored_sdks/kusto/setup.py b/src/kusto/azext_kusto/vendored_sdks/kusto/setup.py new file mode 100644 index 00000000000..ef33e13c91d --- /dev/null +++ b/src/kusto/azext_kusto/vendored_sdks/kusto/setup.py @@ -0,0 +1,37 @@ +# 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. +# -------------------------------------------------------------------------- +# coding: utf-8 + +from setuptools import setup, find_packages + +NAME = "kustomanagementclient" +VERSION = "0.1.0" + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["msrest>=0.6.0", "azure-core<2.0.0,>=1.2.0"] + +setup( + name=NAME, + version=VERSION, + description="KustoManagementClient", + author_email="", + url="", + keywords=["Swagger", "KustoManagementClient"], + install_requires=REQUIRES, + packages=find_packages(), + include_package_data=True, + long_description="""\ + The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases. + """ +) diff --git a/src/kusto/kusto.egg-info/PKG-INFO b/src/kusto/kusto.egg-info/PKG-INFO new file mode 100644 index 00000000000..314d0cd444f --- /dev/null +++ b/src/kusto/kusto.egg-info/PKG-INFO @@ -0,0 +1,34 @@ +Metadata-Version: 1.1 +Name: kusto +Version: 0.1.0 +Summary: Microsoft Azure Command-Line Tools KustoManagementClient Extension +Home-page: https://github.com/Azure/azure-cli-extensions +Author: Microsoft Corporation +Author-email: azpycli@microsoft.com +License: MIT +Description: Microsoft Azure CLI 'kusto' Extension + ========================================== + + This package is for the 'kusto' extension. + i.e. 'az kusto' + + + .. :changelog: + + Release History + =============== + + 0.1.0 + ++++++ + * Initial release. + +Platform: UNKNOWN +Classifier: Development Status :: 4 - Beta +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: System Administrators +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: License :: OSI Approved :: MIT License diff --git a/src/kusto/kusto.egg-info/SOURCES.txt b/src/kusto/kusto.egg-info/SOURCES.txt new file mode 100644 index 00000000000..593d83e2e07 --- /dev/null +++ b/src/kusto/kusto.egg-info/SOURCES.txt @@ -0,0 +1,53 @@ +README.md +setup.cfg +setup.py +azext_kusto/__init__.py +azext_kusto/action.py +azext_kusto/azext_metadata.json +azext_kusto/custom.py +azext_kusto/generated/__init__.py +azext_kusto/generated/_client_factory.py +azext_kusto/generated/_help.py +azext_kusto/generated/_params.py +azext_kusto/generated/_validators.py +azext_kusto/generated/action.py +azext_kusto/generated/commands.py +azext_kusto/generated/custom.py +azext_kusto/manual/__init__.py +azext_kusto/tests/__init__.py +azext_kusto/tests/latest/__init__.py +azext_kusto/tests/latest/preparers.py +azext_kusto/tests/latest/test_kusto_scenario.py +azext_kusto/vendored_sdks/__init__.py +azext_kusto/vendored_sdks/kusto/__init__.py +azext_kusto/vendored_sdks/kusto/_configuration.py +azext_kusto/vendored_sdks/kusto/_kusto_management_client.py +azext_kusto/vendored_sdks/kusto/_version.py +azext_kusto/vendored_sdks/kusto/setup.py +azext_kusto/vendored_sdks/kusto/aio/__init__.py +azext_kusto/vendored_sdks/kusto/aio/_configuration_async.py +azext_kusto/vendored_sdks/kusto/aio/_kusto_management_client_async.py +azext_kusto/vendored_sdks/kusto/aio/operations_async/__init__.py +azext_kusto/vendored_sdks/kusto/aio/operations_async/_attached_database_configuration_operations_async.py +azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_operations_async.py +azext_kusto/vendored_sdks/kusto/aio/operations_async/_cluster_principal_assignment_operations_async.py +azext_kusto/vendored_sdks/kusto/aio/operations_async/_data_connection_operations_async.py +azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_operations_async.py +azext_kusto/vendored_sdks/kusto/aio/operations_async/_database_principal_assignment_operations_async.py +azext_kusto/vendored_sdks/kusto/aio/operations_async/_operation_operations_async.py +azext_kusto/vendored_sdks/kusto/models/__init__.py +azext_kusto/vendored_sdks/kusto/models/_kusto_management_client_enums.py +azext_kusto/vendored_sdks/kusto/models/_models.py +azext_kusto/vendored_sdks/kusto/models/_models_py3.py +azext_kusto/vendored_sdks/kusto/operations/__init__.py +azext_kusto/vendored_sdks/kusto/operations/_attached_database_configuration_operations.py +azext_kusto/vendored_sdks/kusto/operations/_cluster_operations.py +azext_kusto/vendored_sdks/kusto/operations/_cluster_principal_assignment_operations.py +azext_kusto/vendored_sdks/kusto/operations/_data_connection_operations.py +azext_kusto/vendored_sdks/kusto/operations/_database_operations.py +azext_kusto/vendored_sdks/kusto/operations/_database_principal_assignment_operations.py +azext_kusto/vendored_sdks/kusto/operations/_operation_operations.py +kusto.egg-info/PKG-INFO +kusto.egg-info/SOURCES.txt +kusto.egg-info/dependency_links.txt +kusto.egg-info/top_level.txt \ No newline at end of file diff --git a/src/kusto/kusto.egg-info/dependency_links.txt b/src/kusto/kusto.egg-info/dependency_links.txt new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/src/kusto/kusto.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/src/kusto/kusto.egg-info/top_level.txt b/src/kusto/kusto.egg-info/top_level.txt new file mode 100644 index 00000000000..37a1542d066 --- /dev/null +++ b/src/kusto/kusto.egg-info/top_level.txt @@ -0,0 +1 @@ +azext_kusto diff --git a/src/kusto/setup.cfg b/src/kusto/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/kusto/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/kusto/setup.py b/src/kusto/setup.py new file mode 100644 index 00000000000..6bcb85dcd06 --- /dev/null +++ b/src/kusto/setup.py @@ -0,0 +1,53 @@ +#!/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 + +# 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.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + '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='kusto', + version=VERSION, + description='Microsoft Azure Command-Line Tools KustoManagementClient 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_kusto': ['azext_metadata.json']}, +) 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/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/web_test_paged.py b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/models/_paged_models.py similarity index 69% rename from src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/web_test_paged.py rename to src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/models/_paged_models.py index ef7b3263882..d933945d04b 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/web_test_paged.py +++ b/src/log-analytics-solution/azext_log_analytics_solution/vendored_sdks/operationsmanagement/models/_paged_models.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class WebTestPaged(Paged): +class OperationPaged(Paged): """ - A paging container for iterating over a list of :class:`WebTest ` object + 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': '[WebTest]'} + 'current_page': {'key': 'value', 'type': '[Operation]'} } def __init__(self, *args, **kwargs): - super(WebTestPaged, self).__init__(*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']}, +) diff --git a/src/logic/HISTORY.rst b/src/logic/HISTORY.rst new file mode 100644 index 00000000000..1c139576ba0 --- /dev/null +++ b/src/logic/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/logic/README.md b/src/logic/README.md new file mode 100644 index 00000000000..07740259dd4 --- /dev/null +++ b/src/logic/README.md @@ -0,0 +1,63 @@ +# Azure CLI Logic Apps Extension # +This package is for the 'logic app' extension, i.e. 'az logic'. +More info on what is [Logic](https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-overview). + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name logic +``` + +### Getting Help + +To see examples of commands and parameters details got commands or command groups, one should run the command of interest with a -h + +Examples: +``` +az logic workflow create -h + +az logic integration-account -h + +az logic worflow update -h +``` + + +##### Creating a Logic App + +For creating a logic app, one must provide a logic app definition. +A definition is a JSON description of a logic app workflow. It is recommended that the logic app designer be used to create this definition, as these definitions can be very complex depending on a workflow. The designed tool works with VS Code, Visual Studio, and Azure Portal: https://docs.microsoft.com/en-us/azure/logic-apps/. + +Access Controls: For a great reference on this see: (https://msftplayground.com/2020/02/managing-access-control-for-logic-apps/) +An example of how an access control would look is: + +```json +"accessControl": { "triggers": + { "allowedCallerIpAddresses": + [{ "addressRange": "10.0.0.0/24" }]}, + "actions": { "allowedCallerIpAddresses": + [{ "addressRange": "10.0.0.0/24" }]} + } +``` +##### Creating an Integration Account + +Integration accounts are a way for Azure Logic Apps to utilize services outside of Azure to integrate into your logic app workflows. See (https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-enterprise-integration-create-integration-account) for more information. + +Integration Service enviroments go hand in hand with a integration account. It is enviroment that connects to your azure vnet for seamless flow of data and logic apps services to on premise enviroments and services. See (https://azure.microsoft.com/en-us/blog/announcing-azure-integration-service-environment-for-logic-apps/) for more information + + +#### Import an Integration Account + +You can import an integration account from a JSON file. Run az workflow integration-account import -h to see the parameters. + +An example JSON for import could look like: + +```json +{"properties": { + "state": "Enabled" + }, + "sku": { + "name": "Standard" + }, + "location": "centralus" +} +''' \ No newline at end of file diff --git a/src/logic/azext_logic/__init__.py b/src/logic/azext_logic/__init__.py new file mode 100644 index 00000000000..b41bafda354 --- /dev/null +++ b/src/logic/azext_logic/__init__.py @@ -0,0 +1,41 @@ +# -------------------------------------------------------------------------------------------- +# 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_logic.generated._help import helps # pylint: disable=unused-import + + +class LogicManagementClientCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_logic.generated._client_factory import cf_logic + logic_custom = CliCommandType( + operations_tmpl='azext_logic.custom#{}', + client_factory=cf_logic) + super(LogicManagementClientCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=logic_custom) + + def load_command_table(self, args): + from azext_logic.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_logic.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError: + pass + return self.command_table + + def load_arguments(self, command): + from azext_logic.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_logic.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass + + +COMMAND_LOADER_CLS = LogicManagementClientCommandsLoader diff --git a/src/logic/azext_logic/action.py b/src/logic/azext_logic/action.py new file mode 100644 index 00000000000..d66d3c5d0d7 --- /dev/null +++ b/src/logic/azext_logic/action.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/logic/azext_logic/azext_metadata.json b/src/logic/azext_logic/azext_metadata.json new file mode 100644 index 00000000000..27e30487444 --- /dev/null +++ b/src/logic/azext_logic/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1" +} diff --git a/src/logic/azext_logic/commands.py b/src/logic/azext_logic/commands.py new file mode 100644 index 00000000000..42f0c1a991e --- /dev/null +++ b/src/logic/azext_logic/commands.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.commands import * # noqa: F403 +try: + from .manual.commands import * # noqa: F403 +except ImportError: + pass diff --git a/src/logic/azext_logic/custom.py b/src/logic/azext_logic/custom.py new file mode 100644 index 00000000000..d1fd3543ed0 --- /dev/null +++ b/src/logic/azext_logic/custom.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/logic/azext_logic/generated/__init__.py b/src/logic/azext_logic/generated/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/logic/azext_logic/generated/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/logic/azext_logic/generated/_client_factory.py b/src/logic/azext_logic/generated/_client_factory.py new file mode 100644 index 00000000000..a8df4e1760d --- /dev/null +++ b/src/logic/azext_logic/generated/_client_factory.py @@ -0,0 +1,18 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def cf_logic(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from ..vendored_sdks.logic import LogicManagementClient + return get_mgmt_service_client(cli_ctx, LogicManagementClient) + + +def cf_workflow(cli_ctx, *_): + return cf_logic(cli_ctx).workflow + + +def cf_integration_account(cli_ctx, *_): + return cf_logic(cli_ctx).integration_account diff --git a/src/logic/azext_logic/generated/_help.py b/src/logic/azext_logic/generated/_help.py new file mode 100644 index 00000000000..b5772ab8f22 --- /dev/null +++ b/src/logic/azext_logic/generated/_help.py @@ -0,0 +1,122 @@ +# -------------------------------------------------------------------------------------------- +# 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 + +from knack.help_files import helps + + +helps['logic workflow'] = """ + type: group + short-summary: logic workflow +""" + +helps['logic workflow list'] = """ + type: command + short-summary: Gets a list of workflows by subscription. + examples: + - name: List all workflows in a resource group + text: |- + az logic workflow list --resource-group "test_resource_group" + - name: List all workflows in a subscription + text: |- + az logic workflow list +""" + +helps['logic workflow show'] = """ + type: command + short-summary: Gets a workflow. + examples: + - name: Get a workflow + text: |- + az logic workflow show --resource-group "test_resource_group" --name "test_workflow" +""" + +helps['logic workflow create'] = """ + type: command + short-summary: Creates or updates a workflow using a JSON file for the defintion. + examples: + - name: Create or update a workflow + text: |- + az logic workflow create --resource-group "test_resource_group" --location "centralus" --name "test_workflow" --definition "workflow.json" +""" + +helps['logic workflow update'] = """ + type: command + short-summary: Updates a workflow. + examples: + - name: Patch a workflow + text: |- + az logic workflow update --resource-group "test_resource_group" --definition workflow.json --name "test_workflow" +""" + +helps['logic workflow delete'] = """ + type: command + short-summary: Deletes a workflow. + examples: + - name: Delete a workflow + text: |- + az logic workflow delete --resource-group "test_resource_group" --name "test_workflow" +""" + +helps['logic integration-account'] = """ + type: group + short-summary: logic integration-account +""" + +helps['logic integration-account list'] = """ + type: command + short-summary: Gets a list of integration accounts by subscription. + examples: + - name: List integration accounts by resource group name + text: |- + az logic integration-account list --resource-group "test_resource_group" +""" + +helps['logic integration-account show'] = """ + type: command + short-summary: Gets an integration account. + examples: + - name: Get integration account by name + text: |- + az logic integration-account show --name "test_integration_account" --resource-group "test_resource_group" +""" + +helps['logic integration-account create'] = """ + type: command + short-summary: Creates or updates an integration account. + examples: + - name: Create or update an integration account + text: |- + az logic integration-account create --location "centralus" --sku name=Standard --name "test_integration_account" --resource-group "test_resource_group" +""" + +helps['logic integration-account update'] = """ + type: command + short-summary: Updates an integration account. + examples: + - name: Patch an integration account + text: |- + az logic integration-account update --sku name=Basic --tag atag=123 --name "test_integration_account" --resource-group "test_resource_group" +""" + + +helps['logic integration-account import'] = """ + type: command + short-summary: Import an integration account from a JSON file. + examples: + - name: Import an integration account. + text: |- + az logic integration-account import --name "test_integration_account" --resource-group "test_resource_group" --input-path "integration.json" +""" + +helps['logic integration-account delete'] = """ + type: command + short-summary: Deletes an integration account. + examples: + - name: Delete an integration account + text: |- + az logic integration-account delete --name "test_integration_account" --resource-group "test_resource_group" +""" diff --git a/src/logic/azext_logic/generated/_params.py b/src/logic/azext_logic/generated/_params.py new file mode 100644 index 00000000000..84a0b059b38 --- /dev/null +++ b/src/logic/azext_logic/generated/_params.py @@ -0,0 +1,130 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from argcomplete.completers import FilesCompleter +from knack.arguments import CLIArgumentType +from azure.cli.core.commands.validators import validate_file_or_dict, get_default_location_from_resource_group +from azure.cli.core.commands.parameters import ( + tags_type, + get_enum_type, + resource_group_name_type, + get_location_type +) +from azext_logic.action import AddIntegrationAccount + + +def load_arguments(self, _): + + with self.argument_context('logic workflow list') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The resource group name.') + c.argument( + 'top', help='The number of items to be included in the result.') + c.argument('filter', help='The filter to apply on the operation. Options for filters include: State, Trigger, a' + 'nd ReferencedResourceId.') + + with self.argument_context('logic workflow show') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The resource group name.') + c.argument('name', options_list=[ + '--name', '-n'], help='The workflow name.') + + with self.argument_context('logic workflow create') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The resource group name.') + c.argument('name', options_list=[ + '--name', '-n'], help='The workflow name.') + c.argument('definition', type=validate_file_or_dict, help='Path to a workflow defintion JSON file (see README.md for more info on this). ' + + 'This JSON format should match what the logic app design tool exports', completer=FilesCompleter()) + c.argument('location', arg_type=get_location_type( + self.cli_ctx), validator=get_default_location_from_resource_group) + c.argument('integration_account', action=AddIntegrationAccount, + nargs='+', help='The integration account.') + c.argument('integration_service_environment', action=AddIntegrationAccount, nargs='+', help='The integration se' + 'rvice environment. See README.md For more information') + c.argument('endpoints_configuration', arg_type=CLIArgumentType(options_list=['--endpoints-configuration'], + help='The endpoints configuration.')) + c.argument('access_control', arg_type=CLIArgumentType(options_list=['--access-control'], help='The access contr' + 'ol configuration controls access to this workflow. See README.md for more information')) + c.argument('state', arg_type=get_enum_type(['NotSpecified', 'Completed', 'Enabled', 'Disabled', 'Deleted', 'Sus' + 'pended']), help='The state.') + c.argument('tags', tags_type, help='The resource tags.') + + with self.argument_context('logic workflow update') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The resource group name.') + c.argument('name', options_list=[ + '--name', '-n'], help='The workflow name.') + c.argument('state', arg_type=get_enum_type(['NotSpecified', 'Completed', 'Enabled', 'Disabled', 'Deleted', 'Sus' + 'pended']), help='The state.') + c.argument('definition', type=validate_file_or_dict, help='Path to a workflow defintion JSON file (see README.md for more info on this). ' + + 'This JSON format should match what the logic app design tool exports', completer=FilesCompleter()) + c.argument('tags', tags_type, help='The resource tags.') + + with self.argument_context('logic workflow delete') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The resource group name.') + c.argument('name', options_list=[ + '--name', '-n'], help='The workflow name.') + + with self.argument_context('logic integration-account list') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The resource group name.') + c.argument( + 'top', help='The number of items to be included in the result.') + + with self.argument_context('logic integration-account show') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The resource group name.') + c.argument('name', options_list=[ + '--name', '-n'], help='The integration account name.') + + with self.argument_context('logic integration-account create') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The resource group name.') + c.argument('name', options_list=[ + '--name', '-n'], help='The integration account name.') + c.argument('location', arg_type=get_location_type( + self.cli_ctx), validator=get_default_location_from_resource_group) + c.argument('tags', tags_type, help='The resource tags.') + c.argument('sku', type=str, help='The integration account sku.') + c.argument('integration_service_environment', arg_type=CLIArgumentType(options_list=['--integration-service-env' + 'ironment'], help='The integration se' + 'rvice environment. See README.md For more information')) + c.argument('state', arg_type=get_enum_type(['NotSpecified', 'Completed', 'Enabled', 'Disabled', 'Deleted', 'Sus' + 'pended']), help='The workflow state.') + + with self.argument_context('logic integration-account update') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The resource group name.') + c.argument('name', options_list=[ + '--name', '-n'], help='The integration account name.') + c.argument('tags', tags_type, help='The resource tags.') + c.argument('sku', type=str, help='The integration account sku.') + c.argument('integration_service_environment', arg_type=CLIArgumentType(options_list=['--integration-service-env' + 'ironment'], help='The integration se' + 'rvice environment. See README.md For more information')) + c.argument('state', arg_type=get_enum_type(['NotSpecified', 'Completed', 'Enabled', 'Disabled', 'Deleted', 'Sus' + 'pended']), help='The workflow state.') + + with self.argument_context('logic integration-account delete') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The resource group name.') + c.argument('name', options_list=[ + '--name', '-n'], help='The integration account name.') + + with self.argument_context('logic integration-account import') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The resource group name.') + c.argument('name', options_list=[ + '--name', '-n'], help='The integration account name.') + c.argument('input_path', type=validate_file_or_dict, + help='Path to a intergration-account JSON file', completer=FilesCompleter()) + c.argument('location', arg_type=get_location_type( + self.cli_ctx), validator=get_default_location_from_resource_group) + c.argument('tags', tags_type, help='The resource tags.') + c.argument('sku', type=str, help='The integration account sku.') diff --git a/src/logic/azext_logic/generated/action.py b/src/logic/azext_logic/generated/action.py new file mode 100644 index 00000000000..d26df01fdf1 --- /dev/null +++ b/src/logic/azext_logic/generated/action.py @@ -0,0 +1,50 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=protected-access + +import argparse +from knack.util import CLIError + + +class AddIntegrationAccount(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.integration_account = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = dict(x.split('=', 1) for x in values) + except ValueError: + raise CLIError( + 'usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'id': + d['id'] = v + return d + + +class AddKeyVault(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.key_vault = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = dict(x.split('=', 1) for x in values) + except ValueError: + raise CLIError( + 'usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'name': + d['name'] = v + elif kl == 'id': + d['id'] = v + return d diff --git a/src/logic/azext_logic/generated/commands.py b/src/logic/azext_logic/generated/commands.py new file mode 100644 index 00000000000..cba2532585f --- /dev/null +++ b/src/logic/azext_logic/generated/commands.py @@ -0,0 +1,38 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + with self.command_group('logic', is_experimental=True): + pass + + from azext_logic.generated._client_factory import cf_workflow + logic_workflow = CliCommandType( + operations_tmpl='azext_logic.vendored_sdks.logic.operations._workflow_operations#WorkflowOperations.{}', + client_factory=cf_workflow) + with self.command_group('logic workflow', logic_workflow, client_factory=cf_workflow) as g: + g.custom_command('list', 'logic_workflow_list') + g.custom_show_command('show', 'logic_workflow_show') + g.custom_command('create', 'logic_workflow_create') + g.custom_command('update', 'logic_workflow_update') + g.custom_command('delete', 'logic_workflow_delete', confirmation=True) + + from azext_logic.generated._client_factory import cf_integration_account + logic_integration_account = CliCommandType( + operations_tmpl='azext_logic.vendored_sdks.logic.operations._integration_account_operations#IntegrationAccountO' + 'perations.{}', + client_factory=cf_integration_account) + with self.command_group('logic integration-account', logic_integration_account, + client_factory=cf_integration_account) as g: + g.custom_command('list', 'logic_integration_account_list') + g.custom_show_command('show', 'logic_integration_account_show') + g.custom_command('create', 'logic_integration_account_create') + g.custom_command('update', 'logic_integration_account_update') + g.custom_command( + 'delete', 'logic_integration_account_delete', confirmation=True) + g.custom_command('import', 'logic_integration_account_import') diff --git a/src/logic/azext_logic/generated/custom.py b/src/logic/azext_logic/generated/custom.py new file mode 100644 index 00000000000..3fbf50d7677 --- /dev/null +++ b/src/logic/azext_logic/generated/custom.py @@ -0,0 +1,176 @@ +# -------------------------------------------------------------------------------------------- +# 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 + +import json +from knack.util import CLIError + + +def logic_workflow_list(cmd, client, + resource_group_name=None, + top=None, + filter=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name, + top=top, + filter=filter) + return client.list_by_subscription(top=top, + filter=filter) + + +def logic_workflow_show(cmd, client, + resource_group_name, + name): + return client.get(resource_group_name=resource_group_name, + workflow_name=name) + + +def logic_workflow_create(cmd, client, + resource_group_name, + name, + definition, + location, + tags=None, + state=None, + endpoints_configuration=None, + access_control=None, + integration_account=None, + integration_service_environment=None): + + if 'definition' not in definition: + raise CLIError(str(definition) + + " does not contain a 'definition' key") + + return client.create_or_update(resource_group_name=resource_group_name, + workflow_name=name, + location=location, + tags=tags, + state=state, + endpoints_configuration=endpoints_configuration, + access_control=definition.get( + 'accessControl', access_control), + integration_account=integration_account, + integration_service_environment=integration_service_environment, + definition=definition['definition'], + parameters=definition.get('parameters', None)) + + +def logic_workflow_update(cmd, client, + resource_group_name, + name, + definition, + tags=None, + state=None): + + # check workflow exist before another update is done via a put + # per dicussion with the logic service team and to match powershells + # behavior + workflow = client.get(resource_group_name=resource_group_name, + workflow_name=name) + return logic_workflow_create(cmd, client, resource_group_name, name, + definition, workflow.location, + tags if tags else workflow.tags, + state if state else workflow.state, + workflow.endpoints_configuration, + workflow.integration_account, + workflow.integration_service_environment) + + +def logic_workflow_delete(cmd, client, + resource_group_name, + name): + return client.delete(resource_group_name=resource_group_name, + workflow_name=name) + + +def logic_integration_account_list(cmd, client, + resource_group_name=None, + top=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name, + top=top) + return client.list_by_subscription(top=top) + + +def logic_integration_account_show(cmd, client, + resource_group_name, + name): + return client.get(resource_group_name=resource_group_name, + integration_account_name=name) + + +def logic_integration_account_create(cmd, client, + resource_group_name, + name, + location=None, + tags=None, + sku=None, + integration_service_environment=None, + state=None): + if isinstance(integration_service_environment, str): + integration_service_environment = json.loads( + integration_service_environment) + return client.create_or_update(resource_group_name=resource_group_name, + integration_account_name=name, + location=location, + tags=tags, + sku={'name': sku}, + integration_service_environment=integration_service_environment, + state=state if state else 'Enabled') + # TODO: Work around for empty property serialization issue. + # Remove after LogicApp deploy the service fix. Contact: Rama Rayud" + + +def logic_integration_account_import(cmd, client, + resource_group_name, + name, + input_path, + location=None, + tags=None, + sku=None,): + + if 'properties' not in input_path: + raise CLIError(str(input_path) + + " does not contain a 'properties' key") + + integration_service_environment = input_path['properties'].get( + 'integrationServiceEnvironment', None) + return client.create_or_update(resource_group_name=resource_group_name, + integration_account_name=name, + location=input_path.get( + 'location', location), + tags=input_path.get('tags', tags), + sku=input_path.get('sku', {'name': sku}), + integration_service_environment=integration_service_environment, + state=input_path['properties'].get('state', 'Enabled')) + # TODO: Work around for empty property serialization issue. + # Remove after LogicApp deploy the service fix. Contact: Rama Rayud" + + +def logic_integration_account_update(cmd, client, + name, + resource_group_name, + tags=None, + sku=None, + integration_service_environment=None, + state=None): + + if isinstance(integration_service_environment, str): + integration_service_environment = json.loads( + integration_service_environment) + return client.update(resource_group_name=resource_group_name, + integration_account_name=name, + location=None, + tags=tags, + sku={'name': sku}, + integration_service_environment=integration_service_environment, + state=state) + + +def logic_integration_account_delete(cmd, client, + resource_group_name, + name): + return client.delete(resource_group_name=resource_group_name, + integration_account_name=name) diff --git a/src/logic/azext_logic/manual/__init__.py b/src/logic/azext_logic/manual/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/logic/azext_logic/manual/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/logic/azext_logic/tests/__init__.py b/src/logic/azext_logic/tests/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/logic/azext_logic/tests/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/logic/azext_logic/tests/latest/__init__.py b/src/logic/azext_logic/tests/latest/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/logic/azext_logic/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/logic/azext_logic/tests/latest/integration.json b/src/logic/azext_logic/tests/latest/integration.json new file mode 100644 index 00000000000..d8d7945ffb6 --- /dev/null +++ b/src/logic/azext_logic/tests/latest/integration.json @@ -0,0 +1,6 @@ +{"properties": {}, + "sku": { + "name": "Standard" + }, + "location": "centralus" +} \ No newline at end of file diff --git a/src/logic/azext_logic/tests/latest/recordings/test_logic.yaml b/src/logic/azext_logic/tests/latest/recordings/test_logic.yaml new file mode 100644 index 00000000000..62d86697521 --- /dev/null +++ b/src/logic/azext_logic/tests/latest/recordings/test_logic.yaml @@ -0,0 +1,665 @@ +interactions: +- request: + body: '{"location": "centralus", "sku": {"name": "Standard"}, "properties": {"state": + "Enabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic integration-account create + Connection: + - keep-alive + Content-Length: + - '90' + Content-Type: + - application/json + ParameterSetName: + - --location --sku --name --resource-group + User-Agent: + - AZURECLI/2.3.1 azsdk-python-logicmanagementclient/unknown Python/3.8.1 (Windows-10-10.0.19608-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000002/providers/Microsoft.Logic/integrationAccounts/cli_test_000004?api-version=2019-05-01 + response: + body: + string: '{"properties":{"state":"Enabled"},"sku":{"name":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000002/providers/Microsoft.Logic/integrationAccounts/cli_test_000004","name":"cli_test_000004","type":"Microsoft.Logic/integrationAccounts","location":"centralus"}' + headers: + cache-control: + - no-cache + content-length: + - '383' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 18:30:04 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: '{"location": "centralus", "sku": {"name": "Standard"}, "properties": {"state": + "Enabled"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic integration-account import + Connection: + - keep-alive + Content-Length: + - '90' + Content-Type: + - application/json + ParameterSetName: + - --location --input-path --name --resource-group + User-Agent: + - AZURECLI/2.3.1 azsdk-python-logicmanagementclient/unknown Python/3.8.1 (Windows-10-10.0.19608-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000002/providers/Microsoft.Logic/integrationAccounts/cli_test_000004?api-version=2019-05-01 + response: + body: + string: '{"properties":{"state":"Enabled"},"sku":{"name":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000002/providers/Microsoft.Logic/integrationAccounts/cli_test_000004","name":"cli_test_000004","type":"Microsoft.Logic/integrationAccounts","location":"centralus"}' + headers: + cache-control: + - no-cache + content-length: + - '383' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 18:30:06 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"location": "centralus", "properties": {"definition": {"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", + "actions": {}, "contentVersion": "1.0.0.0", "outputs": {}, "parameters": {"$connections": + {"defaultValue": {}, "type": "Object"}}, "triggers": {"When_a_feed_item_is_published": + {"inputs": {"host": {"connection": {"name": "@parameters(''$connections'')[''rss''][''connectionId'']"}}, + "method": "get", "path": "/OnNewFeed", "queries": {"feedUrl": "http://feeds.reuters.com/reuters/topNews"}}, + "recurrence": {"frequency": "Minute", "interval": 1}, "splitOn": "@triggerBody()?[''value'']", + "type": "ApiConnection"}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic workflow create + Connection: + - keep-alive + Content-Length: + - '682' + Content-Type: + - application/json + ParameterSetName: + - --resource-group --location --definition --name + User-Agent: + - AZURECLI/2.3.1 azsdk-python-logicmanagementclient/unknown Python/3.8.1 (Windows-10-10.0.19608-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000005?api-version=2019-05-01 + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","createdTime":"2020-04-23T18:30:07.7920849Z","changedTime":"2020-04-23T18:30:07.7807943Z","state":"Enabled","version":"08586139402777168780","accessEndpoint":"https://prod-04.centralus.logic.azure.com:443/workflows/92721b672a5b4aa4b9dd8b4f27d313b7","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"}},"triggers":{"When_a_feed_item_is_published":{"recurrence":{"frequency":"Minute","interval":1},"splitOn":"@triggerBody()?[''value'']","type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters(''$connections'')[''rss''][''connectionId'']"}},"method":"get","path":"/OnNewFeed","queries":{"feedUrl":"http://feeds.reuters.com/reuters/topNews"}}}},"actions":{},"outputs":{}},"parameters":{},"endpointsConfiguration":{"workflow":{"outgoingIpAddresses":[{"address":"13.67.236.125"},{"address":"104.208.25.27"},{"address":"40.122.170.198"},{"address":"40.113.218.230"},{"address":"23.100.86.139"},{"address":"23.100.87.24"},{"address":"23.100.87.56"},{"address":"23.100.82.16"}],"accessEndpointIpAddresses":[{"address":"13.67.236.76"},{"address":"40.77.111.254"},{"address":"40.77.31.87"},{"address":"104.43.243.39"}]},"connector":{"outgoingIpAddresses":[{"address":"13.89.171.80/28"},{"address":"40.122.49.51"},{"address":"52.173.245.164"},{"address":"52.173.241.27"}]}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000005","name":"cli_test_000005","type":"Microsoft.Logic/workflows","location":"centralus"}' + headers: + cache-control: + - no-cache + content-length: + - '1797' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 18:30:07 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic integration-account show + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group + User-Agent: + - AZURECLI/2.3.1 azsdk-python-logicmanagementclient/unknown Python/3.8.1 (Windows-10-10.0.19608-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000002/providers/Microsoft.Logic/integrationAccounts/cli_test_000004?api-version=2019-05-01 + response: + body: + string: '{"properties":{"state":"Enabled"},"sku":{"name":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000002/providers/Microsoft.Logic/integrationAccounts/cli_test_000004","name":"cli_test_000004","type":"Microsoft.Logic/integrationAccounts","location":"centralus"}' + headers: + cache-control: + - no-cache + content-length: + - '383' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 18:30:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic workflow show + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - AZURECLI/2.3.1 azsdk-python-logicmanagementclient/unknown Python/3.8.1 (Windows-10-10.0.19608-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000005?api-version=2019-05-01 + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","createdTime":"2020-04-23T18:30:07.7920849Z","changedTime":"2020-04-23T18:30:07.7807943Z","state":"Enabled","version":"08586139402777168780","accessEndpoint":"https://prod-04.centralus.logic.azure.com:443/workflows/92721b672a5b4aa4b9dd8b4f27d313b7","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"}},"triggers":{"When_a_feed_item_is_published":{"recurrence":{"frequency":"Minute","interval":1},"splitOn":"@triggerBody()?[''value'']","type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters(''$connections'')[''rss''][''connectionId'']"}},"method":"get","path":"/OnNewFeed","queries":{"feedUrl":"http://feeds.reuters.com/reuters/topNews"}}}},"actions":{},"outputs":{}},"parameters":{},"endpointsConfiguration":{"workflow":{"outgoingIpAddresses":[{"address":"13.67.236.125"},{"address":"104.208.25.27"},{"address":"40.122.170.198"},{"address":"40.113.218.230"},{"address":"23.100.86.139"},{"address":"23.100.87.24"},{"address":"23.100.87.56"},{"address":"23.100.82.16"}],"accessEndpointIpAddresses":[{"address":"13.67.236.76"},{"address":"40.77.111.254"},{"address":"40.77.31.87"},{"address":"104.43.243.39"}]},"connector":{"outgoingIpAddresses":[{"address":"13.89.171.80/28"},{"address":"40.122.49.51"},{"address":"52.173.245.164"},{"address":"52.173.241.27"}]}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000005","name":"cli_test_000005","type":"Microsoft.Logic/workflows","location":"centralus"}' + headers: + cache-control: + - no-cache + content-length: + - '1797' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 18:30:09 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '19999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic integration-account list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.3.1 azsdk-python-logicmanagementclient/unknown Python/3.8.1 (Windows-10-10.0.19608-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000002/providers/Microsoft.Logic/integrationAccounts?api-version=2019-05-01 + response: + body: + string: '{"value":[{"properties":{"state":"Enabled"},"sku":{"name":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000002/providers/Microsoft.Logic/integrationAccounts/cli_test_000004","name":"cli_test_000004","type":"Microsoft.Logic/integrationAccounts","location":"centralus"}]}' + headers: + cache-control: + - no-cache + content-length: + - '395' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 18:30:09 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic workflow list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.3.1 azsdk-python-logicmanagementclient/unknown Python/3.8.1 (Windows-10-10.0.19608-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows?api-version=2019-05-01 + response: + body: + string: '{"value":[{"properties":{"provisioningState":"Succeeded","createdTime":"2020-04-23T18:30:07.7920849Z","changedTime":"2020-04-23T18:30:07.7807943Z","state":"Enabled","version":"08586139402777168780","accessEndpoint":"https://prod-04.centralus.logic.azure.com:443/workflows/92721b672a5b4aa4b9dd8b4f27d313b7","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"}},"triggers":{"When_a_feed_item_is_published":{"recurrence":{"frequency":"Minute","interval":1},"splitOn":"@triggerBody()?[''value'']","type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters(''$connections'')[''rss''][''connectionId'']"}},"method":"get","path":"/OnNewFeed","queries":{"feedUrl":"http://feeds.reuters.com/reuters/topNews"}}}},"actions":{},"outputs":{}},"parameters":{},"endpointsConfiguration":{"workflow":{"outgoingIpAddresses":[{"address":"13.67.236.125"},{"address":"104.208.25.27"},{"address":"40.122.170.198"},{"address":"40.113.218.230"},{"address":"23.100.86.139"},{"address":"23.100.87.24"},{"address":"23.100.87.56"},{"address":"23.100.82.16"}],"accessEndpointIpAddresses":[{"address":"13.67.236.76"},{"address":"40.77.111.254"},{"address":"40.77.31.87"},{"address":"104.43.243.39"}]},"connector":{"outgoingIpAddresses":[{"address":"13.89.171.80/28"},{"address":"40.122.49.51"},{"address":"52.173.245.164"},{"address":"52.173.241.27"}]}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000005","name":"cli_test_000005","type":"Microsoft.Logic/workflows","location":"centralus"}]}' + headers: + cache-control: + - no-cache + content-length: + - '1809' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 18:30:11 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '19999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic integration-account list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.3.1 azsdk-python-logicmanagementclient/unknown Python/3.8.1 (Windows-10-10.0.19608-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Logic/integrationAccounts?api-version=2019-05-01 + response: + body: + string: '{"value":[{"properties":{"state":"Enabled"},"sku":{"name":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000002/providers/Microsoft.Logic/integrationAccounts/cli_test_000004","name":"cli_test_000004","type":"Microsoft.Logic/integrationAccounts","location":"centralus"},{"properties":{"state":"Enabled"},"sku":{"name":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/stevens-rg/providers/Microsoft.Logic/integrationAccounts/test-inta","name":"test-inta","type":"Microsoft.Logic/integrationAccounts","location":"centralus"}]}' + headers: + cache-control: + - no-cache + content-length: + - '681' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 18:30:11 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic workflow list + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.3.1 azsdk-python-logicmanagementclient/unknown Python/3.8.1 (Windows-10-10.0.19608-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Logic/workflows?api-version=2019-05-01 + response: + body: + string: '{"value":[{"properties":{"provisioningState":"Succeeded","createdTime":"2020-04-23T18:30:07.7920849Z","changedTime":"2020-04-23T18:30:07.7807943Z","state":"Enabled","version":"08586139402777168780","accessEndpoint":"https://prod-04.centralus.logic.azure.com:443/workflows/92721b672a5b4aa4b9dd8b4f27d313b7","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"}},"triggers":{"When_a_feed_item_is_published":{"recurrence":{"frequency":"Minute","interval":1},"splitOn":"@triggerBody()?[''value'']","type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters(''$connections'')[''rss''][''connectionId'']"}},"method":"get","path":"/OnNewFeed","queries":{"feedUrl":"http://feeds.reuters.com/reuters/topNews"}}}},"actions":{},"outputs":{}},"parameters":{},"endpointsConfiguration":{"workflow":{"outgoingIpAddresses":[{"address":"13.67.236.125"},{"address":"104.208.25.27"},{"address":"40.122.170.198"},{"address":"40.113.218.230"},{"address":"23.100.86.139"},{"address":"23.100.87.24"},{"address":"23.100.87.56"},{"address":"23.100.82.16"}],"accessEndpointIpAddresses":[{"address":"13.67.236.76"},{"address":"40.77.111.254"},{"address":"40.77.31.87"},{"address":"104.43.243.39"}]},"connector":{"outgoingIpAddresses":[{"address":"13.89.171.80/28"},{"address":"40.122.49.51"},{"address":"52.173.245.164"},{"address":"52.173.241.27"}]}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000005","name":"cli_test_000005","type":"Microsoft.Logic/workflows","location":"centralus"},{"properties":{"provisioningState":"Succeeded","createdTime":"2020-03-04T21:04:27.8470467Z","changedTime":"2020-03-23T16:53:56.4201392Z","state":"Disabled","version":"08586166244495864249","accessEndpoint":"https://prod-08.centralus.logic.azure.com:443/workflows/02b0a0de204149d1a14c558ff3da9c1f","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"}},"triggers":{"Check_travel_time_every_weekday_morning":{"recurrence":{"frequency":"Week","interval":1,"schedule":{"hours":["7","8","9","6","5"],"minutes":[0,15,30,45],"weekDays":["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}},"type":"Recurrence"}},"actions":{"Condition":{"actions":{},"runAfter":{"Initialize_variable":["Succeeded"]},"expression":{"and":[{"greater":["@variables(''travelTime'')",15]}]},"type":"If"},"Get_route":{"runAfter":{},"type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters(''$connections'')[''bingmaps''][''connectionId'']"}},"method":"get","path":"/REST/V1/Routes/Driving","queries":{"distanceUnit":"Mile","optimize":"timeWithTraffic","travelMode":"Driving","wp.0":"1717 + 22nd AveSeattle, WA 98122","wp.1":"15701 NE 39th St, Redmond, WA 98052"}}},"Initialize_variable":{"runAfter":{"Get_route":["Succeeded"]},"type":"InitializeVariable","inputs":{"variables":[{"name":"travelTime","type":"integer","value":"@div(body(''Get_route'')?[''travelDuration''],60)"}]}},"Send_an_email_(V2)":{"runAfter":{"Condition":["Succeeded"]},"type":"ApiConnection","inputs":{"body":{"Body":"

Extra + travel time: @{sub(variables(''travelTime''),15)}

","Subject":"Current + Travel Time: @{variables(''travelTime'')}","To":"stevens@microsoft.com"},"host":{"connection":{"name":"@parameters(''$connections'')[''office365''][''connectionId'']"}},"method":"post","path":"/v2/Mail"}}},"outputs":{}},"parameters":{"$connections":{"value":{"bingmaps":{"connectionId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/stevens-rg/providers/Microsoft.Web/connections/bingmaps","connectionName":"bingmaps","id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/locations/centralus/managedApis/bingmaps"},"office365":{"connectionId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/stevens-rg/providers/Microsoft.Web/connections/office365","connectionName":"office365","id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/locations/centralus/managedApis/office365"}}}},"endpointsConfiguration":{"workflow":{"outgoingIpAddresses":[{"address":"13.67.236.125"},{"address":"104.208.25.27"},{"address":"40.122.170.198"},{"address":"40.113.218.230"},{"address":"23.100.86.139"},{"address":"23.100.87.24"},{"address":"23.100.87.56"},{"address":"23.100.82.16"}],"accessEndpointIpAddresses":[{"address":"13.67.236.76"},{"address":"40.77.111.254"},{"address":"40.77.31.87"},{"address":"104.43.243.39"}]},"connector":{"outgoingIpAddresses":[{"address":"13.89.171.80/28"},{"address":"40.122.49.51"},{"address":"52.173.245.164"},{"address":"52.173.241.27"}]}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/stevens-rg/providers/Microsoft.Logic/workflows/LA-TravelTime","name":"LA-TravelTime","type":"Microsoft.Logic/workflows","location":"centralus","tags":{},"identity":{"type":"UserAssigned","userAssignedIdentities":{"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/stevens-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/stevens-id":{"principalId":"76fdb419-8277-4a60-8bcc-92cf9cd10585","clientId":"abd47fa5-87d5-4945-a2ec-406149182d16"}}}},{"properties":{"provisioningState":"Succeeded","createdTime":"2020-03-11T20:52:44.0617207Z","changedTime":"2020-03-30T22:38:57.3670024Z","state":"Disabled","version":"08586159989481414063","accessEndpoint":"https://prod-00.centralus.logic.azure.com:443/workflows/2755ab77e6124a3793b5f1bfdf1d97e3","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"}},"triggers":{"When_a_feed_item_is_published":{"recurrence":{"frequency":"Minute","interval":1},"splitOn":"@triggerBody()?[''value'']","type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters(''$connections'')[''rss''][''connectionId'']"}},"method":"get","path":"/OnNewFeed","queries":{"feedUrl":"http://feeds.reuters.com/reuters/topNews"}}}},"actions":{},"outputs":{}},"parameters":{"$connections":{"value":{"rss":{"connectionId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/stevens-rg/providers/Microsoft.Web/connections/rss","connectionName":"rss","id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Web/locations/centralus/managedApis/rss"}}}},"endpointsConfiguration":{"workflow":{"outgoingIpAddresses":[{"address":"13.67.236.125"},{"address":"104.208.25.27"},{"address":"40.122.170.198"},{"address":"40.113.218.230"},{"address":"23.100.86.139"},{"address":"23.100.87.24"},{"address":"23.100.87.56"},{"address":"23.100.82.16"}],"accessEndpointIpAddresses":[{"address":"13.67.236.76"},{"address":"40.77.111.254"},{"address":"40.77.31.87"},{"address":"104.43.243.39"}]},"connector":{"outgoingIpAddresses":[{"address":"13.89.171.80/28"},{"address":"40.122.49.51"},{"address":"52.173.245.164"},{"address":"52.173.241.27"}]}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/stevens-rg/providers/Microsoft.Logic/workflows/simple-logic","name":"simple-logic","type":"Microsoft.Logic/workflows","location":"centralus","tags":{}}]}' + headers: + cache-control: + - no-cache + content-length: + - '7565' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 18:30:12 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '19999' + status: + code: 200 + message: OK +- request: + body: '{"sku": {"name": "Basic"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic integration-account update + Connection: + - keep-alive + Content-Length: + - '26' + Content-Type: + - application/json + ParameterSetName: + - --sku --name --resource-group + User-Agent: + - AZURECLI/2.3.1 azsdk-python-logicmanagementclient/unknown Python/3.8.1 (Windows-10-10.0.19608-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000002/providers/Microsoft.Logic/integrationAccounts/cli_test_000004?api-version=2019-05-01 + response: + body: + string: '{"properties":{"state":"Enabled"},"sku":{"name":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000002/providers/Microsoft.Logic/integrationAccounts/cli_test_000004","name":"cli_test_000004","type":"Microsoft.Logic/integrationAccounts","location":"centralus"}' + headers: + cache-control: + - no-cache + content-length: + - '380' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 18:30:15 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic workflow update + Connection: + - keep-alive + ParameterSetName: + - --resource-group --tag --definition --name + User-Agent: + - AZURECLI/2.3.1 azsdk-python-logicmanagementclient/unknown Python/3.8.1 (Windows-10-10.0.19608-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000005?api-version=2019-05-01 + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","createdTime":"2020-04-23T18:30:07.7920849Z","changedTime":"2020-04-23T18:30:07.7807943Z","state":"Enabled","version":"08586139402777168780","accessEndpoint":"https://prod-04.centralus.logic.azure.com:443/workflows/92721b672a5b4aa4b9dd8b4f27d313b7","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"}},"triggers":{"When_a_feed_item_is_published":{"recurrence":{"frequency":"Minute","interval":1},"splitOn":"@triggerBody()?[''value'']","type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters(''$connections'')[''rss''][''connectionId'']"}},"method":"get","path":"/OnNewFeed","queries":{"feedUrl":"http://feeds.reuters.com/reuters/topNews"}}}},"actions":{},"outputs":{}},"parameters":{},"endpointsConfiguration":{"workflow":{"outgoingIpAddresses":[{"address":"13.67.236.125"},{"address":"104.208.25.27"},{"address":"40.122.170.198"},{"address":"40.113.218.230"},{"address":"23.100.86.139"},{"address":"23.100.87.24"},{"address":"23.100.87.56"},{"address":"23.100.82.16"}],"accessEndpointIpAddresses":[{"address":"13.67.236.76"},{"address":"40.77.111.254"},{"address":"40.77.31.87"},{"address":"104.43.243.39"}]},"connector":{"outgoingIpAddresses":[{"address":"13.89.171.80/28"},{"address":"40.122.49.51"},{"address":"52.173.245.164"},{"address":"52.173.241.27"}]}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000005","name":"cli_test_000005","type":"Microsoft.Logic/workflows","location":"centralus"}' + headers: + cache-control: + - no-cache + content-length: + - '1797' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 18:30:15 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '19999' + status: + code: 200 + message: OK +- request: + body: '{"location": "centralus", "tags": {"atag": "123"}, "properties": {"state": + "Enabled", "endpointsConfiguration": {"workflow": {"outgoingIpAddresses": [{"address": + "13.67.236.125"}, {"address": "104.208.25.27"}, {"address": "40.122.170.198"}, + {"address": "40.113.218.230"}, {"address": "23.100.86.139"}, {"address": "23.100.87.24"}, + {"address": "23.100.87.56"}, {"address": "23.100.82.16"}], "accessEndpointIpAddresses": + [{"address": "13.67.236.76"}, {"address": "40.77.111.254"}, {"address": "40.77.31.87"}, + {"address": "104.43.243.39"}]}, "connector": {"outgoingIpAddresses": [{"address": + "13.89.171.80/28"}, {"address": "40.122.49.51"}, {"address": "52.173.245.164"}, + {"address": "52.173.241.27"}]}}, "definition": {"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", + "actions": {}, "contentVersion": "1.0.0.0", "outputs": {}, "parameters": {"$connections": + {"defaultValue": {}, "type": "Object"}}, "triggers": {"When_a_feed_item_is_published": + {"inputs": {"host": {"connection": {"name": "@parameters(''$connections'')[''rss''][''connectionId'']"}}, + "method": "get", "path": "/OnNewFeed", "queries": {"feedUrl": "http://feeds.reuters.com/reuters/topNews"}}, + "recurrence": {"frequency": "Minute", "interval": 2}, "splitOn": "@triggerBody()?[''value'']", + "type": "ApiConnection"}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - logic workflow update + Connection: + - keep-alive + Content-Length: + - '1343' + Content-Type: + - application/json + ParameterSetName: + - --resource-group --tag --definition --name + User-Agent: + - AZURECLI/2.3.1 azsdk-python-logicmanagementclient/unknown Python/3.8.1 (Windows-10-10.0.19608-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000005?api-version=2019-05-01 + response: + body: + string: '{"properties":{"provisioningState":"Succeeded","createdTime":"2020-04-23T18:30:16.6182939Z","changedTime":"2020-04-23T18:30:16.6104864Z","state":"Enabled","version":"08586139402688746929","accessEndpoint":"https://prod-04.centralus.logic.azure.com:443/workflows/92721b672a5b4aa4b9dd8b4f27d313b7","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"}},"triggers":{"When_a_feed_item_is_published":{"recurrence":{"frequency":"Minute","interval":2},"splitOn":"@triggerBody()?[''value'']","type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters(''$connections'')[''rss''][''connectionId'']"}},"method":"get","path":"/OnNewFeed","queries":{"feedUrl":"http://feeds.reuters.com/reuters/topNews"}}}},"actions":{},"outputs":{}},"parameters":{},"endpointsConfiguration":{"workflow":{"outgoingIpAddresses":[{"address":"13.67.236.125"},{"address":"104.208.25.27"},{"address":"40.122.170.198"},{"address":"40.113.218.230"},{"address":"23.100.86.139"},{"address":"23.100.87.24"},{"address":"23.100.87.56"},{"address":"23.100.82.16"}],"accessEndpointIpAddresses":[{"address":"13.67.236.76"},{"address":"40.77.111.254"},{"address":"40.77.31.87"},{"address":"104.43.243.39"}]},"connector":{"outgoingIpAddresses":[{"address":"13.89.171.80/28"},{"address":"40.122.49.51"},{"address":"52.173.245.164"},{"address":"52.173.241.27"}]}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000005","name":"cli_test_000005","type":"Microsoft.Logic/workflows","location":"centralus","tags":{"atag":"123"}}' + headers: + cache-control: + - no-cache + content-length: + - '1819' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 18:30:16 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - logic workflow delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --resource-group --name -y + User-Agent: + - AZURECLI/2.3.1 azsdk-python-logicmanagementclient/unknown Python/3.8.1 (Windows-10-10.0.19608-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Logic/workflows/cli_test_000005?api-version=2019-05-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 18:30:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - logic integration-account delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name --resource-group -y + User-Agent: + - AZURECLI/2.3.1 azsdk-python-logicmanagementclient/unknown Python/3.8.1 (Windows-10-10.0.19608-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000002/providers/Microsoft.Logic/integrationAccounts/cli_test_000004?api-version=2019-05-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 18:30:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/logic/azext_logic/tests/latest/test_logic_scenario.py b/src/logic/azext_logic/tests/latest/test_logic_scenario.py new file mode 100644 index 00000000000..1bfdda33e6b --- /dev/null +++ b/src/logic/azext_logic/tests/latest/test_logic_scenario.py @@ -0,0 +1,109 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +import unittest + +from azure.cli.testsdk import JMESPathCheck +from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class LogicManagementClientScenarioTest(ScenarioTest): + + def current_subscription(self): + subs = self.cmd('az account show').get_output_in_json() + return subs['id'] + + @ResourceGroupPreparer(name_prefix='cli_test_logic_test-resource-group'[:9], key='rg') + @ResourceGroupPreparer(name_prefix='cli_test_logic_testResourceGroup'[:9], key='rg_2') + def test_logic(self, resource_group): + + self.kwargs.update({ + 'subscription_id': self.current_subscription() + }) + + self.kwargs.update({ + 'testIntegrationAccount': self.create_random_name(prefix='cli_test_integration_accounts'[:9], length=24), + 'IntegrationAccounts_2': self.create_random_name(prefix='cli_test_integration_accounts'[:9], length=24), + 'testWorkflow': self.create_random_name(prefix='cli_test_workflows'[:9], length=24), + 'Workflows_2': self.create_random_name(prefix='cli_test_workflows'[:9], length=24), + 'Workflows_3': self.create_random_name(prefix='cli_test_workflows'[:9], length=24), + }) + + self.cmd('az logic integration-account create ' + '--location "centralus" ' + '--sku Standard ' + '--name "{IntegrationAccounts_2}" ' + '--resource-group "{rg_2}" ', + checks=[JMESPathCheck('name', self.kwargs.get('IntegrationAccounts_2', ''))]) + + self.cmd('az logic integration-account import ' + '--location "centralus" ' + '--input-path "src/logic/azext_logic/tests/latest/integration.json" ' + '--name "{IntegrationAccounts_2}" ' + '--resource-group "{rg_2}" ', + checks=[JMESPathCheck('name', self.kwargs.get('IntegrationAccounts_2', ''))]) + + self.cmd('az logic workflow create ' + '--resource-group "{rg}" ' + '--location "centralus" ' + '--definition "src/logic/azext_logic/tests/latest/workflow.json" ' + '--name "{testWorkflow}"', + checks=[JMESPathCheck('name', self.kwargs.get('testWorkflow', ''))]) + + self.cmd('az logic integration-account show ' + '--name "{IntegrationAccounts_2}" ' + '--resource-group "{rg_2}"', + checks=[JMESPathCheck('name', self.kwargs.get('IntegrationAccounts_2', ''))]) + + self.cmd('az logic workflow show ' + '--resource-group "{rg}" ' + '--name "{testWorkflow}"', + checks=[JMESPathCheck('name', self.kwargs.get('testWorkflow', ''))]) + + self.cmd('az logic integration-account list ' + '--resource-group "{rg_2}"', + checks=[JMESPathCheck('[0].name', self.kwargs.get('IntegrationAccounts_2', ''))]) + + self.cmd('az logic workflow list ' + '--resource-group "{rg}"', + checks=[JMESPathCheck('[0].name', self.kwargs.get('testWorkflow', ''))]) + + self.cmd('az logic integration-account list', + checks=[JMESPathCheck('[0].name', self.kwargs.get('IntegrationAccounts_2', ''))]) + + self.cmd('az logic workflow list', + checks=[JMESPathCheck('[0].name', self.kwargs.get('testWorkflow', ''))]) + + self.cmd('az logic integration-account update ' + '--sku Basic ' + '--name "{IntegrationAccounts_2}" ' + '--resource-group "{rg_2}"', + checks=[JMESPathCheck('sku.name', 'Basic')]) + + self.cmd('az logic workflow update ' + '--resource-group "{rg}" ' + '--tag atag=123 ' + '--definition "src/logic/azext_logic/tests/latest/workflowupdate.json" ' + '--name "{testWorkflow}"', + checks=[JMESPathCheck('tags.atag', 123), + JMESPathCheck('definition.triggers.When_a_feed_item_is_published.recurrence.interval', 2)]) + + self.cmd('az logic workflow delete ' + '--resource-group "{rg}" ' + '--name "{testWorkflow}" ' + '-y', + checks=[]) + + self.cmd('az logic integration-account delete ' + '--name "{IntegrationAccounts_2}" ' + '--resource-group "{rg_2}" ' + '-y', + checks=[]) diff --git a/src/logic/azext_logic/tests/latest/workflow.json b/src/logic/azext_logic/tests/latest/workflow.json new file mode 100644 index 00000000000..b4b4b4b8534 --- /dev/null +++ b/src/logic/azext_logic/tests/latest/workflow.json @@ -0,0 +1,35 @@ +{ "definition": { + "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", + "actions": {}, + "contentVersion": "1.0.0.0", + "outputs": {}, + "parameters": { + "$connections": { + "defaultValue": {}, + "type": "Object" + } + }, + "triggers": { + "When_a_feed_item_is_published": { + "inputs": { + "host": { + "connection": { + "name": "@parameters('$connections')['rss']['connectionId']" + } + }, + "method": "get", + "path": "/OnNewFeed", + "queries": { + "feedUrl": "http://feeds.reuters.com/reuters/topNews" + } + }, + "recurrence": { + "frequency": "Minute", + "interval": 1 + }, + "splitOn": "@triggerBody()?['value']", + "type": "ApiConnection" + } + } + } + } \ No newline at end of file diff --git a/src/logic/azext_logic/tests/latest/workflowupdate.json b/src/logic/azext_logic/tests/latest/workflowupdate.json new file mode 100644 index 00000000000..4d1b9830e84 --- /dev/null +++ b/src/logic/azext_logic/tests/latest/workflowupdate.json @@ -0,0 +1,35 @@ +{ "definition": { + "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", + "actions": {}, + "contentVersion": "1.0.0.0", + "outputs": {}, + "parameters": { + "$connections": { + "defaultValue": {}, + "type": "Object" + } + }, + "triggers": { + "When_a_feed_item_is_published": { + "inputs": { + "host": { + "connection": { + "name": "@parameters('$connections')['rss']['connectionId']" + } + }, + "method": "get", + "path": "/OnNewFeed", + "queries": { + "feedUrl": "http://feeds.reuters.com/reuters/topNews" + } + }, + "recurrence": { + "frequency": "Minute", + "interval": 2 + }, + "splitOn": "@triggerBody()?['value']", + "type": "ApiConnection" + } + } + } + } \ No newline at end of file diff --git a/src/logic/azext_logic/vendored_sdks/__init__.py b/src/logic/azext_logic/vendored_sdks/__init__.py new file mode 100644 index 00000000000..be1a152630c --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/src/logic/azext_logic/vendored_sdks/logic/__init__.py b/src/logic/azext_logic/vendored_sdks/logic/__init__.py new file mode 100644 index 00000000000..6763259b4b0 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._logic_management_client import LogicManagementClient +__all__ = ['LogicManagementClient'] diff --git a/src/logic/azext_logic/vendored_sdks/logic/_configuration.py b/src/logic/azext_logic/vendored_sdks/logic/_configuration.py new file mode 100644 index 00000000000..7c60bd09ba3 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/_configuration.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +VERSION = "unknown" + +class LogicManagementClientConfiguration(Configuration): + """Configuration for LogicManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The subscription id. + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(LogicManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2019-05-01" + kwargs.setdefault('sdk_moniker', 'logicmanagementclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, **kwargs) diff --git a/src/logic/azext_logic/vendored_sdks/logic/_logic_management_client.py b/src/logic/azext_logic/vendored_sdks/logic/_logic_management_client.py new file mode 100644 index 00000000000..0d8dfe51233 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/_logic_management_client.py @@ -0,0 +1,192 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.core import PipelineClient +from msrest import Deserializer, Serializer + +from ._configuration import LogicManagementClientConfiguration +from .operations import WorkflowOperations +from .operations import WorkflowVersionOperations +from .operations import WorkflowTriggerOperations +from .operations import WorkflowVersionTriggerOperations +from .operations import WorkflowTriggerHistoryOperations +from .operations import WorkflowRunOperations +from .operations import WorkflowRunActionOperations +from .operations import WorkflowRunActionRepetitionOperations +from .operations import WorkflowRunActionRepetitionRequestHistoryOperations +from .operations import WorkflowRunActionRequestHistoryOperations +from .operations import WorkflowRunActionScopeRepetitionOperations +from .operations import WorkflowRunOperationOperations +from .operations import IntegrationAccountOperations +from .operations import IntegrationAccountAssemblyOperations +from .operations import IntegrationAccountBatchConfigurationOperations +from .operations import IntegrationAccountSchemaOperations +from .operations import IntegrationAccountMapOperations +from .operations import IntegrationAccountPartnerOperations +from .operations import IntegrationAccountAgreementOperations +from .operations import IntegrationAccountCertificateOperations +from .operations import IntegrationAccountSessionOperations +from .operations import IntegrationServiceEnvironmentOperations +from .operations import IntegrationServiceEnvironmentSkuOperations +from .operations import IntegrationServiceEnvironmentNetworkHealthOperations +from .operations import IntegrationServiceEnvironmentManagedApiOperations +from .operations import IntegrationServiceEnvironmentManagedApiOperationOperations +from .operations import OperationOperations +from . import models + + +class LogicManagementClient(object): + """REST API for Azure Logic Apps. + + :ivar workflow: WorkflowOperations operations + :vartype workflow: logic_management_client.operations.WorkflowOperations + :ivar workflow_version: WorkflowVersionOperations operations + :vartype workflow_version: logic_management_client.operations.WorkflowVersionOperations + :ivar workflow_trigger: WorkflowTriggerOperations operations + :vartype workflow_trigger: logic_management_client.operations.WorkflowTriggerOperations + :ivar workflow_version_trigger: WorkflowVersionTriggerOperations operations + :vartype workflow_version_trigger: logic_management_client.operations.WorkflowVersionTriggerOperations + :ivar workflow_trigger_history: WorkflowTriggerHistoryOperations operations + :vartype workflow_trigger_history: logic_management_client.operations.WorkflowTriggerHistoryOperations + :ivar workflow_run: WorkflowRunOperations operations + :vartype workflow_run: logic_management_client.operations.WorkflowRunOperations + :ivar workflow_run_action: WorkflowRunActionOperations operations + :vartype workflow_run_action: logic_management_client.operations.WorkflowRunActionOperations + :ivar workflow_run_action_repetition: WorkflowRunActionRepetitionOperations operations + :vartype workflow_run_action_repetition: logic_management_client.operations.WorkflowRunActionRepetitionOperations + :ivar workflow_run_action_repetition_request_history: WorkflowRunActionRepetitionRequestHistoryOperations operations + :vartype workflow_run_action_repetition_request_history: logic_management_client.operations.WorkflowRunActionRepetitionRequestHistoryOperations + :ivar workflow_run_action_request_history: WorkflowRunActionRequestHistoryOperations operations + :vartype workflow_run_action_request_history: logic_management_client.operations.WorkflowRunActionRequestHistoryOperations + :ivar workflow_run_action_scope_repetition: WorkflowRunActionScopeRepetitionOperations operations + :vartype workflow_run_action_scope_repetition: logic_management_client.operations.WorkflowRunActionScopeRepetitionOperations + :ivar workflow_run_operation: WorkflowRunOperationOperations operations + :vartype workflow_run_operation: logic_management_client.operations.WorkflowRunOperationOperations + :ivar integration_account: IntegrationAccountOperations operations + :vartype integration_account: logic_management_client.operations.IntegrationAccountOperations + :ivar integration_account_assembly: IntegrationAccountAssemblyOperations operations + :vartype integration_account_assembly: logic_management_client.operations.IntegrationAccountAssemblyOperations + :ivar integration_account_batch_configuration: IntegrationAccountBatchConfigurationOperations operations + :vartype integration_account_batch_configuration: logic_management_client.operations.IntegrationAccountBatchConfigurationOperations + :ivar integration_account_schema: IntegrationAccountSchemaOperations operations + :vartype integration_account_schema: logic_management_client.operations.IntegrationAccountSchemaOperations + :ivar integration_account_map: IntegrationAccountMapOperations operations + :vartype integration_account_map: logic_management_client.operations.IntegrationAccountMapOperations + :ivar integration_account_partner: IntegrationAccountPartnerOperations operations + :vartype integration_account_partner: logic_management_client.operations.IntegrationAccountPartnerOperations + :ivar integration_account_agreement: IntegrationAccountAgreementOperations operations + :vartype integration_account_agreement: logic_management_client.operations.IntegrationAccountAgreementOperations + :ivar integration_account_certificate: IntegrationAccountCertificateOperations operations + :vartype integration_account_certificate: logic_management_client.operations.IntegrationAccountCertificateOperations + :ivar integration_account_session: IntegrationAccountSessionOperations operations + :vartype integration_account_session: logic_management_client.operations.IntegrationAccountSessionOperations + :ivar integration_service_environment: IntegrationServiceEnvironmentOperations operations + :vartype integration_service_environment: logic_management_client.operations.IntegrationServiceEnvironmentOperations + :ivar integration_service_environment_sku: IntegrationServiceEnvironmentSkuOperations operations + :vartype integration_service_environment_sku: logic_management_client.operations.IntegrationServiceEnvironmentSkuOperations + :ivar integration_service_environment_network_health: IntegrationServiceEnvironmentNetworkHealthOperations operations + :vartype integration_service_environment_network_health: logic_management_client.operations.IntegrationServiceEnvironmentNetworkHealthOperations + :ivar integration_service_environment_managed_api: IntegrationServiceEnvironmentManagedApiOperations operations + :vartype integration_service_environment_managed_api: logic_management_client.operations.IntegrationServiceEnvironmentManagedApiOperations + :ivar integration_service_environment_managed_api_operation: IntegrationServiceEnvironmentManagedApiOperationOperations operations + :vartype integration_service_environment_managed_api_operation: logic_management_client.operations.IntegrationServiceEnvironmentManagedApiOperationOperations + :ivar operation: OperationOperations operations + :vartype operation: logic_management_client.operations.OperationOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The subscription id. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = LogicManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.workflow = WorkflowOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_version = WorkflowVersionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_trigger = WorkflowTriggerOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_version_trigger = WorkflowVersionTriggerOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_trigger_history = WorkflowTriggerHistoryOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_run = WorkflowRunOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_run_action = WorkflowRunActionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_run_action_repetition = WorkflowRunActionRepetitionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_run_action_repetition_request_history = WorkflowRunActionRepetitionRequestHistoryOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_run_action_request_history = WorkflowRunActionRequestHistoryOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_run_action_scope_repetition = WorkflowRunActionScopeRepetitionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_run_operation = WorkflowRunOperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account = IntegrationAccountOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_assembly = IntegrationAccountAssemblyOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_batch_configuration = IntegrationAccountBatchConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_schema = IntegrationAccountSchemaOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_map = IntegrationAccountMapOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_partner = IntegrationAccountPartnerOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_agreement = IntegrationAccountAgreementOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_certificate = IntegrationAccountCertificateOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_session = IntegrationAccountSessionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_service_environment = IntegrationServiceEnvironmentOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_service_environment_sku = IntegrationServiceEnvironmentSkuOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_service_environment_network_health = IntegrationServiceEnvironmentNetworkHealthOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_service_environment_managed_api = IntegrationServiceEnvironmentManagedApiOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_service_environment_managed_api_operation = IntegrationServiceEnvironmentManagedApiOperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> LogicManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/__init__.py b/src/logic/azext_logic/vendored_sdks/logic/aio/__init__.py new file mode 100644 index 00000000000..d1722987ad7 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._logic_management_client_async import LogicManagementClient +__all__ = ['LogicManagementClient'] diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/_configuration_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/_configuration_async.py new file mode 100644 index 00000000000..1f3e4885bbf --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/_configuration_async.py @@ -0,0 +1,59 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +VERSION = "unknown" + +class LogicManagementClientConfiguration(Configuration): + """Configuration for LogicManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The subscription id. + :type subscription_id: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(LogicManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2019-05-01" + kwargs.setdefault('sdk_moniker', 'logicmanagementclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, **kwargs) diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/_logic_management_client_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/_logic_management_client_async.py new file mode 100644 index 00000000000..31b6bf138b3 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/_logic_management_client_async.py @@ -0,0 +1,188 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.core import AsyncPipelineClient +from msrest import Deserializer, Serializer + +from ._configuration_async import LogicManagementClientConfiguration +from .operations_async import WorkflowOperations +from .operations_async import WorkflowVersionOperations +from .operations_async import WorkflowTriggerOperations +from .operations_async import WorkflowVersionTriggerOperations +from .operations_async import WorkflowTriggerHistoryOperations +from .operations_async import WorkflowRunOperations +from .operations_async import WorkflowRunActionOperations +from .operations_async import WorkflowRunActionRepetitionOperations +from .operations_async import WorkflowRunActionRepetitionRequestHistoryOperations +from .operations_async import WorkflowRunActionRequestHistoryOperations +from .operations_async import WorkflowRunActionScopeRepetitionOperations +from .operations_async import WorkflowRunOperationOperations +from .operations_async import IntegrationAccountOperations +from .operations_async import IntegrationAccountAssemblyOperations +from .operations_async import IntegrationAccountBatchConfigurationOperations +from .operations_async import IntegrationAccountSchemaOperations +from .operations_async import IntegrationAccountMapOperations +from .operations_async import IntegrationAccountPartnerOperations +from .operations_async import IntegrationAccountAgreementOperations +from .operations_async import IntegrationAccountCertificateOperations +from .operations_async import IntegrationAccountSessionOperations +from .operations_async import IntegrationServiceEnvironmentOperations +from .operations_async import IntegrationServiceEnvironmentSkuOperations +from .operations_async import IntegrationServiceEnvironmentNetworkHealthOperations +from .operations_async import IntegrationServiceEnvironmentManagedApiOperations +from .operations_async import IntegrationServiceEnvironmentManagedApiOperationOperations +from .operations_async import OperationOperations +from .. import models + + +class LogicManagementClient(object): + """REST API for Azure Logic Apps. + + :ivar workflow: WorkflowOperations operations + :vartype workflow: logic_management_client.aio.operations_async.WorkflowOperations + :ivar workflow_version: WorkflowVersionOperations operations + :vartype workflow_version: logic_management_client.aio.operations_async.WorkflowVersionOperations + :ivar workflow_trigger: WorkflowTriggerOperations operations + :vartype workflow_trigger: logic_management_client.aio.operations_async.WorkflowTriggerOperations + :ivar workflow_version_trigger: WorkflowVersionTriggerOperations operations + :vartype workflow_version_trigger: logic_management_client.aio.operations_async.WorkflowVersionTriggerOperations + :ivar workflow_trigger_history: WorkflowTriggerHistoryOperations operations + :vartype workflow_trigger_history: logic_management_client.aio.operations_async.WorkflowTriggerHistoryOperations + :ivar workflow_run: WorkflowRunOperations operations + :vartype workflow_run: logic_management_client.aio.operations_async.WorkflowRunOperations + :ivar workflow_run_action: WorkflowRunActionOperations operations + :vartype workflow_run_action: logic_management_client.aio.operations_async.WorkflowRunActionOperations + :ivar workflow_run_action_repetition: WorkflowRunActionRepetitionOperations operations + :vartype workflow_run_action_repetition: logic_management_client.aio.operations_async.WorkflowRunActionRepetitionOperations + :ivar workflow_run_action_repetition_request_history: WorkflowRunActionRepetitionRequestHistoryOperations operations + :vartype workflow_run_action_repetition_request_history: logic_management_client.aio.operations_async.WorkflowRunActionRepetitionRequestHistoryOperations + :ivar workflow_run_action_request_history: WorkflowRunActionRequestHistoryOperations operations + :vartype workflow_run_action_request_history: logic_management_client.aio.operations_async.WorkflowRunActionRequestHistoryOperations + :ivar workflow_run_action_scope_repetition: WorkflowRunActionScopeRepetitionOperations operations + :vartype workflow_run_action_scope_repetition: logic_management_client.aio.operations_async.WorkflowRunActionScopeRepetitionOperations + :ivar workflow_run_operation: WorkflowRunOperationOperations operations + :vartype workflow_run_operation: logic_management_client.aio.operations_async.WorkflowRunOperationOperations + :ivar integration_account: IntegrationAccountOperations operations + :vartype integration_account: logic_management_client.aio.operations_async.IntegrationAccountOperations + :ivar integration_account_assembly: IntegrationAccountAssemblyOperations operations + :vartype integration_account_assembly: logic_management_client.aio.operations_async.IntegrationAccountAssemblyOperations + :ivar integration_account_batch_configuration: IntegrationAccountBatchConfigurationOperations operations + :vartype integration_account_batch_configuration: logic_management_client.aio.operations_async.IntegrationAccountBatchConfigurationOperations + :ivar integration_account_schema: IntegrationAccountSchemaOperations operations + :vartype integration_account_schema: logic_management_client.aio.operations_async.IntegrationAccountSchemaOperations + :ivar integration_account_map: IntegrationAccountMapOperations operations + :vartype integration_account_map: logic_management_client.aio.operations_async.IntegrationAccountMapOperations + :ivar integration_account_partner: IntegrationAccountPartnerOperations operations + :vartype integration_account_partner: logic_management_client.aio.operations_async.IntegrationAccountPartnerOperations + :ivar integration_account_agreement: IntegrationAccountAgreementOperations operations + :vartype integration_account_agreement: logic_management_client.aio.operations_async.IntegrationAccountAgreementOperations + :ivar integration_account_certificate: IntegrationAccountCertificateOperations operations + :vartype integration_account_certificate: logic_management_client.aio.operations_async.IntegrationAccountCertificateOperations + :ivar integration_account_session: IntegrationAccountSessionOperations operations + :vartype integration_account_session: logic_management_client.aio.operations_async.IntegrationAccountSessionOperations + :ivar integration_service_environment: IntegrationServiceEnvironmentOperations operations + :vartype integration_service_environment: logic_management_client.aio.operations_async.IntegrationServiceEnvironmentOperations + :ivar integration_service_environment_sku: IntegrationServiceEnvironmentSkuOperations operations + :vartype integration_service_environment_sku: logic_management_client.aio.operations_async.IntegrationServiceEnvironmentSkuOperations + :ivar integration_service_environment_network_health: IntegrationServiceEnvironmentNetworkHealthOperations operations + :vartype integration_service_environment_network_health: logic_management_client.aio.operations_async.IntegrationServiceEnvironmentNetworkHealthOperations + :ivar integration_service_environment_managed_api: IntegrationServiceEnvironmentManagedApiOperations operations + :vartype integration_service_environment_managed_api: logic_management_client.aio.operations_async.IntegrationServiceEnvironmentManagedApiOperations + :ivar integration_service_environment_managed_api_operation: IntegrationServiceEnvironmentManagedApiOperationOperations operations + :vartype integration_service_environment_managed_api_operation: logic_management_client.aio.operations_async.IntegrationServiceEnvironmentManagedApiOperationOperations + :ivar operation: OperationOperations operations + :vartype operation: logic_management_client.aio.operations_async.OperationOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The subscription id. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = LogicManagementClientConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.workflow = WorkflowOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_version = WorkflowVersionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_trigger = WorkflowTriggerOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_version_trigger = WorkflowVersionTriggerOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_trigger_history = WorkflowTriggerHistoryOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_run = WorkflowRunOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_run_action = WorkflowRunActionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_run_action_repetition = WorkflowRunActionRepetitionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_run_action_repetition_request_history = WorkflowRunActionRepetitionRequestHistoryOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_run_action_request_history = WorkflowRunActionRequestHistoryOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_run_action_scope_repetition = WorkflowRunActionScopeRepetitionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.workflow_run_operation = WorkflowRunOperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account = IntegrationAccountOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_assembly = IntegrationAccountAssemblyOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_batch_configuration = IntegrationAccountBatchConfigurationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_schema = IntegrationAccountSchemaOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_map = IntegrationAccountMapOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_partner = IntegrationAccountPartnerOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_agreement = IntegrationAccountAgreementOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_certificate = IntegrationAccountCertificateOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_account_session = IntegrationAccountSessionOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_service_environment = IntegrationServiceEnvironmentOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_service_environment_sku = IntegrationServiceEnvironmentSkuOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_service_environment_network_health = IntegrationServiceEnvironmentNetworkHealthOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_service_environment_managed_api = IntegrationServiceEnvironmentManagedApiOperations( + self._client, self._config, self._serialize, self._deserialize) + self.integration_service_environment_managed_api_operation = IntegrationServiceEnvironmentManagedApiOperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "LogicManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/__init__.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/__init__.py new file mode 100644 index 00000000000..46e654ae232 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/__init__.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 ._workflow_operations_async import WorkflowOperations +from ._workflow_version_operations_async import WorkflowVersionOperations +from ._workflow_trigger_operations_async import WorkflowTriggerOperations +from ._workflow_version_trigger_operations_async import WorkflowVersionTriggerOperations +from ._workflow_trigger_history_operations_async import WorkflowTriggerHistoryOperations +from ._workflow_run_operations_async import WorkflowRunOperations +from ._workflow_run_action_operations_async import WorkflowRunActionOperations +from ._workflow_run_action_repetition_operations_async import WorkflowRunActionRepetitionOperations +from ._workflow_run_action_repetition_request_history_operations_async import WorkflowRunActionRepetitionRequestHistoryOperations +from ._workflow_run_action_request_history_operations_async import WorkflowRunActionRequestHistoryOperations +from ._workflow_run_action_scope_repetition_operations_async import WorkflowRunActionScopeRepetitionOperations +from ._workflow_run_operation_operations_async import WorkflowRunOperationOperations +from ._integration_account_operations_async import IntegrationAccountOperations +from ._integration_account_assembly_operations_async import IntegrationAccountAssemblyOperations +from ._integration_account_batch_configuration_operations_async import IntegrationAccountBatchConfigurationOperations +from ._integration_account_schema_operations_async import IntegrationAccountSchemaOperations +from ._integration_account_map_operations_async import IntegrationAccountMapOperations +from ._integration_account_partner_operations_async import IntegrationAccountPartnerOperations +from ._integration_account_agreement_operations_async import IntegrationAccountAgreementOperations +from ._integration_account_certificate_operations_async import IntegrationAccountCertificateOperations +from ._integration_account_session_operations_async import IntegrationAccountSessionOperations +from ._integration_service_environment_operations_async import IntegrationServiceEnvironmentOperations +from ._integration_service_environment_sku_operations_async import IntegrationServiceEnvironmentSkuOperations +from ._integration_service_environment_network_health_operations_async import IntegrationServiceEnvironmentNetworkHealthOperations +from ._integration_service_environment_managed_api_operations_async import IntegrationServiceEnvironmentManagedApiOperations +from ._integration_service_environment_managed_api_operation_operations_async import IntegrationServiceEnvironmentManagedApiOperationOperations +from ._operation_operations_async import OperationOperations + +__all__ = [ + 'WorkflowOperations', + 'WorkflowVersionOperations', + 'WorkflowTriggerOperations', + 'WorkflowVersionTriggerOperations', + 'WorkflowTriggerHistoryOperations', + 'WorkflowRunOperations', + 'WorkflowRunActionOperations', + 'WorkflowRunActionRepetitionOperations', + 'WorkflowRunActionRepetitionRequestHistoryOperations', + 'WorkflowRunActionRequestHistoryOperations', + 'WorkflowRunActionScopeRepetitionOperations', + 'WorkflowRunOperationOperations', + 'IntegrationAccountOperations', + 'IntegrationAccountAssemblyOperations', + 'IntegrationAccountBatchConfigurationOperations', + 'IntegrationAccountSchemaOperations', + 'IntegrationAccountMapOperations', + 'IntegrationAccountPartnerOperations', + 'IntegrationAccountAgreementOperations', + 'IntegrationAccountCertificateOperations', + 'IntegrationAccountSessionOperations', + 'IntegrationServiceEnvironmentOperations', + 'IntegrationServiceEnvironmentSkuOperations', + 'IntegrationServiceEnvironmentNetworkHealthOperations', + 'IntegrationServiceEnvironmentManagedApiOperations', + 'IntegrationServiceEnvironmentManagedApiOperationOperations', + 'OperationOperations', +] diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_agreement_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_agreement_operations_async.py new file mode 100644 index 00000000000..36e5a6d3e64 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_agreement_operations_async.py @@ -0,0 +1,416 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountAgreementOperations: + """IntegrationAccountAgreementOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + integration_account_name: str, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs + ) -> "models.IntegrationAccountAgreementListResult": + """Gets a list of integration account agreements. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: + AgreementType. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountAgreementListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountAgreementListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountAgreementListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountAgreementListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements'} + + async def get( + self, + resource_group_name: str, + integration_account_name: str, + agreement_name: str, + **kwargs + ) -> "models.IntegrationAccountAgreement": + """Gets an integration account agreement. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. + :type agreement_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountAgreement or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountAgreement + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountAgreement"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'agreementName': self._serialize.url("agreement_name", agreement_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccountAgreement', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}'} + + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + agreement_name: str, + agreement_type: Union[str, "models.AgreementType"], + host_partner: str, + guest_partner: str, + host_identity: "models.BusinessIdentity", + guest_identity: "models.BusinessIdentity", + content: "models.AgreementContent", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + metadata: Optional[object] = None, + **kwargs + ) -> "models.IntegrationAccountAgreement": + """Creates or updates an integration account agreement. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. + :type agreement_name: str + :param agreement_type: The agreement type. + :type agreement_type: str or ~logic_management_client.models.AgreementType + :param host_partner: The integration account partner that is set as host partner for this + agreement. + :type host_partner: str + :param guest_partner: The integration account partner that is set as guest partner for this + agreement. + :type guest_partner: str + :param host_identity: The business identity of the host partner. + :type host_identity: ~logic_management_client.models.BusinessIdentity + :param guest_identity: The business identity of the guest partner. + :type guest_identity: ~logic_management_client.models.BusinessIdentity + :param content: The agreement content. + :type content: ~logic_management_client.models.AgreementContent + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param metadata: The metadata. + :type metadata: object + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountAgreement or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountAgreement or ~logic_management_client.models.IntegrationAccountAgreement + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountAgreement"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _agreement = models.IntegrationAccountAgreement(location=location, tags=tags, metadata=metadata, agreement_type=agreement_type, host_partner=host_partner, guest_partner=guest_partner, host_identity=host_identity, guest_identity=guest_identity, content=content) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'agreementName': self._serialize.url("agreement_name", agreement_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_agreement, 'IntegrationAccountAgreement') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationAccountAgreement', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationAccountAgreement', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}'} + + async def delete( + self, + resource_group_name: str, + integration_account_name: str, + agreement_name: str, + **kwargs + ) -> None: + """Deletes an integration account agreement. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. + :type agreement_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'agreementName': self._serialize.url("agreement_name", agreement_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}'} + + async def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + agreement_name: str, + not_after: Optional[datetime.datetime] = None, + key_type: Optional[Union[str, "models.KeyType"]] = None, + **kwargs + ) -> "models.WorkflowTriggerCallbackUrl": + """Get the content callback url. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. + :type agreement_name: str + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _list_content_callback_url = models.GetCallbackUrlParameters(not_after=not_after, key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.list_content_callback_url.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'agreementName': self._serialize.url("agreement_name", agreement_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_list_content_callback_url, 'GetCallbackUrlParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_content_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}/listContentCallbackUrl'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_assembly_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_assembly_operations_async.py new file mode 100644 index 00000000000..3861a78c869 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_assembly_operations_async.py @@ -0,0 +1,370 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountAssemblyOperations: + """IntegrationAccountAssemblyOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + integration_account_name: str, + **kwargs + ) -> "models.AssemblyCollection": + """List the assemblies for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssemblyCollection or the result of cls(response) + :rtype: ~logic_management_client.models.AssemblyCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AssemblyCollection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AssemblyCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies'} + + async def get( + self, + resource_group_name: str, + integration_account_name: str, + assembly_artifact_name: str, + **kwargs + ) -> "models.AssemblyDefinition": + """Get an assembly for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param assembly_artifact_name: The assembly artifact name. + :type assembly_artifact_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssemblyDefinition or the result of cls(response) + :rtype: ~logic_management_client.models.AssemblyDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AssemblyDefinition"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'assemblyArtifactName': self._serialize.url("assembly_artifact_name", assembly_artifact_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AssemblyDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}'} + + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + assembly_artifact_name: str, + properties: "models.AssemblyProperties", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ) -> "models.AssemblyDefinition": + """Create or update an assembly for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param assembly_artifact_name: The assembly artifact name. + :type assembly_artifact_name: str + :param properties: The assembly properties. + :type properties: ~logic_management_client.models.AssemblyProperties + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssemblyDefinition or the result of cls(response) + :rtype: ~logic_management_client.models.AssemblyDefinition or ~logic_management_client.models.AssemblyDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AssemblyDefinition"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _assembly_artifact = models.AssemblyDefinition(location=location, tags=tags, properties=properties) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'assemblyArtifactName': self._serialize.url("assembly_artifact_name", assembly_artifact_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_assembly_artifact, 'AssemblyDefinition') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AssemblyDefinition', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AssemblyDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}'} + + async def delete( + self, + resource_group_name: str, + integration_account_name: str, + assembly_artifact_name: str, + **kwargs + ) -> None: + """Delete an assembly for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param assembly_artifact_name: The assembly artifact name. + :type assembly_artifact_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'assemblyArtifactName': self._serialize.url("assembly_artifact_name", assembly_artifact_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}'} + + async def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + assembly_artifact_name: str, + **kwargs + ) -> "models.WorkflowTriggerCallbackUrl": + """Get the content callback url for an integration account assembly. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param assembly_artifact_name: The assembly artifact name. + :type assembly_artifact_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.list_content_callback_url.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'assemblyArtifactName': self._serialize.url("assembly_artifact_name", assembly_artifact_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_content_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}/listContentCallbackUrl'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_batch_configuration_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_batch_configuration_operations_async.py new file mode 100644 index 00000000000..62e25f4a415 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_batch_configuration_operations_async.py @@ -0,0 +1,310 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountBatchConfigurationOperations: + """IntegrationAccountBatchConfigurationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + integration_account_name: str, + **kwargs + ) -> "models.BatchConfigurationCollection": + """List the batch configurations for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BatchConfigurationCollection or the result of cls(response) + :rtype: ~logic_management_client.models.BatchConfigurationCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BatchConfigurationCollection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('BatchConfigurationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations'} + + async def get( + self, + resource_group_name: str, + integration_account_name: str, + batch_configuration_name: str, + **kwargs + ) -> "models.BatchConfiguration": + """Get a batch configuration for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param batch_configuration_name: The batch configuration name. + :type batch_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BatchConfiguration or the result of cls(response) + :rtype: ~logic_management_client.models.BatchConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BatchConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'batchConfigurationName': self._serialize.url("batch_configuration_name", batch_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('BatchConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}'} + + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + batch_configuration_name: str, + properties: "models.BatchConfigurationProperties", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ) -> "models.BatchConfiguration": + """Create or update a batch configuration for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param batch_configuration_name: The batch configuration name. + :type batch_configuration_name: str + :param properties: The batch configuration properties. + :type properties: ~logic_management_client.models.BatchConfigurationProperties + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BatchConfiguration or the result of cls(response) + :rtype: ~logic_management_client.models.BatchConfiguration or ~logic_management_client.models.BatchConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BatchConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _batch_configuration = models.BatchConfiguration(location=location, tags=tags, properties=properties) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'batchConfigurationName': self._serialize.url("batch_configuration_name", batch_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_batch_configuration, 'BatchConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BatchConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('BatchConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}'} + + async def delete( + self, + resource_group_name: str, + integration_account_name: str, + batch_configuration_name: str, + **kwargs + ) -> None: + """Delete a batch configuration for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param batch_configuration_name: The batch configuration name. + :type batch_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'batchConfigurationName': self._serialize.url("batch_configuration_name", batch_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_certificate_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_certificate_operations_async.py new file mode 100644 index 00000000000..01c482936d5 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_certificate_operations_async.py @@ -0,0 +1,321 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountCertificateOperations: + """IntegrationAccountCertificateOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + integration_account_name: str, + top: Optional[int] = None, + **kwargs + ) -> "models.IntegrationAccountCertificateListResult": + """Gets a list of integration account certificates. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param top: The number of items to be included in the result. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountCertificateListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountCertificateListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountCertificateListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountCertificateListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates'} + + async def get( + self, + resource_group_name: str, + integration_account_name: str, + certificate_name: str, + **kwargs + ) -> "models.IntegrationAccountCertificate": + """Gets an integration account certificate. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param certificate_name: The integration account certificate name. + :type certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountCertificate or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountCertificate"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccountCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}'} + + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + certificate_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + metadata: Optional[object] = None, + key: Optional["models.KeyVaultKeyReference"] = None, + public_certificate: Optional[str] = None, + **kwargs + ) -> "models.IntegrationAccountCertificate": + """Creates or updates an integration account certificate. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param certificate_name: The integration account certificate name. + :type certificate_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param metadata: The metadata. + :type metadata: object + :param key: The key details in the key vault. + :type key: ~logic_management_client.models.KeyVaultKeyReference + :param public_certificate: The public certificate. + :type public_certificate: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountCertificate or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountCertificate or ~logic_management_client.models.IntegrationAccountCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountCertificate"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _certificate = models.IntegrationAccountCertificate(location=location, tags=tags, metadata=metadata, key=key, public_certificate=public_certificate) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_certificate, 'IntegrationAccountCertificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationAccountCertificate', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationAccountCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}'} + + async def delete( + self, + resource_group_name: str, + integration_account_name: str, + certificate_name: str, + **kwargs + ) -> None: + """Deletes an integration account certificate. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param certificate_name: The integration account certificate name. + :type certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_map_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_map_operations_async.py new file mode 100644 index 00000000000..20cdf27623e --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_map_operations_async.py @@ -0,0 +1,407 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountMapOperations: + """IntegrationAccountMapOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + integration_account_name: str, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs + ) -> "models.IntegrationAccountMapListResult": + """Gets a list of integration account maps. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: MapType. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountMapListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountMapListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountMapListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountMapListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps'} + + async def get( + self, + resource_group_name: str, + integration_account_name: str, + map_name: str, + **kwargs + ) -> "models.IntegrationAccountMap": + """Gets an integration account map. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param map_name: The integration account map name. + :type map_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountMap or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountMap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountMap"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'mapName': self._serialize.url("map_name", map_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccountMap', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}'} + + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + map_name: str, + map_type: Union[str, "models.MapType"], + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + parameters_schema: Optional["models.IntegrationAccountMapPropertiesParametersSchema"] = None, + content: Optional[str] = None, + content_type_parameter: Optional[str] = None, + metadata: Optional[object] = None, + **kwargs + ) -> "models.IntegrationAccountMap": + """Creates or updates an integration account map. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param map_name: The integration account map name. + :type map_name: str + :param map_type: The map type. + :type map_type: str or ~logic_management_client.models.MapType + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param parameters_schema: The parameters schema of integration account map. + :type parameters_schema: ~logic_management_client.models.IntegrationAccountMapPropertiesParametersSchema + :param content: The content. + :type content: str + :param content_type_parameter: The content type. + :type content_type_parameter: str + :param metadata: The metadata. + :type metadata: object + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountMap or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountMap or ~logic_management_client.models.IntegrationAccountMap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountMap"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _map = models.IntegrationAccountMap(location=location, tags=tags, map_type=map_type, parameters_schema=parameters_schema, content=content, content_type=content_type_parameter, metadata=metadata) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'mapName': self._serialize.url("map_name", map_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_map, 'IntegrationAccountMap') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationAccountMap', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationAccountMap', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}'} + + async def delete( + self, + resource_group_name: str, + integration_account_name: str, + map_name: str, + **kwargs + ) -> None: + """Deletes an integration account map. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param map_name: The integration account map name. + :type map_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'mapName': self._serialize.url("map_name", map_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}'} + + async def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + map_name: str, + not_after: Optional[datetime.datetime] = None, + key_type: Optional[Union[str, "models.KeyType"]] = None, + **kwargs + ) -> "models.WorkflowTriggerCallbackUrl": + """Get the content callback url. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param map_name: The integration account map name. + :type map_name: str + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _list_content_callback_url = models.GetCallbackUrlParameters(not_after=not_after, key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.list_content_callback_url.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'mapName': self._serialize.url("map_name", map_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_list_content_callback_url, 'GetCallbackUrlParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_content_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}/listContentCallbackUrl'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_operations_async.py new file mode 100644 index 00000000000..4453a7d2b63 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_operations_async.py @@ -0,0 +1,743 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountOperations: + """IntegrationAccountOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + top: Optional[int] = None, + **kwargs + ) -> "models.IntegrationAccountListResult": + """Gets a list of integration accounts by subscription. + + :param top: The number of items to be included in the result. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # 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) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationAccounts'} + + def list_by_resource_group( + self, + resource_group_name: str, + top: Optional[int] = None, + **kwargs + ) -> "models.IntegrationAccountListResult": + """Gets a list of integration accounts by resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param top: The number of items to be included in the result. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # 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'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts'} + + async def get( + self, + resource_group_name: str, + integration_account_name: str, + **kwargs + ) -> "models.IntegrationAccount": + """Gets an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccount"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}'} + + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["models.IntegrationAccountSku"] = None, + integration_service_environment: Optional["models.IntegrationServiceEnvironment"] = None, + state: Optional[Union[str, "models.WorkflowState"]] = None, + **kwargs + ) -> "models.IntegrationAccount": + """Creates or updates an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param sku: The sku. + :type sku: ~logic_management_client.models.IntegrationAccountSku + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~logic_management_client.models.IntegrationServiceEnvironment + :param state: The workflow state. + :type state: str or ~logic_management_client.models.WorkflowState + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccount or ~logic_management_client.models.IntegrationAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccount"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _integration_account = models.IntegrationAccount(location=location, tags=tags, sku=sku, integration_service_environment=integration_service_environment, state=state) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_integration_account, 'IntegrationAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}'} + + async def update( + self, + resource_group_name: str, + integration_account_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["models.IntegrationAccountSku"] = None, + integration_service_environment: Optional["models.IntegrationServiceEnvironment"] = None, + state: Optional[Union[str, "models.WorkflowState"]] = None, + **kwargs + ) -> "models.IntegrationAccount": + """Updates an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param sku: The sku. + :type sku: ~logic_management_client.models.IntegrationAccountSku + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~logic_management_client.models.IntegrationServiceEnvironment + :param state: The workflow state. + :type state: str or ~logic_management_client.models.WorkflowState + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccount"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _integration_account = models.IntegrationAccount(location=location, tags=tags, sku=sku, integration_service_environment=integration_service_environment, state=state) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_integration_account, 'IntegrationAccount') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}'} + + async def delete( + self, + resource_group_name: str, + integration_account_name: str, + **kwargs + ) -> None: + """Deletes an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}'} + + async def list_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + not_after: Optional[datetime.datetime] = None, + key_type: Optional[Union[str, "models.KeyType"]] = None, + **kwargs + ) -> "models.CallbackUrl": + """Gets the integration account callback URL. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.CallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.GetCallbackUrlParameters(not_after=not_after, key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.list_callback_url.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'GetCallbackUrlParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('CallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listCallbackUrl'} + + def list_key_vault_key( + self, + resource_group_name: str, + integration_account_name: str, + key_vault: "models.KeyVaultReference", + skip_token: Optional[str] = None, + **kwargs + ) -> "models.KeyVaultKeyCollection": + """Gets the integration account's Key Vault keys. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param key_vault: The key vault reference. + :type key_vault: ~logic_management_client.models.KeyVaultReference + :param skip_token: The skip token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyVaultKeyCollection or the result of cls(response) + :rtype: ~logic_management_client.models.KeyVaultKeyCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.KeyVaultKeyCollection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + _list_key_vault_keys = models.ListKeyVaultKeysDefinition(key_vault=key_vault, skip_token=skip_token) + api_version = "2019-05-01" + content_type = "application/json" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_key_vault_key.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_list_key_vault_keys, 'ListKeyVaultKeysDefinition') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('KeyVaultKeyCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_key_vault_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listKeyVaultKeys'} + + async def log_tracking_event( + self, + resource_group_name: str, + integration_account_name: str, + source_type: str, + events: List["TrackingEvent"], + track_events_options: Optional[Union[str, "models.TrackEventsOperationOptions"]] = None, + **kwargs + ) -> None: + """Logs the integration account's tracking events. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param source_type: The source type. + :type source_type: str + :param events: The events. + :type events: list[~logic_management_client.models.TrackingEvent] + :param track_events_options: The track events options. + :type track_events_options: str or ~logic_management_client.models.TrackEventsOperationOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _log_tracking_events = models.TrackingEventsDefinition(source_type=source_type, track_events_options=track_events_options, events=events) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.log_tracking_event.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_log_tracking_events, 'TrackingEventsDefinition') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + log_tracking_event.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/logTrackingEvents'} + + async def regenerate_access_key( + self, + resource_group_name: str, + integration_account_name: str, + key_type: Optional[Union[str, "models.KeyType"]] = None, + **kwargs + ) -> "models.IntegrationAccount": + """Regenerates the integration account access key. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccount"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _regenerate_access_key = models.RegenerateActionParameter(key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.regenerate_access_key.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_regenerate_access_key, 'RegenerateActionParameter') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_access_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/regenerateAccessKey'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_partner_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_partner_operations_async.py new file mode 100644 index 00000000000..a7b3459dfd3 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_partner_operations_async.py @@ -0,0 +1,401 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountPartnerOperations: + """IntegrationAccountPartnerOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + integration_account_name: str, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs + ) -> "models.IntegrationAccountPartnerListResult": + """Gets a list of integration account partners. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: PartnerType. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountPartnerListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountPartnerListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountPartnerListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountPartnerListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners'} + + async def get( + self, + resource_group_name: str, + integration_account_name: str, + partner_name: str, + **kwargs + ) -> "models.IntegrationAccountPartner": + """Gets an integration account partner. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param partner_name: The integration account partner name. + :type partner_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountPartner or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountPartner + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountPartner"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'partnerName': self._serialize.url("partner_name", partner_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccountPartner', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}'} + + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + partner_name: str, + partner_type: Union[str, "models.PartnerType"], + content: "models.PartnerContent", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + metadata: Optional[object] = None, + **kwargs + ) -> "models.IntegrationAccountPartner": + """Creates or updates an integration account partner. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param partner_name: The integration account partner name. + :type partner_name: str + :param partner_type: The partner type. + :type partner_type: str or ~logic_management_client.models.PartnerType + :param content: The partner content. + :type content: ~logic_management_client.models.PartnerContent + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param metadata: The metadata. + :type metadata: object + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountPartner or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountPartner or ~logic_management_client.models.IntegrationAccountPartner + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountPartner"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _partner = models.IntegrationAccountPartner(location=location, tags=tags, partner_type=partner_type, metadata=metadata, content=content) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'partnerName': self._serialize.url("partner_name", partner_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_partner, 'IntegrationAccountPartner') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationAccountPartner', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationAccountPartner', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}'} + + async def delete( + self, + resource_group_name: str, + integration_account_name: str, + partner_name: str, + **kwargs + ) -> None: + """Deletes an integration account partner. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param partner_name: The integration account partner name. + :type partner_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'partnerName': self._serialize.url("partner_name", partner_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}'} + + async def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + partner_name: str, + not_after: Optional[datetime.datetime] = None, + key_type: Optional[Union[str, "models.KeyType"]] = None, + **kwargs + ) -> "models.WorkflowTriggerCallbackUrl": + """Get the content callback url. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param partner_name: The integration account partner name. + :type partner_name: str + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _list_content_callback_url = models.GetCallbackUrlParameters(not_after=not_after, key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.list_content_callback_url.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'partnerName': self._serialize.url("partner_name", partner_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_list_content_callback_url, 'GetCallbackUrlParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_content_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}/listContentCallbackUrl'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_schema_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_schema_operations_async.py new file mode 100644 index 00000000000..da1ff6336bd --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_schema_operations_async.py @@ -0,0 +1,413 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountSchemaOperations: + """IntegrationAccountSchemaOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + integration_account_name: str, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs + ) -> "models.IntegrationAccountSchemaListResult": + """Gets a list of integration account schemas. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: SchemaType. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSchemaListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountSchemaListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountSchemaListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountSchemaListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas'} + + async def get( + self, + resource_group_name: str, + integration_account_name: str, + schema_name: str, + **kwargs + ) -> "models.IntegrationAccountSchema": + """Gets an integration account schema. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param schema_name: The integration account schema name. + :type schema_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSchema or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountSchema + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountSchema"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccountSchema', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}'} + + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + schema_name: str, + schema_type: Union[str, "models.SchemaType"], + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + target_namespace: Optional[str] = None, + document_name: Optional[str] = None, + file_name: Optional[str] = None, + metadata: Optional[object] = None, + content: Optional[str] = None, + content_type_parameter: Optional[str] = None, + **kwargs + ) -> "models.IntegrationAccountSchema": + """Creates or updates an integration account schema. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param schema_name: The integration account schema name. + :type schema_name: str + :param schema_type: The schema type. + :type schema_type: str or ~logic_management_client.models.SchemaType + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param target_namespace: The target namespace of the schema. + :type target_namespace: str + :param document_name: The document name. + :type document_name: str + :param file_name: The file name. + :type file_name: str + :param metadata: The metadata. + :type metadata: object + :param content: The content. + :type content: str + :param content_type_parameter: The content type. + :type content_type_parameter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSchema or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountSchema or ~logic_management_client.models.IntegrationAccountSchema + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountSchema"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _schema = models.IntegrationAccountSchema(location=location, tags=tags, schema_type=schema_type, target_namespace=target_namespace, document_name=document_name, file_name=file_name, metadata=metadata, content=content, content_type=content_type_parameter) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_schema, 'IntegrationAccountSchema') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationAccountSchema', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationAccountSchema', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}'} + + async def delete( + self, + resource_group_name: str, + integration_account_name: str, + schema_name: str, + **kwargs + ) -> None: + """Deletes an integration account schema. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param schema_name: The integration account schema name. + :type schema_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}'} + + async def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + schema_name: str, + not_after: Optional[datetime.datetime] = None, + key_type: Optional[Union[str, "models.KeyType"]] = None, + **kwargs + ) -> "models.WorkflowTriggerCallbackUrl": + """Get the content callback url. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param schema_name: The integration account schema name. + :type schema_name: str + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _list_content_callback_url = models.GetCallbackUrlParameters(not_after=not_after, key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.list_content_callback_url.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_list_content_callback_url, 'GetCallbackUrlParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_content_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}/listContentCallbackUrl'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_session_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_session_operations_async.py new file mode 100644 index 00000000000..2ed274d71bf --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_account_session_operations_async.py @@ -0,0 +1,320 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountSessionOperations: + """IntegrationAccountSessionOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + integration_account_name: str, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs + ) -> "models.IntegrationAccountSessionListResult": + """Gets a list of integration account sessions. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: ChangedTime. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSessionListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountSessionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountSessionListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountSessionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions'} + + async def get( + self, + resource_group_name: str, + integration_account_name: str, + session_name: str, + **kwargs + ) -> "models.IntegrationAccountSession": + """Gets an integration account session. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param session_name: The integration account session name. + :type session_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSession or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountSession + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountSession"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'sessionName': self._serialize.url("session_name", session_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccountSession', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}'} + + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + session_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + content: Optional[object] = None, + **kwargs + ) -> "models.IntegrationAccountSession": + """Creates or updates an integration account session. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param session_name: The integration account session name. + :type session_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param content: The session content. + :type content: object + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSession or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountSession or ~logic_management_client.models.IntegrationAccountSession + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountSession"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _session = models.IntegrationAccountSession(location=location, tags=tags, content=content) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'sessionName': self._serialize.url("session_name", session_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_session, 'IntegrationAccountSession') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationAccountSession', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationAccountSession', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}'} + + async def delete( + self, + resource_group_name: str, + integration_account_name: str, + session_name: str, + **kwargs + ) -> None: + """Deletes an integration account session. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param session_name: The integration account session name. + :type session_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'sessionName': self._serialize.url("session_name", session_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_service_environment_managed_api_operation_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_service_environment_managed_api_operation_operations_async.py new file mode 100644 index 00000000000..085d28c8212 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_service_environment_managed_api_operation_operations_async.py @@ -0,0 +1,116 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationServiceEnvironmentManagedApiOperationOperations: + """IntegrationServiceEnvironmentManagedApiOperationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group: str, + integration_service_environment_name: str, + api_name: str, + **kwargs + ) -> "models.ApiOperationListResult": + """Gets the managed Api operations. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :param api_name: The api name. + :type api_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApiOperationListResult or the result of cls(response) + :rtype: ~logic_management_client.models.ApiOperationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApiOperationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + 'apiName': self._serialize.url("api_name", api_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApiOperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}/apiOperations'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_service_environment_managed_api_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_service_environment_managed_api_operations_async.py new file mode 100644 index 00000000000..9c0380324d2 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_service_environment_managed_api_operations_async.py @@ -0,0 +1,367 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationServiceEnvironmentManagedApiOperations: + """IntegrationServiceEnvironmentManagedApiOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group: str, + integration_service_environment_name: str, + **kwargs + ) -> "models.ManagedApiListResult": + """Gets the integration service environment managed Apis. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedApiListResult or the result of cls(response) + :rtype: ~logic_management_client.models.ManagedApiListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedApiListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ManagedApiListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis'} + + async def get( + self, + resource_group: str, + integration_service_environment_name: str, + api_name: str, + **kwargs + ) -> "models.ManagedApi": + """Gets the integration service environment managed Api. + + :param resource_group: The resource group name. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :param api_name: The api name. + :type api_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedApi or the result of cls(response) + :rtype: ~logic_management_client.models.ManagedApi + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedApi"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + 'apiName': self._serialize.url("api_name", api_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('ManagedApi', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}'} + + async def _put_initial( + self, + resource_group: str, + integration_service_environment_name: str, + api_name: str, + **kwargs + ) -> "models.ManagedApi": + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedApi"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self._put_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + 'apiName': self._serialize.url("api_name", api_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ManagedApi', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ManagedApi', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _put_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}'} + + async def put( + self, + resource_group: str, + integration_service_environment_name: str, + api_name: str, + **kwargs + ) -> "models.ManagedApi": + """Puts the integration service environment managed Api. + + :param resource_group: The resource group name. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :param api_name: The api name. + :type api_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns ManagedApi + :rtype: ~azure.core.polling.LROPoller[~logic_management_client.models.ManagedApi] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedApi"] + raw_result = await self._put_initial( + resource_group=resource_group, + integration_service_environment_name=integration_service_environment_name, + api_name=api_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedApi', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}'} + + async def _delete_initial( + self, + resource_group: str, + integration_service_environment_name: str, + api_name: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self._delete_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + 'apiName': self._serialize.url("api_name", api_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}'} + + async def delete( + self, + resource_group: str, + integration_service_environment_name: str, + api_name: str, + **kwargs + ) -> None: + """Deletes the integration service environment managed Api. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :param api_name: The api name. + :type api_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = await self._delete_initial( + resource_group=resource_group, + integration_service_environment_name=integration_service_environment_name, + api_name=api_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_service_environment_network_health_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_service_environment_network_health_operations_async.py new file mode 100644 index 00000000000..182063c8f0a --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_service_environment_network_health_operations_async.py @@ -0,0 +1,96 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationServiceEnvironmentNetworkHealthOperations: + """IntegrationServiceEnvironmentNetworkHealthOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group: str, + integration_service_environment_name: str, + **kwargs + ) -> Dict[str, "IntegrationServiceEnvironmentSubnetNetworkHealth"]: + """Gets the integration service environment network health. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: dict or the result of cls(response) + :rtype: dict[str, ~logic_management_client.models.IntegrationServiceEnvironmentSubnetNetworkHealth] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "IntegrationServiceEnvironmentSubnetNetworkHealth"]] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('{IntegrationServiceEnvironmentSubnetNetworkHealth}', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/health/network'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_service_environment_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_service_environment_operations_async.py new file mode 100644 index 00000000000..47134dc48cc --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_service_environment_operations_async.py @@ -0,0 +1,587 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationServiceEnvironmentOperations: + """IntegrationServiceEnvironmentOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + top: Optional[int] = None, + **kwargs + ) -> "models.IntegrationServiceEnvironmentListResult": + """Gets a list of integration service environments by subscription. + + :param top: The number of items to be included in the result. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationServiceEnvironmentListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationServiceEnvironmentListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironmentListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # 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) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationServiceEnvironmentListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationServiceEnvironments'} + + def list_by_resource_group( + self, + resource_group: str, + top: Optional[int] = None, + **kwargs + ) -> "models.IntegrationServiceEnvironmentListResult": + """Gets a list of integration service environments by resource group. + + :param resource_group: The resource group. + :type resource_group: str + :param top: The number of items to be included in the result. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationServiceEnvironmentListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationServiceEnvironmentListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironmentListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # 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'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationServiceEnvironmentListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments'} + + async def get( + self, + resource_group: str, + integration_service_environment_name: str, + **kwargs + ) -> "models.IntegrationServiceEnvironment": + """Gets an integration service environment. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationServiceEnvironment or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationServiceEnvironment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironment"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}'} + + async def _create_or_update_initial( + self, + resource_group: str, + integration_service_environment_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["models.IntegrationServiceEnvironmentProperties"] = None, + sku: Optional["models.IntegrationServiceEnvironmentSku"] = None, + **kwargs + ) -> "models.IntegrationServiceEnvironment": + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironment"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _integration_service_environment = models.IntegrationServiceEnvironment(location=location, tags=tags, properties=properties, sku=sku) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_integration_service_environment, 'IntegrationServiceEnvironment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}'} + + async def create_or_update( + self, + resource_group: str, + integration_service_environment_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["models.IntegrationServiceEnvironmentProperties"] = None, + sku: Optional["models.IntegrationServiceEnvironmentSku"] = None, + **kwargs + ) -> "models.IntegrationServiceEnvironment": + """Creates or updates an integration service environment. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param properties: The integration service environment properties. + :type properties: ~logic_management_client.models.IntegrationServiceEnvironmentProperties + :param sku: The sku. + :type sku: ~logic_management_client.models.IntegrationServiceEnvironmentSku + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns IntegrationServiceEnvironment + :rtype: ~azure.core.polling.LROPoller[~logic_management_client.models.IntegrationServiceEnvironment] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironment"] + raw_result = await self._create_or_update_initial( + resource_group=resource_group, + integration_service_environment_name=integration_service_environment_name, + location=location, + tags=tags, + properties=properties, + sku=sku, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}'} + + async def _update_initial( + self, + resource_group: str, + integration_service_environment_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["models.IntegrationServiceEnvironmentProperties"] = None, + sku: Optional["models.IntegrationServiceEnvironmentSku"] = None, + **kwargs + ) -> "models.IntegrationServiceEnvironment": + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironment"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _integration_service_environment = models.IntegrationServiceEnvironment(location=location, tags=tags, properties=properties, sku=sku) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._update_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_integration_service_environment, 'IntegrationServiceEnvironment') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}'} + + async def update( + self, + resource_group: str, + integration_service_environment_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["models.IntegrationServiceEnvironmentProperties"] = None, + sku: Optional["models.IntegrationServiceEnvironmentSku"] = None, + **kwargs + ) -> "models.IntegrationServiceEnvironment": + """Updates an integration service environment. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param properties: The integration service environment properties. + :type properties: ~logic_management_client.models.IntegrationServiceEnvironmentProperties + :param sku: The sku. + :type sku: ~logic_management_client.models.IntegrationServiceEnvironmentSku + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns IntegrationServiceEnvironment + :rtype: ~azure.core.polling.LROPoller[~logic_management_client.models.IntegrationServiceEnvironment] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironment"] + raw_result = await self._update_initial( + resource_group=resource_group, + integration_service_environment_name=integration_service_environment_name, + location=location, + tags=tags, + properties=properties, + sku=sku, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}'} + + async def delete( + self, + resource_group: str, + integration_service_environment_name: str, + **kwargs + ) -> None: + """Deletes an integration service environment. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}'} + + async def restart( + self, + resource_group: str, + integration_service_environment_name: str, + **kwargs + ) -> None: + """Restarts an integration service environment. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.restart.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/restart'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_service_environment_sku_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_service_environment_sku_operations_async.py new file mode 100644 index 00000000000..68e19d61a2f --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_integration_service_environment_sku_operations_async.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationServiceEnvironmentSkuOperations: + """IntegrationServiceEnvironmentSkuOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group: str, + integration_service_environment_name: str, + **kwargs + ) -> "models.IntegrationServiceEnvironmentSkuList": + """Gets a list of integration service environment Skus. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationServiceEnvironmentSkuList or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationServiceEnvironmentSkuList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironmentSkuList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationServiceEnvironmentSkuList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/skus'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_operation_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_operation_operations_async.py new file mode 100644 index 00000000000..d4059badd62 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_operation_operations_async.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations: + """OperationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> "models.OperationListResult": + """Lists all of the available Logic REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationListResult or the result of cls(response) + :rtype: ~logic_management_client.models.OperationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Logic/operations'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_operations_async.py new file mode 100644 index 00000000000..8fde256f5ca --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_operations_async.py @@ -0,0 +1,1117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowOperations: + """WorkflowOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs + ) -> "models.WorkflowListResult": + """Gets a list of workflows by subscription. + + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: State, + Trigger, and ReferencedResourceId. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowListResult or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # 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) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Logic/workflows'} + + def list_by_resource_group( + self, + resource_group_name: str, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs + ) -> "models.WorkflowListResult": + """Gets a list of workflows by resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: State, + Trigger, and ReferencedResourceId. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowListResult or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # 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'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows'} + + async def get( + self, + resource_group_name: str, + workflow_name: str, + **kwargs + ) -> "models.Workflow": + """Gets a workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workflow or the result of cls(response) + :rtype: ~logic_management_client.models.Workflow + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Workflow"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Workflow', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}'} + + async def create_or_update( + self, + resource_group_name: str, + workflow_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + state: Optional[Union[str, "models.WorkflowState"]] = None, + endpoints_configuration: Optional["models.FlowEndpointsConfiguration"] = None, + integration_account: Optional["models.ResourceReference"] = None, + integration_service_environment: Optional["models.ResourceReference"] = None, + definition: Optional[object] = None, + parameters: Optional[Dict[str, "WorkflowParameter"]] = None, + **kwargs + ) -> "models.Workflow": + """Creates or updates a workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param state: The state. + :type state: str or ~logic_management_client.models.WorkflowState + :param endpoints_configuration: The endpoints configuration. + :type endpoints_configuration: ~logic_management_client.models.FlowEndpointsConfiguration + :param integration_account: The integration account. + :type integration_account: ~logic_management_client.models.ResourceReference + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~logic_management_client.models.ResourceReference + :param definition: The definition. + :type definition: object + :param parameters: The parameters. + :type parameters: dict[str, ~logic_management_client.models.WorkflowParameter] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workflow or the result of cls(response) + :rtype: ~logic_management_client.models.Workflow or ~logic_management_client.models.Workflow + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Workflow"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _workflow = models.Workflow(location=location, tags=tags, state=state, endpoints_configuration=endpoints_configuration, integration_account=integration_account, integration_service_environment=integration_service_environment, definition=definition, parameters=parameters) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_workflow, 'Workflow') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Workflow', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Workflow', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}'} + + async def update( + self, + resource_group_name: str, + workflow_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + state: Optional[Union[str, "models.WorkflowState"]] = None, + endpoints_configuration: Optional["models.FlowEndpointsConfiguration"] = None, + integration_account: Optional["models.ResourceReference"] = None, + integration_service_environment: Optional["models.ResourceReference"] = None, + definition: Optional[object] = None, + parameters: Optional[Dict[str, "WorkflowParameter"]] = None, + **kwargs + ) -> "models.Workflow": + """Updates a workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param state: The state. + :type state: str or ~logic_management_client.models.WorkflowState + :param endpoints_configuration: The endpoints configuration. + :type endpoints_configuration: ~logic_management_client.models.FlowEndpointsConfiguration + :param integration_account: The integration account. + :type integration_account: ~logic_management_client.models.ResourceReference + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~logic_management_client.models.ResourceReference + :param definition: The definition. + :type definition: object + :param parameters: The parameters. + :type parameters: dict[str, ~logic_management_client.models.WorkflowParameter] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workflow or the result of cls(response) + :rtype: ~logic_management_client.models.Workflow + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Workflow"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _workflow = models.Workflow(location=location, tags=tags, state=state, endpoints_configuration=endpoints_configuration, integration_account=integration_account, integration_service_environment=integration_service_environment, definition=definition, parameters=parameters) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_workflow, 'Workflow') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Workflow', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}'} + + async def delete( + self, + resource_group_name: str, + workflow_name: str, + **kwargs + ) -> None: + """Deletes a workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}'} + + async def disable( + self, + resource_group_name: str, + workflow_name: str, + **kwargs + ) -> None: + """Disables a workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.disable.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + disable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/disable'} + + async def enable( + self, + resource_group_name: str, + workflow_name: str, + **kwargs + ) -> None: + """Enables a workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.enable.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + enable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/enable'} + + async def generate_upgraded_definition( + self, + resource_group_name: str, + workflow_name: str, + target_schema_version: Optional[str] = None, + **kwargs + ) -> object: + """Generates the upgraded definition for a workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param target_schema_version: The target schema version. + :type target_schema_version: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: object or the result of cls(response) + :rtype: object + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[object] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.GenerateUpgradedDefinitionParameters(target_schema_version=target_schema_version) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.generate_upgraded_definition.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'GenerateUpgradedDefinitionParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_upgraded_definition.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/generateUpgradedDefinition'} + + async def list_callback_url( + self, + resource_group_name: str, + workflow_name: str, + not_after: Optional[datetime.datetime] = None, + key_type: Optional[Union[str, "models.KeyType"]] = None, + **kwargs + ) -> "models.WorkflowTriggerCallbackUrl": + """Get the workflow callback Url. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _list_callback_url = models.GetCallbackUrlParameters(not_after=not_after, key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.list_callback_url.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_list_callback_url, 'GetCallbackUrlParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listCallbackUrl'} + + async def list_swagger( + self, + resource_group_name: str, + workflow_name: str, + **kwargs + ) -> object: + """Gets an OpenAPI definition for the workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: object or the result of cls(response) + :rtype: object + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[object] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.list_swagger.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_swagger.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listSwagger'} + + async def _move_initial( + self, + resource_group_name: str, + workflow_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + state: Optional[Union[str, "models.WorkflowState"]] = None, + endpoints_configuration: Optional["models.FlowEndpointsConfiguration"] = None, + integration_account: Optional["models.ResourceReference"] = None, + integration_service_environment: Optional["models.ResourceReference"] = None, + definition: Optional[object] = None, + parameters: Optional[Dict[str, "WorkflowParameter"]] = None, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _move = models.Workflow(location=location, tags=tags, state=state, endpoints_configuration=endpoints_configuration, integration_account=integration_account, integration_service_environment=integration_service_environment, definition=definition, parameters=parameters) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._move_initial.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_move, 'Workflow') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + _move_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move'} + + async def move( + self, + resource_group_name: str, + workflow_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + state: Optional[Union[str, "models.WorkflowState"]] = None, + endpoints_configuration: Optional["models.FlowEndpointsConfiguration"] = None, + integration_account: Optional["models.ResourceReference"] = None, + integration_service_environment: Optional["models.ResourceReference"] = None, + definition: Optional[object] = None, + parameters: Optional[Dict[str, "WorkflowParameter"]] = None, + **kwargs + ) -> None: + """Moves an existing workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param state: The state. + :type state: str or ~logic_management_client.models.WorkflowState + :param endpoints_configuration: The endpoints configuration. + :type endpoints_configuration: ~logic_management_client.models.FlowEndpointsConfiguration + :param integration_account: The integration account. + :type integration_account: ~logic_management_client.models.ResourceReference + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~logic_management_client.models.ResourceReference + :param definition: The definition. + :type definition: object + :param parameters: The parameters. + :type parameters: dict[str, ~logic_management_client.models.WorkflowParameter] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = await self._move_initial( + resource_group_name=resource_group_name, + workflow_name=workflow_name, + location=location, + tags=tags, + state=state, + endpoints_configuration=endpoints_configuration, + integration_account=integration_account, + integration_service_environment=integration_service_environment, + definition=definition, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move'} + + async def regenerate_access_key( + self, + resource_group_name: str, + workflow_name: str, + key_type: Optional[Union[str, "models.KeyType"]] = None, + **kwargs + ) -> None: + """Regenerates the callback URL access key for request triggers. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _key_type = models.RegenerateActionParameter(key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.regenerate_access_key.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_key_type, 'RegenerateActionParameter') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + regenerate_access_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/regenerateAccessKey'} + + async def validate_by_resource_group( + self, + resource_group_name: str, + workflow_name: str, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + state: Optional[Union[str, "models.WorkflowState"]] = None, + endpoints_configuration: Optional["models.FlowEndpointsConfiguration"] = None, + integration_account: Optional["models.ResourceReference"] = None, + integration_service_environment: Optional["models.ResourceReference"] = None, + definition: Optional[object] = None, + parameters: Optional[Dict[str, "WorkflowParameter"]] = None, + **kwargs + ) -> None: + """Validates the workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param state: The state. + :type state: str or ~logic_management_client.models.WorkflowState + :param endpoints_configuration: The endpoints configuration. + :type endpoints_configuration: ~logic_management_client.models.FlowEndpointsConfiguration + :param integration_account: The integration account. + :type integration_account: ~logic_management_client.models.ResourceReference + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~logic_management_client.models.ResourceReference + :param definition: The definition. + :type definition: object + :param parameters: The parameters. + :type parameters: dict[str, ~logic_management_client.models.WorkflowParameter] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _validate = models.Workflow(location=location, tags=tags, state=state, endpoints_configuration=endpoints_configuration, integration_account=integration_account, integration_service_environment=integration_service_environment, definition=definition, parameters=parameters) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.validate_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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_validate, 'Workflow') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + validate_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/validate'} + + async def validate_by_location( + self, + resource_group_name: str, + location: str, + workflow_name: str, + **kwargs + ) -> None: + """Validates the workflow definition. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param location: The workflow location. + :type location: str + :param workflow_name: The workflow name. + :type workflow_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.validate_by_location.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'), + 'location': self._serialize.url("location", location, 'str'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + validate_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/locations/{location}/workflows/{workflowName}/validate'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_action_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_action_operations_async.py new file mode 100644 index 00000000000..be74db4440a --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_action_operations_async.py @@ -0,0 +1,269 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowRunActionOperations: + """WorkflowRunActionOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + workflow_name: str, + run_name: str, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs + ) -> "models.WorkflowRunActionListResult": + """Gets a list of workflow run actions. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: Status. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRunActionListResult or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRunActionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRunActionListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowRunActionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions'} + + async def get( + self, + resource_group_name: str, + workflow_name: str, + run_name: str, + action_name: str, + **kwargs + ) -> "models.WorkflowRunAction": + """Gets a workflow run action. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRunAction or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRunAction + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRunAction"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowRunAction', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}'} + + def list_expression_trace( + self, + resource_group_name: str, + workflow_name: str, + run_name: str, + action_name: str, + **kwargs + ) -> "models.ExpressionTraces": + """Lists a workflow run expression trace. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressionTraces or the result of cls(response) + :rtype: ~logic_management_client.models.ExpressionTraces + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressionTraces"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_expression_trace.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressionTraces', pipeline_response) + list_of_elem = deserialized.inputs + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_expression_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/listExpressionTraces'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_action_repetition_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_action_repetition_operations_async.py new file mode 100644 index 00000000000..d16fe2f0b6a --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_action_repetition_operations_async.py @@ -0,0 +1,271 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowRunActionRepetitionOperations: + """WorkflowRunActionRepetitionOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + workflow_name: str, + run_name: str, + action_name: str, + **kwargs + ) -> "models.WorkflowRunActionRepetitionDefinitionCollection": + """Get all of a workflow run action repetitions. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRunActionRepetitionDefinitionCollection or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRunActionRepetitionDefinitionCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRunActionRepetitionDefinitionCollection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowRunActionRepetitionDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions'} + + async def get( + self, + resource_group_name: str, + workflow_name: str, + run_name: str, + action_name: str, + repetition_name: str, + **kwargs + ) -> "models.WorkflowRunActionRepetitionDefinition": + """Get a workflow run action repetition. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :param repetition_name: The workflow repetition. + :type repetition_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRunActionRepetitionDefinition or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRunActionRepetitionDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRunActionRepetitionDefinition"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + 'repetitionName': self._serialize.url("repetition_name", repetition_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowRunActionRepetitionDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}'} + + def list_expression_trace( + self, + resource_group_name: str, + workflow_name: str, + run_name: str, + action_name: str, + repetition_name: str, + **kwargs + ) -> "models.ExpressionTraces": + """Lists a workflow run expression trace. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :param repetition_name: The workflow repetition. + :type repetition_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressionTraces or the result of cls(response) + :rtype: ~logic_management_client.models.ExpressionTraces + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressionTraces"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_expression_trace.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + 'repetitionName': self._serialize.url("repetition_name", repetition_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressionTraces', pipeline_response) + list_of_elem = deserialized.inputs + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_expression_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/listExpressionTraces'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_action_repetition_request_history_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_action_repetition_request_history_operations_async.py new file mode 100644 index 00000000000..faa4ba487cf --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_action_repetition_request_history_operations_async.py @@ -0,0 +1,196 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowRunActionRepetitionRequestHistoryOperations: + """WorkflowRunActionRepetitionRequestHistoryOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + workflow_name: str, + run_name: str, + action_name: str, + repetition_name: str, + **kwargs + ) -> "models.RequestHistoryListResult": + """List a workflow run repetition request history. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :param repetition_name: The workflow repetition. + :type repetition_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RequestHistoryListResult or the result of cls(response) + :rtype: ~logic_management_client.models.RequestHistoryListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RequestHistoryListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + 'repetitionName': self._serialize.url("repetition_name", repetition_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RequestHistoryListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories'} + + async def get( + self, + resource_group_name: str, + workflow_name: str, + run_name: str, + action_name: str, + repetition_name: str, + request_history_name: str, + **kwargs + ) -> "models.RequestHistory": + """Gets a workflow run repetition request history. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :param repetition_name: The workflow repetition. + :type repetition_name: str + :param request_history_name: The request history name. + :type request_history_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RequestHistory or the result of cls(response) + :rtype: ~logic_management_client.models.RequestHistory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RequestHistory"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + 'repetitionName': self._serialize.url("repetition_name", repetition_name, 'str'), + 'requestHistoryName': self._serialize.url("request_history_name", request_history_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('RequestHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories/{requestHistoryName}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_action_request_history_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_action_request_history_operations_async.py new file mode 100644 index 00000000000..edfdb25ca27 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_action_request_history_operations_async.py @@ -0,0 +1,188 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowRunActionRequestHistoryOperations: + """WorkflowRunActionRequestHistoryOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + workflow_name: str, + run_name: str, + action_name: str, + **kwargs + ) -> "models.RequestHistoryListResult": + """List a workflow run request history. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RequestHistoryListResult or the result of cls(response) + :rtype: ~logic_management_client.models.RequestHistoryListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RequestHistoryListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('RequestHistoryListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories'} + + async def get( + self, + resource_group_name: str, + workflow_name: str, + run_name: str, + action_name: str, + request_history_name: str, + **kwargs + ) -> "models.RequestHistory": + """Gets a workflow run request history. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :param request_history_name: The request history name. + :type request_history_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RequestHistory or the result of cls(response) + :rtype: ~logic_management_client.models.RequestHistory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RequestHistory"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + 'requestHistoryName': self._serialize.url("request_history_name", request_history_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('RequestHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories/{requestHistoryName}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_action_scope_repetition_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_action_scope_repetition_operations_async.py new file mode 100644 index 00000000000..466b93bc8e5 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_action_scope_repetition_operations_async.py @@ -0,0 +1,188 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowRunActionScopeRepetitionOperations: + """WorkflowRunActionScopeRepetitionOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + workflow_name: str, + run_name: str, + action_name: str, + **kwargs + ) -> "models.WorkflowRunActionRepetitionDefinitionCollection": + """List the workflow run action scoped repetitions. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRunActionRepetitionDefinitionCollection or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRunActionRepetitionDefinitionCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRunActionRepetitionDefinitionCollection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowRunActionRepetitionDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions'} + + async def get( + self, + resource_group_name: str, + workflow_name: str, + run_name: str, + action_name: str, + repetition_name: str, + **kwargs + ) -> "models.WorkflowRunActionRepetitionDefinition": + """Get a workflow run action scoped repetition. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :param repetition_name: The workflow repetition. + :type repetition_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRunActionRepetitionDefinition or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRunActionRepetitionDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRunActionRepetitionDefinition"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + 'repetitionName': self._serialize.url("repetition_name", repetition_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowRunActionRepetitionDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions/{repetitionName}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_operation_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_operation_operations_async.py new file mode 100644 index 00000000000..1f9a83baf7c --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_operation_operations_async.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowRunOperationOperations: + """WorkflowRunOperationOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + workflow_name: str, + run_name: str, + operation_id: str, + **kwargs + ) -> "models.WorkflowRun": + """Gets an operation for a run. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param operation_id: The workflow operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRun or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRun + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRun"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowRun', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/operations/{operationId}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_operations_async.py new file mode 100644 index 00000000000..6928623af09 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_run_operations_async.py @@ -0,0 +1,239 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowRunOperations: + """WorkflowRunOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + workflow_name: str, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs + ) -> "models.WorkflowRunListResult": + """Gets a list of workflow runs. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: Status, + StartTime, and ClientTrackingId. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRunListResult or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRunListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRunListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowRunListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs'} + + async def get( + self, + resource_group_name: str, + workflow_name: str, + run_name: str, + **kwargs + ) -> "models.WorkflowRun": + """Gets a workflow run. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRun or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRun + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRun"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowRun', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}'} + + async def cancel( + self, + resource_group_name: str, + workflow_name: str, + run_name: str, + **kwargs + ) -> None: + """Cancels a workflow run. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.cancel.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/cancel'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_trigger_history_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_trigger_history_operations_async.py new file mode 100644 index 00000000000..c312c502edf --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_trigger_history_operations_async.py @@ -0,0 +1,253 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowTriggerHistoryOperations: + """WorkflowTriggerHistoryOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + workflow_name: str, + trigger_name: str, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs + ) -> "models.WorkflowTriggerHistoryListResult": + """Gets a list of workflow trigger histories. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: Status, + StartTime, and ClientTrackingId. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerHistoryListResult or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerHistoryListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerHistoryListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowTriggerHistoryListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories'} + + async def get( + self, + resource_group_name: str, + workflow_name: str, + trigger_name: str, + history_name: str, + **kwargs + ) -> "models.WorkflowTriggerHistory": + """Gets a workflow trigger history. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :param history_name: The workflow trigger history name. Corresponds to the run name for + triggers that resulted in a run. + :type history_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerHistory or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerHistory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerHistory"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + 'historyName': self._serialize.url("history_name", history_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}'} + + async def resubmit( + self, + resource_group_name: str, + workflow_name: str, + trigger_name: str, + history_name: str, + **kwargs + ) -> None: + """Resubmits a workflow run based on the trigger history. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :param history_name: The workflow trigger history name. Corresponds to the run name for + triggers that resulted in a run. + :type history_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.resubmit.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + 'historyName': self._serialize.url("history_name", history_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + resubmit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}/resubmit'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_trigger_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_trigger_operations_async.py new file mode 100644 index 00000000000..f0089b62dc1 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_trigger_operations_async.py @@ -0,0 +1,481 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowTriggerOperations: + """WorkflowTriggerOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + workflow_name: str, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs + ) -> "models.WorkflowTriggerListResult": + """Gets a list of workflow triggers. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerListResult or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowTriggerListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers'} + + async def get( + self, + resource_group_name: str, + workflow_name: str, + trigger_name: str, + **kwargs + ) -> "models.WorkflowTrigger": + """Gets a workflow trigger. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTrigger or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTrigger + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTrigger"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTrigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}'} + + async def reset( + self, + resource_group_name: str, + workflow_name: str, + trigger_name: str, + **kwargs + ) -> None: + """Resets a workflow trigger. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.reset.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/reset'} + + async def run( + self, + resource_group_name: str, + workflow_name: str, + trigger_name: str, + **kwargs + ) -> None: + """Runs a workflow trigger. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.run.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in []: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize('object', response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + run.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/run'} + + async def get_schema_json( + self, + resource_group_name: str, + workflow_name: str, + trigger_name: str, + **kwargs + ) -> "models.JsonSchema": + """Get the trigger schema as JSON. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JsonSchema or the result of cls(response) + :rtype: ~logic_management_client.models.JsonSchema + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JsonSchema"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.get_schema_json.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('JsonSchema', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_schema_json.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/schemas/json'} + + async def set_state( + self, + resource_group_name: str, + workflow_name: str, + trigger_name: str, + source: "models.WorkflowTrigger", + **kwargs + ) -> None: + """Sets the state of a workflow trigger. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :param source: The source. + :type source: ~logic_management_client.models.WorkflowTrigger + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _set_state = models.SetTriggerStateActionDefinition(source=source) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.set_state.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_set_state, 'SetTriggerStateActionDefinition') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + set_state.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/setState'} + + async def list_callback_url( + self, + resource_group_name: str, + workflow_name: str, + trigger_name: str, + **kwargs + ) -> "models.WorkflowTriggerCallbackUrl": + """Get the callback URL for a workflow trigger. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.list_callback_url.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/listCallbackUrl'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_version_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_version_operations_async.py new file mode 100644 index 00000000000..a03d909848f --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_version_operations_async.py @@ -0,0 +1,177 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowVersionOperations: + """WorkflowVersionOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + workflow_name: str, + top: Optional[int] = None, + **kwargs + ) -> "models.WorkflowVersionListResult": + """Gets a list of workflow versions. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param top: The number of items to be included in the result. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowVersionListResult or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowVersionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowVersionListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowVersionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions'} + + async def get( + self, + resource_group_name: str, + workflow_name: str, + version_id: str, + **kwargs + ) -> "models.WorkflowVersion": + """Gets a workflow version. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param version_id: The workflow versionId. + :type version_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowVersion or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowVersion"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_version_trigger_operations_async.py b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_version_trigger_operations_async.py new file mode 100644 index 00000000000..527772d7cb7 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/aio/operations_async/_workflow_version_trigger_operations_async.py @@ -0,0 +1,122 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowVersionTriggerOperations: + """WorkflowVersionTriggerOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list_callback_url( + self, + resource_group_name: str, + workflow_name: str, + version_id: str, + trigger_name: str, + not_after: Optional[datetime.datetime] = None, + key_type: Optional[Union[str, "models.KeyType"]] = None, + **kwargs + ) -> "models.WorkflowTriggerCallbackUrl": + """Get the callback url for a trigger of a workflow version. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param version_id: The workflow versionId. + :type version_id: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.GetCallbackUrlParameters(not_after=not_after, key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.list_callback_url.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + if _parameters is not None: + body_content = self._serialize.body(_parameters, 'GetCallbackUrlParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}/triggers/{triggerName}/listCallbackUrl'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/models/__init__.py b/src/logic/azext_logic/vendored_sdks/logic/models/__init__.py new file mode 100644 index 00000000000..0ae4722c172 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/models/__init__.py @@ -0,0 +1,671 @@ +# 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 AgreementContent + from ._models_py3 import ApiDeploymentParameterMetadata + from ._models_py3 import ApiDeploymentParameterMetadataSet + from ._models_py3 import ApiOperation + from ._models_py3 import ApiOperationAnnotation + from ._models_py3 import ApiOperationListResult + from ._models_py3 import ApiOperationPropertiesDefinition + from ._models_py3 import ApiReference + from ._models_py3 import ApiResourceBackendService + from ._models_py3 import ApiResourceDefinitions + from ._models_py3 import ApiResourceGeneralInformation + from ._models_py3 import ApiResourceMetadata + from ._models_py3 import ApiResourcePolicies + from ._models_py3 import ApiResourceProperties + from ._models_py3 import ArtifactContentPropertiesDefinition + from ._models_py3 import ArtifactProperties + from ._models_py3 import As2AcknowledgementConnectionSettings + from ._models_py3 import As2AgreementContent + from ._models_py3 import As2EnvelopeSettings + from ._models_py3 import As2ErrorSettings + from ._models_py3 import As2MdnSettings + from ._models_py3 import As2MessageConnectionSettings + from ._models_py3 import As2OneWayAgreement + from ._models_py3 import As2ProtocolSettings + from ._models_py3 import As2SecuritySettings + from ._models_py3 import As2ValidationSettings + from ._models_py3 import AssemblyCollection + from ._models_py3 import AssemblyDefinition + from ._models_py3 import AssemblyProperties + from ._models_py3 import AzureResourceErrorInfo + from ._models_py3 import B2BPartnerContent + from ._models_py3 import BatchConfiguration + from ._models_py3 import BatchConfigurationCollection + from ._models_py3 import BatchConfigurationProperties + from ._models_py3 import BatchReleaseCriteria + from ._models_py3 import BusinessIdentity + from ._models_py3 import CallbackUrl + from ._models_py3 import ContentHash + from ._models_py3 import ContentLink + from ._models_py3 import Correlation + from ._models_py3 import EdifactAcknowledgementSettings + from ._models_py3 import EdifactAgreementContent + from ._models_py3 import EdifactDelimiterOverride + from ._models_py3 import EdifactEnvelopeOverride + from ._models_py3 import EdifactEnvelopeSettings + from ._models_py3 import EdifactFramingSettings + from ._models_py3 import EdifactMessageFilter + from ._models_py3 import EdifactMessageIdentifier + from ._models_py3 import EdifactOneWayAgreement + from ._models_py3 import EdifactProcessingSettings + from ._models_py3 import EdifactProtocolSettings + from ._models_py3 import EdifactSchemaReference + from ._models_py3 import EdifactValidationOverride + from ._models_py3 import EdifactValidationSettings + from ._models_py3 import ErrorInfo + from ._models_py3 import ErrorProperties + from ._models_py3 import ErrorResponse + from ._models_py3 import Expression + from ._models_py3 import ExpressionRoot + from ._models_py3 import ExpressionTraces + from ._models_py3 import ExtendedErrorInfo + from ._models_py3 import FlowEndpoints + from ._models_py3 import FlowEndpointsConfiguration + from ._models_py3 import GenerateUpgradedDefinitionParameters + from ._models_py3 import GetCallbackUrlParameters + from ._models_py3 import IntegrationAccount + from ._models_py3 import IntegrationAccountAgreement + from ._models_py3 import IntegrationAccountAgreementFilter + from ._models_py3 import IntegrationAccountAgreementListResult + from ._models_py3 import IntegrationAccountCertificate + from ._models_py3 import IntegrationAccountCertificateListResult + from ._models_py3 import IntegrationAccountListResult + from ._models_py3 import IntegrationAccountMap + from ._models_py3 import IntegrationAccountMapFilter + from ._models_py3 import IntegrationAccountMapListResult + from ._models_py3 import IntegrationAccountMapPropertiesParametersSchema + from ._models_py3 import IntegrationAccountPartner + from ._models_py3 import IntegrationAccountPartnerFilter + from ._models_py3 import IntegrationAccountPartnerListResult + from ._models_py3 import IntegrationAccountSchema + from ._models_py3 import IntegrationAccountSchemaFilter + from ._models_py3 import IntegrationAccountSchemaListResult + from ._models_py3 import IntegrationAccountSession + from ._models_py3 import IntegrationAccountSessionFilter + from ._models_py3 import IntegrationAccountSessionListResult + from ._models_py3 import IntegrationAccountSku + from ._models_py3 import IntegrationServiceEnvironment + from ._models_py3 import IntegrationServiceEnvironmentAccessEndpoint + from ._models_py3 import IntegrationServiceEnvironmentListResult + from ._models_py3 import IntegrationServiceEnvironmentNetworkDependency + from ._models_py3 import IntegrationServiceEnvironmentNetworkDependencyHealth + from ._models_py3 import IntegrationServiceEnvironmentNetworkEndpoint + from ._models_py3 import IntegrationServiceEnvironmentProperties + from ._models_py3 import IntegrationServiceEnvironmentSku + from ._models_py3 import IntegrationServiceEnvironmentSkuCapacity + from ._models_py3 import IntegrationServiceEnvironmentSkuDefinition + from ._models_py3 import IntegrationServiceEnvironmentSkuDefinitionSku + from ._models_py3 import IntegrationServiceEnvironmentSkuList + from ._models_py3 import IntegrationServiceEnvironmentSubnetNetworkHealth + from ._models_py3 import IpAddress + from ._models_py3 import JsonSchema + from ._models_py3 import KeyVaultKey + from ._models_py3 import KeyVaultKeyAttributes + from ._models_py3 import KeyVaultKeyCollection + from ._models_py3 import KeyVaultKeyReference + from ._models_py3 import KeyVaultKeyReferenceKeyVault + from ._models_py3 import KeyVaultReference + from ._models_py3 import ListKeyVaultKeysDefinition + from ._models_py3 import ManagedApi + from ._models_py3 import ManagedApiListResult + from ._models_py3 import NetworkConfiguration + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult + from ._models_py3 import OperationResult + from ._models_py3 import OperationResultProperties + from ._models_py3 import PartnerContent + from ._models_py3 import RecurrenceSchedule + from ._models_py3 import RecurrenceScheduleOccurrence + from ._models_py3 import RegenerateActionParameter + from ._models_py3 import RepetitionIndex + from ._models_py3 import Request + from ._models_py3 import RequestHistory + from ._models_py3 import RequestHistoryListResult + from ._models_py3 import RequestHistoryProperties + from ._models_py3 import Resource + from ._models_py3 import ResourceReference + from ._models_py3 import Response + from ._models_py3 import RetryHistory + from ._models_py3 import RunActionCorrelation + from ._models_py3 import RunCorrelation + from ._models_py3 import SetTriggerStateActionDefinition + from ._models_py3 import Sku + from ._models_py3 import SubResource + from ._models_py3 import SwaggerCustomDynamicList + from ._models_py3 import SwaggerCustomDynamicProperties + from ._models_py3 import SwaggerCustomDynamicSchema + from ._models_py3 import SwaggerCustomDynamicTree + from ._models_py3 import SwaggerCustomDynamicTreeCommand + from ._models_py3 import SwaggerCustomDynamicTreeParameter + from ._models_py3 import SwaggerCustomDynamicTreeSettings + from ._models_py3 import SwaggerExternalDocumentation + from ._models_py3 import SwaggerSchema + from ._models_py3 import SwaggerXml + from ._models_py3 import TrackingEvent + from ._models_py3 import TrackingEventErrorInfo + from ._models_py3 import TrackingEventsDefinition + from ._models_py3 import Workflow + from ._models_py3 import WorkflowFilter + from ._models_py3 import WorkflowListResult + from ._models_py3 import WorkflowOutputParameter + from ._models_py3 import WorkflowParameter + from ._models_py3 import WorkflowRun + from ._models_py3 import WorkflowRunAction + from ._models_py3 import WorkflowRunActionFilter + from ._models_py3 import WorkflowRunActionListResult + from ._models_py3 import WorkflowRunActionRepetitionDefinition + from ._models_py3 import WorkflowRunActionRepetitionDefinitionCollection + from ._models_py3 import WorkflowRunActionRepetitionProperties + from ._models_py3 import WorkflowRunFilter + from ._models_py3 import WorkflowRunListResult + from ._models_py3 import WorkflowRunTrigger + from ._models_py3 import WorkflowTrigger + from ._models_py3 import WorkflowTriggerCallbackUrl + from ._models_py3 import WorkflowTriggerFilter + from ._models_py3 import WorkflowTriggerHistory + from ._models_py3 import WorkflowTriggerHistoryFilter + from ._models_py3 import WorkflowTriggerHistoryListResult + from ._models_py3 import WorkflowTriggerListCallbackUrlQueries + from ._models_py3 import WorkflowTriggerListResult + from ._models_py3 import WorkflowTriggerRecurrence + from ._models_py3 import WorkflowVersion + from ._models_py3 import WorkflowVersionListResult + from ._models_py3 import WsdlService + from ._models_py3 import X12AcknowledgementSettings + from ._models_py3 import X12AgreementContent + from ._models_py3 import X12DelimiterOverrides + from ._models_py3 import X12EnvelopeOverride + from ._models_py3 import X12EnvelopeSettings + from ._models_py3 import X12FramingSettings + from ._models_py3 import X12MessageFilter + from ._models_py3 import X12MessageIdentifier + from ._models_py3 import X12OneWayAgreement + from ._models_py3 import X12ProcessingSettings + from ._models_py3 import X12ProtocolSettings + from ._models_py3 import X12SchemaReference + from ._models_py3 import X12SecuritySettings + from ._models_py3 import X12ValidationOverride + from ._models_py3 import X12ValidationSettings +except (SyntaxError, ImportError): + from ._models import AgreementContent # type: ignore + from ._models import ApiDeploymentParameterMetadata # type: ignore + from ._models import ApiDeploymentParameterMetadataSet # type: ignore + from ._models import ApiOperation # type: ignore + from ._models import ApiOperationAnnotation # type: ignore + from ._models import ApiOperationListResult # type: ignore + from ._models import ApiOperationPropertiesDefinition # type: ignore + from ._models import ApiReference # type: ignore + from ._models import ApiResourceBackendService # type: ignore + from ._models import ApiResourceDefinitions # type: ignore + from ._models import ApiResourceGeneralInformation # type: ignore + from ._models import ApiResourceMetadata # type: ignore + from ._models import ApiResourcePolicies # type: ignore + from ._models import ApiResourceProperties # type: ignore + from ._models import ArtifactContentPropertiesDefinition # type: ignore + from ._models import ArtifactProperties # type: ignore + from ._models import As2AcknowledgementConnectionSettings # type: ignore + from ._models import As2AgreementContent # type: ignore + from ._models import As2EnvelopeSettings # type: ignore + from ._models import As2ErrorSettings # type: ignore + from ._models import As2MdnSettings # type: ignore + from ._models import As2MessageConnectionSettings # type: ignore + from ._models import As2OneWayAgreement # type: ignore + from ._models import As2ProtocolSettings # type: ignore + from ._models import As2SecuritySettings # type: ignore + from ._models import As2ValidationSettings # type: ignore + from ._models import AssemblyCollection # type: ignore + from ._models import AssemblyDefinition # type: ignore + from ._models import AssemblyProperties # type: ignore + from ._models import AzureResourceErrorInfo # type: ignore + from ._models import B2BPartnerContent # type: ignore + from ._models import BatchConfiguration # type: ignore + from ._models import BatchConfigurationCollection # type: ignore + from ._models import BatchConfigurationProperties # type: ignore + from ._models import BatchReleaseCriteria # type: ignore + from ._models import BusinessIdentity # type: ignore + from ._models import CallbackUrl # type: ignore + from ._models import ContentHash # type: ignore + from ._models import ContentLink # type: ignore + from ._models import Correlation # type: ignore + from ._models import EdifactAcknowledgementSettings # type: ignore + from ._models import EdifactAgreementContent # type: ignore + from ._models import EdifactDelimiterOverride # type: ignore + from ._models import EdifactEnvelopeOverride # type: ignore + from ._models import EdifactEnvelopeSettings # type: ignore + from ._models import EdifactFramingSettings # type: ignore + from ._models import EdifactMessageFilter # type: ignore + from ._models import EdifactMessageIdentifier # type: ignore + from ._models import EdifactOneWayAgreement # type: ignore + from ._models import EdifactProcessingSettings # type: ignore + from ._models import EdifactProtocolSettings # type: ignore + from ._models import EdifactSchemaReference # type: ignore + from ._models import EdifactValidationOverride # type: ignore + from ._models import EdifactValidationSettings # type: ignore + from ._models import ErrorInfo # type: ignore + from ._models import ErrorProperties # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import Expression # type: ignore + from ._models import ExpressionRoot # type: ignore + from ._models import ExpressionTraces # type: ignore + from ._models import ExtendedErrorInfo # type: ignore + from ._models import FlowEndpoints # type: ignore + from ._models import FlowEndpointsConfiguration # type: ignore + from ._models import GenerateUpgradedDefinitionParameters # type: ignore + from ._models import GetCallbackUrlParameters # type: ignore + from ._models import IntegrationAccount # type: ignore + from ._models import IntegrationAccountAgreement # type: ignore + from ._models import IntegrationAccountAgreementFilter # type: ignore + from ._models import IntegrationAccountAgreementListResult # type: ignore + from ._models import IntegrationAccountCertificate # type: ignore + from ._models import IntegrationAccountCertificateListResult # type: ignore + from ._models import IntegrationAccountListResult # type: ignore + from ._models import IntegrationAccountMap # type: ignore + from ._models import IntegrationAccountMapFilter # type: ignore + from ._models import IntegrationAccountMapListResult # type: ignore + from ._models import IntegrationAccountMapPropertiesParametersSchema # type: ignore + from ._models import IntegrationAccountPartner # type: ignore + from ._models import IntegrationAccountPartnerFilter # type: ignore + from ._models import IntegrationAccountPartnerListResult # type: ignore + from ._models import IntegrationAccountSchema # type: ignore + from ._models import IntegrationAccountSchemaFilter # type: ignore + from ._models import IntegrationAccountSchemaListResult # type: ignore + from ._models import IntegrationAccountSession # type: ignore + from ._models import IntegrationAccountSessionFilter # type: ignore + from ._models import IntegrationAccountSessionListResult # type: ignore + from ._models import IntegrationAccountSku # type: ignore + from ._models import IntegrationServiceEnvironment # type: ignore + from ._models import IntegrationServiceEnvironmentAccessEndpoint # type: ignore + from ._models import IntegrationServiceEnvironmentListResult # type: ignore + from ._models import IntegrationServiceEnvironmentNetworkDependency # type: ignore + from ._models import IntegrationServiceEnvironmentNetworkDependencyHealth # type: ignore + from ._models import IntegrationServiceEnvironmentNetworkEndpoint # type: ignore + from ._models import IntegrationServiceEnvironmentProperties # type: ignore + from ._models import IntegrationServiceEnvironmentSku # type: ignore + from ._models import IntegrationServiceEnvironmentSkuCapacity # type: ignore + from ._models import IntegrationServiceEnvironmentSkuDefinition # type: ignore + from ._models import IntegrationServiceEnvironmentSkuDefinitionSku # type: ignore + from ._models import IntegrationServiceEnvironmentSkuList # type: ignore + from ._models import IntegrationServiceEnvironmentSubnetNetworkHealth # type: ignore + from ._models import IpAddress # type: ignore + from ._models import JsonSchema # type: ignore + from ._models import KeyVaultKey # type: ignore + from ._models import KeyVaultKeyAttributes # type: ignore + from ._models import KeyVaultKeyCollection # type: ignore + from ._models import KeyVaultKeyReference # type: ignore + from ._models import KeyVaultKeyReferenceKeyVault # type: ignore + from ._models import KeyVaultReference # type: ignore + from ._models import ListKeyVaultKeysDefinition # type: ignore + from ._models import ManagedApi # type: ignore + from ._models import ManagedApiListResult # type: ignore + from ._models import NetworkConfiguration # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore + from ._models import OperationResult # type: ignore + from ._models import OperationResultProperties # type: ignore + from ._models import PartnerContent # type: ignore + from ._models import RecurrenceSchedule # type: ignore + from ._models import RecurrenceScheduleOccurrence # type: ignore + from ._models import RegenerateActionParameter # type: ignore + from ._models import RepetitionIndex # type: ignore + from ._models import Request # type: ignore + from ._models import RequestHistory # type: ignore + from ._models import RequestHistoryListResult # type: ignore + from ._models import RequestHistoryProperties # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceReference # type: ignore + from ._models import Response # type: ignore + from ._models import RetryHistory # type: ignore + from ._models import RunActionCorrelation # type: ignore + from ._models import RunCorrelation # type: ignore + from ._models import SetTriggerStateActionDefinition # type: ignore + from ._models import Sku # type: ignore + from ._models import SubResource # type: ignore + from ._models import SwaggerCustomDynamicList # type: ignore + from ._models import SwaggerCustomDynamicProperties # type: ignore + from ._models import SwaggerCustomDynamicSchema # type: ignore + from ._models import SwaggerCustomDynamicTree # type: ignore + from ._models import SwaggerCustomDynamicTreeCommand # type: ignore + from ._models import SwaggerCustomDynamicTreeParameter # type: ignore + from ._models import SwaggerCustomDynamicTreeSettings # type: ignore + from ._models import SwaggerExternalDocumentation # type: ignore + from ._models import SwaggerSchema # type: ignore + from ._models import SwaggerXml # type: ignore + from ._models import TrackingEvent # type: ignore + from ._models import TrackingEventErrorInfo # type: ignore + from ._models import TrackingEventsDefinition # type: ignore + from ._models import Workflow # type: ignore + from ._models import WorkflowFilter # type: ignore + from ._models import WorkflowListResult # type: ignore + from ._models import WorkflowOutputParameter # type: ignore + from ._models import WorkflowParameter # type: ignore + from ._models import WorkflowRun # type: ignore + from ._models import WorkflowRunAction # type: ignore + from ._models import WorkflowRunActionFilter # type: ignore + from ._models import WorkflowRunActionListResult # type: ignore + from ._models import WorkflowRunActionRepetitionDefinition # type: ignore + from ._models import WorkflowRunActionRepetitionDefinitionCollection # type: ignore + from ._models import WorkflowRunActionRepetitionProperties # type: ignore + from ._models import WorkflowRunFilter # type: ignore + from ._models import WorkflowRunListResult # type: ignore + from ._models import WorkflowRunTrigger # type: ignore + from ._models import WorkflowTrigger # type: ignore + from ._models import WorkflowTriggerCallbackUrl # type: ignore + from ._models import WorkflowTriggerFilter # type: ignore + from ._models import WorkflowTriggerHistory # type: ignore + from ._models import WorkflowTriggerHistoryFilter # type: ignore + from ._models import WorkflowTriggerHistoryListResult # type: ignore + from ._models import WorkflowTriggerListCallbackUrlQueries # type: ignore + from ._models import WorkflowTriggerListResult # type: ignore + from ._models import WorkflowTriggerRecurrence # type: ignore + from ._models import WorkflowVersion # type: ignore + from ._models import WorkflowVersionListResult # type: ignore + from ._models import WsdlService # type: ignore + from ._models import X12AcknowledgementSettings # type: ignore + from ._models import X12AgreementContent # type: ignore + from ._models import X12DelimiterOverrides # type: ignore + from ._models import X12EnvelopeOverride # type: ignore + from ._models import X12EnvelopeSettings # type: ignore + from ._models import X12FramingSettings # type: ignore + from ._models import X12MessageFilter # type: ignore + from ._models import X12MessageIdentifier # type: ignore + from ._models import X12OneWayAgreement # type: ignore + from ._models import X12ProcessingSettings # type: ignore + from ._models import X12ProtocolSettings # type: ignore + from ._models import X12SchemaReference # type: ignore + from ._models import X12SecuritySettings # type: ignore + from ._models import X12ValidationOverride # type: ignore + from ._models import X12ValidationSettings # type: ignore + +from ._logic_management_client_enums import ( + AgreementType, + ApiDeploymentParameterVisibility, + ApiTier, + ApiType, + AzureAsyncOperationState, + DayOfWeek, + DaysOfWeek, + EdifactCharacterSet, + EdifactDecimalIndicator, + EncryptionAlgorithm, + ErrorResponseCode, + EventLevel, + HashingAlgorithm, + IntegrationAccountSkuName, + IntegrationServiceEnvironmentAccessEndpointType, + IntegrationServiceEnvironmentNetworkDependencyCategoryType, + IntegrationServiceEnvironmentNetworkDependencyHealthState, + IntegrationServiceEnvironmentNetworkEndPointAccessibilityState, + IntegrationServiceEnvironmentSkuName, + IntegrationServiceEnvironmentSkuScaleType, + KeyType, + MapType, + MessageFilterType, + ParameterType, + PartnerType, + RecurrenceFrequency, + SchemaType, + SegmentTerminatorSuffix, + SigningAlgorithm, + SkuName, + StatusAnnotation, + SwaggerSchemaType, + TrackEventsOperationOptions, + TrackingRecordType, + TrailingSeparatorPolicy, + UsageIndicator, + WorkflowProvisioningState, + WorkflowState, + WorkflowStatus, + WorkflowTriggerProvisioningState, + WsdlImportMethod, + X12CharacterSet, + X12DateFormat, + X12TimeFormat, +) + +__all__ = [ + 'AgreementContent', + 'ApiDeploymentParameterMetadata', + 'ApiDeploymentParameterMetadataSet', + 'ApiOperation', + 'ApiOperationAnnotation', + 'ApiOperationListResult', + 'ApiOperationPropertiesDefinition', + 'ApiReference', + 'ApiResourceBackendService', + 'ApiResourceDefinitions', + 'ApiResourceGeneralInformation', + 'ApiResourceMetadata', + 'ApiResourcePolicies', + 'ApiResourceProperties', + 'ArtifactContentPropertiesDefinition', + 'ArtifactProperties', + 'As2AcknowledgementConnectionSettings', + 'As2AgreementContent', + 'As2EnvelopeSettings', + 'As2ErrorSettings', + 'As2MdnSettings', + 'As2MessageConnectionSettings', + 'As2OneWayAgreement', + 'As2ProtocolSettings', + 'As2SecuritySettings', + 'As2ValidationSettings', + 'AssemblyCollection', + 'AssemblyDefinition', + 'AssemblyProperties', + 'AzureResourceErrorInfo', + 'B2BPartnerContent', + 'BatchConfiguration', + 'BatchConfigurationCollection', + 'BatchConfigurationProperties', + 'BatchReleaseCriteria', + 'BusinessIdentity', + 'CallbackUrl', + 'ContentHash', + 'ContentLink', + 'Correlation', + 'EdifactAcknowledgementSettings', + 'EdifactAgreementContent', + 'EdifactDelimiterOverride', + 'EdifactEnvelopeOverride', + 'EdifactEnvelopeSettings', + 'EdifactFramingSettings', + 'EdifactMessageFilter', + 'EdifactMessageIdentifier', + 'EdifactOneWayAgreement', + 'EdifactProcessingSettings', + 'EdifactProtocolSettings', + 'EdifactSchemaReference', + 'EdifactValidationOverride', + 'EdifactValidationSettings', + 'ErrorInfo', + 'ErrorProperties', + 'ErrorResponse', + 'Expression', + 'ExpressionRoot', + 'ExpressionTraces', + 'ExtendedErrorInfo', + 'FlowEndpoints', + 'FlowEndpointsConfiguration', + 'GenerateUpgradedDefinitionParameters', + 'GetCallbackUrlParameters', + 'IntegrationAccount', + 'IntegrationAccountAgreement', + 'IntegrationAccountAgreementFilter', + 'IntegrationAccountAgreementListResult', + 'IntegrationAccountCertificate', + 'IntegrationAccountCertificateListResult', + 'IntegrationAccountListResult', + 'IntegrationAccountMap', + 'IntegrationAccountMapFilter', + 'IntegrationAccountMapListResult', + 'IntegrationAccountMapPropertiesParametersSchema', + 'IntegrationAccountPartner', + 'IntegrationAccountPartnerFilter', + 'IntegrationAccountPartnerListResult', + 'IntegrationAccountSchema', + 'IntegrationAccountSchemaFilter', + 'IntegrationAccountSchemaListResult', + 'IntegrationAccountSession', + 'IntegrationAccountSessionFilter', + 'IntegrationAccountSessionListResult', + 'IntegrationAccountSku', + 'IntegrationServiceEnvironment', + 'IntegrationServiceEnvironmentAccessEndpoint', + 'IntegrationServiceEnvironmentListResult', + 'IntegrationServiceEnvironmentNetworkDependency', + 'IntegrationServiceEnvironmentNetworkDependencyHealth', + 'IntegrationServiceEnvironmentNetworkEndpoint', + 'IntegrationServiceEnvironmentProperties', + 'IntegrationServiceEnvironmentSku', + 'IntegrationServiceEnvironmentSkuCapacity', + 'IntegrationServiceEnvironmentSkuDefinition', + 'IntegrationServiceEnvironmentSkuDefinitionSku', + 'IntegrationServiceEnvironmentSkuList', + 'IntegrationServiceEnvironmentSubnetNetworkHealth', + 'IpAddress', + 'JsonSchema', + 'KeyVaultKey', + 'KeyVaultKeyAttributes', + 'KeyVaultKeyCollection', + 'KeyVaultKeyReference', + 'KeyVaultKeyReferenceKeyVault', + 'KeyVaultReference', + 'ListKeyVaultKeysDefinition', + 'ManagedApi', + 'ManagedApiListResult', + 'NetworkConfiguration', + 'Operation', + 'OperationDisplay', + 'OperationListResult', + 'OperationResult', + 'OperationResultProperties', + 'PartnerContent', + 'RecurrenceSchedule', + 'RecurrenceScheduleOccurrence', + 'RegenerateActionParameter', + 'RepetitionIndex', + 'Request', + 'RequestHistory', + 'RequestHistoryListResult', + 'RequestHistoryProperties', + 'Resource', + 'ResourceReference', + 'Response', + 'RetryHistory', + 'RunActionCorrelation', + 'RunCorrelation', + 'SetTriggerStateActionDefinition', + 'Sku', + 'SubResource', + 'SwaggerCustomDynamicList', + 'SwaggerCustomDynamicProperties', + 'SwaggerCustomDynamicSchema', + 'SwaggerCustomDynamicTree', + 'SwaggerCustomDynamicTreeCommand', + 'SwaggerCustomDynamicTreeParameter', + 'SwaggerCustomDynamicTreeSettings', + 'SwaggerExternalDocumentation', + 'SwaggerSchema', + 'SwaggerXml', + 'TrackingEvent', + 'TrackingEventErrorInfo', + 'TrackingEventsDefinition', + 'Workflow', + 'WorkflowFilter', + 'WorkflowListResult', + 'WorkflowOutputParameter', + 'WorkflowParameter', + 'WorkflowRun', + 'WorkflowRunAction', + 'WorkflowRunActionFilter', + 'WorkflowRunActionListResult', + 'WorkflowRunActionRepetitionDefinition', + 'WorkflowRunActionRepetitionDefinitionCollection', + 'WorkflowRunActionRepetitionProperties', + 'WorkflowRunFilter', + 'WorkflowRunListResult', + 'WorkflowRunTrigger', + 'WorkflowTrigger', + 'WorkflowTriggerCallbackUrl', + 'WorkflowTriggerFilter', + 'WorkflowTriggerHistory', + 'WorkflowTriggerHistoryFilter', + 'WorkflowTriggerHistoryListResult', + 'WorkflowTriggerListCallbackUrlQueries', + 'WorkflowTriggerListResult', + 'WorkflowTriggerRecurrence', + 'WorkflowVersion', + 'WorkflowVersionListResult', + 'WsdlService', + 'X12AcknowledgementSettings', + 'X12AgreementContent', + 'X12DelimiterOverrides', + 'X12EnvelopeOverride', + 'X12EnvelopeSettings', + 'X12FramingSettings', + 'X12MessageFilter', + 'X12MessageIdentifier', + 'X12OneWayAgreement', + 'X12ProcessingSettings', + 'X12ProtocolSettings', + 'X12SchemaReference', + 'X12SecuritySettings', + 'X12ValidationOverride', + 'X12ValidationSettings', + 'AgreementType', + 'ApiDeploymentParameterVisibility', + 'ApiTier', + 'ApiType', + 'AzureAsyncOperationState', + 'DayOfWeek', + 'DaysOfWeek', + 'EdifactCharacterSet', + 'EdifactDecimalIndicator', + 'EncryptionAlgorithm', + 'ErrorResponseCode', + 'EventLevel', + 'HashingAlgorithm', + 'IntegrationAccountSkuName', + 'IntegrationServiceEnvironmentAccessEndpointType', + 'IntegrationServiceEnvironmentNetworkDependencyCategoryType', + 'IntegrationServiceEnvironmentNetworkDependencyHealthState', + 'IntegrationServiceEnvironmentNetworkEndPointAccessibilityState', + 'IntegrationServiceEnvironmentSkuName', + 'IntegrationServiceEnvironmentSkuScaleType', + 'KeyType', + 'MapType', + 'MessageFilterType', + 'ParameterType', + 'PartnerType', + 'RecurrenceFrequency', + 'SchemaType', + 'SegmentTerminatorSuffix', + 'SigningAlgorithm', + 'SkuName', + 'StatusAnnotation', + 'SwaggerSchemaType', + 'TrackEventsOperationOptions', + 'TrackingRecordType', + 'TrailingSeparatorPolicy', + 'UsageIndicator', + 'WorkflowProvisioningState', + 'WorkflowState', + 'WorkflowStatus', + 'WorkflowTriggerProvisioningState', + 'WsdlImportMethod', + 'X12CharacterSet', + 'X12DateFormat', + 'X12TimeFormat', +] diff --git a/src/logic/azext_logic/vendored_sdks/logic/models/_logic_management_client_enums.py b/src/logic/azext_logic/vendored_sdks/logic/models/_logic_management_client_enums.py new file mode 100644 index 00000000000..df43fa81c24 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/models/_logic_management_client_enums.py @@ -0,0 +1,488 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + +class WorkflowProvisioningState(str, Enum): + """The workflow provisioning state. + """ + + not_specified = "NotSpecified" + accepted = "Accepted" + running = "Running" + ready = "Ready" + creating = "Creating" + created = "Created" + deleting = "Deleting" + deleted = "Deleted" + canceled = "Canceled" + failed = "Failed" + succeeded = "Succeeded" + moving = "Moving" + updating = "Updating" + registering = "Registering" + registered = "Registered" + unregistering = "Unregistering" + unregistered = "Unregistered" + completed = "Completed" + +class WorkflowState(str, Enum): + """The workflow state. + """ + + not_specified = "NotSpecified" + completed = "Completed" + enabled = "Enabled" + disabled = "Disabled" + deleted = "Deleted" + suspended = "Suspended" + +class ParameterType(str, Enum): + """The parameter type. + """ + + not_specified = "NotSpecified" + string = "String" + secure_string = "SecureString" + int = "Int" + float = "Float" + bool = "Bool" + array = "Array" + object = "Object" + secure_object = "SecureObject" + +class SkuName(str, Enum): + """The sku name. + """ + + not_specified = "NotSpecified" + free = "Free" + shared = "Shared" + basic = "Basic" + standard = "Standard" + premium = "Premium" + +class DaysOfWeek(str, Enum): + + sunday = "Sunday" + monday = "Monday" + tuesday = "Tuesday" + wednesday = "Wednesday" + thursday = "Thursday" + friday = "Friday" + saturday = "Saturday" + +class DayOfWeek(str, Enum): + """The day of the week. + """ + + sunday = "Sunday" + monday = "Monday" + tuesday = "Tuesday" + wednesday = "Wednesday" + thursday = "Thursday" + friday = "Friday" + saturday = "Saturday" + +class WorkflowTriggerProvisioningState(str, Enum): + """The workflow trigger provisioning state. + """ + + not_specified = "NotSpecified" + accepted = "Accepted" + running = "Running" + ready = "Ready" + creating = "Creating" + created = "Created" + deleting = "Deleting" + deleted = "Deleted" + canceled = "Canceled" + failed = "Failed" + succeeded = "Succeeded" + moving = "Moving" + updating = "Updating" + registering = "Registering" + registered = "Registered" + unregistering = "Unregistering" + unregistered = "Unregistered" + completed = "Completed" + +class WorkflowStatus(str, Enum): + """The workflow status. + """ + + not_specified = "NotSpecified" + paused = "Paused" + running = "Running" + waiting = "Waiting" + succeeded = "Succeeded" + skipped = "Skipped" + suspended = "Suspended" + cancelled = "Cancelled" + failed = "Failed" + faulted = "Faulted" + timed_out = "TimedOut" + aborted = "Aborted" + ignored = "Ignored" + +class RecurrenceFrequency(str, Enum): + """The recurrence frequency. + """ + + not_specified = "NotSpecified" + second = "Second" + minute = "Minute" + hour = "Hour" + day = "Day" + week = "Week" + month = "Month" + year = "Year" + +class IntegrationAccountSkuName(str, Enum): + """The integration account sku name. + """ + + not_specified = "NotSpecified" + free = "Free" + basic = "Basic" + standard = "Standard" + +class IntegrationServiceEnvironmentAccessEndpointType(str, Enum): + """The integration service environment access endpoint type. + """ + + not_specified = "NotSpecified" + external = "External" + internal = "Internal" + +class IntegrationServiceEnvironmentSkuName(str, Enum): + """The integration service environment sku name. + """ + + not_specified = "NotSpecified" + premium = "Premium" + developer = "Developer" + +class EventLevel(str, Enum): + """The event level. + """ + + log_always = "LogAlways" + critical = "Critical" + error = "Error" + warning = "Warning" + informational = "Informational" + verbose = "Verbose" + +class TrackingRecordType(str, Enum): + """The tracking record type. + """ + + not_specified = "NotSpecified" + custom = "Custom" + as2_message = "AS2Message" + as2_mdn = "AS2MDN" + x12_interchange = "X12Interchange" + x12_functional_group = "X12FunctionalGroup" + x12_transaction_set = "X12TransactionSet" + x12_interchange_acknowledgment = "X12InterchangeAcknowledgment" + x12_functional_group_acknowledgment = "X12FunctionalGroupAcknowledgment" + x12_transaction_set_acknowledgment = "X12TransactionSetAcknowledgment" + edifact_interchange = "EdifactInterchange" + edifact_functional_group = "EdifactFunctionalGroup" + edifact_transaction_set = "EdifactTransactionSet" + edifact_interchange_acknowledgment = "EdifactInterchangeAcknowledgment" + edifact_functional_group_acknowledgment = "EdifactFunctionalGroupAcknowledgment" + edifact_transaction_set_acknowledgment = "EdifactTransactionSetAcknowledgment" + +class SchemaType(str, Enum): + """The schema type. + """ + + not_specified = "NotSpecified" + xml = "Xml" + +class MapType(str, Enum): + """The map type. + """ + + not_specified = "NotSpecified" + xslt = "Xslt" + xslt20 = "Xslt20" + xslt30 = "Xslt30" + liquid = "Liquid" + +class PartnerType(str, Enum): + """The partner type. + """ + + not_specified = "NotSpecified" + b2_b = "B2B" + +class X12DateFormat(str, Enum): + """The x12 date format. + """ + + not_specified = "NotSpecified" + ccyymmdd = "CCYYMMDD" + yymmdd = "YYMMDD" + +class X12TimeFormat(str, Enum): + """The x12 time format. + """ + + not_specified = "NotSpecified" + hhmm = "HHMM" + hhmmss = "HHMMSS" + hhmms_sdd = "HHMMSSdd" + hhmms_sd = "HHMMSSd" + +class TrailingSeparatorPolicy(str, Enum): + """The trailing separator policy. + """ + + not_specified = "NotSpecified" + not_allowed = "NotAllowed" + optional = "Optional" + mandatory = "Mandatory" + +class SegmentTerminatorSuffix(str, Enum): + """The segment terminator suffix. + """ + + not_specified = "NotSpecified" + none = "None" + cr = "CR" + lf = "LF" + crlf = "CRLF" + +class EdifactDecimalIndicator(str, Enum): + """The edifact decimal indicator. + """ + + not_specified = "NotSpecified" + comma = "Comma" + decimal = "Decimal" + +class AgreementType(str, Enum): + """The agreement type. + """ + + not_specified = "NotSpecified" + as2 = "AS2" + x12 = "X12" + edifact = "Edifact" + +class HashingAlgorithm(str, Enum): + """The signing or hashing algorithm. + """ + + not_specified = "NotSpecified" + none = "None" + md5 = "MD5" + sha1 = "SHA1" + sha2256 = "SHA2256" + sha2384 = "SHA2384" + sha2512 = "SHA2512" + +class EncryptionAlgorithm(str, Enum): + """The encryption algorithm. + """ + + not_specified = "NotSpecified" + none = "None" + des3 = "DES3" + rc2 = "RC2" + aes128 = "AES128" + aes192 = "AES192" + aes256 = "AES256" + +class SigningAlgorithm(str, Enum): + """The signing or hashing algorithm. + """ + + not_specified = "NotSpecified" + default = "Default" + sha1 = "SHA1" + sha2256 = "SHA2256" + sha2384 = "SHA2384" + sha2512 = "SHA2512" + +class X12CharacterSet(str, Enum): + """The X12 character set. + """ + + not_specified = "NotSpecified" + basic = "Basic" + extended = "Extended" + utf8 = "UTF8" + +class UsageIndicator(str, Enum): + """The usage indicator. + """ + + not_specified = "NotSpecified" + test = "Test" + information = "Information" + production = "Production" + +class MessageFilterType(str, Enum): + """The message filter type. + """ + + not_specified = "NotSpecified" + include = "Include" + exclude = "Exclude" + +class EdifactCharacterSet(str, Enum): + """The edifact character set. + """ + + not_specified = "NotSpecified" + unob = "UNOB" + unoa = "UNOA" + unoc = "UNOC" + unod = "UNOD" + unoe = "UNOE" + unof = "UNOF" + unog = "UNOG" + unoh = "UNOH" + unoi = "UNOI" + unoj = "UNOJ" + unok = "UNOK" + unox = "UNOX" + unoy = "UNOY" + keca = "KECA" + +class IntegrationServiceEnvironmentSkuScaleType(str, Enum): + """The integration service environment sku scale type. + """ + + manual = "Manual" + automatic = "Automatic" + none = "None" + +class IntegrationServiceEnvironmentNetworkEndPointAccessibilityState(str, Enum): + """The integration service environment network endpoint accessibility state. + """ + + not_specified = "NotSpecified" + unknown = "Unknown" + available = "Available" + not_available = "NotAvailable" + +class IntegrationServiceEnvironmentNetworkDependencyCategoryType(str, Enum): + """The integration service environment network dependency category type. + """ + + not_specified = "NotSpecified" + azure_storage = "AzureStorage" + azure_management = "AzureManagement" + azure_active_directory = "AzureActiveDirectory" + ssl_certificate_verification = "SSLCertificateVerification" + diagnostic_logs_and_metrics = "DiagnosticLogsAndMetrics" + integration_service_environment_connectors = "IntegrationServiceEnvironmentConnectors" + redis_cache = "RedisCache" + access_endpoints = "AccessEndpoints" + recovery_service = "RecoveryService" + sql = "SQL" + regional_service = "RegionalService" + +class ErrorResponseCode(str, Enum): + """The error response code. + """ + + not_specified = "NotSpecified" + integration_service_environment_not_found = "IntegrationServiceEnvironmentNotFound" + internal_server_error = "InternalServerError" + invalid_operation_id = "InvalidOperationId" + +class ApiType(str, Enum): + + not_specified = "NotSpecified" + rest = "Rest" + soap = "Soap" + +class WsdlImportMethod(str, Enum): + """The WSDL import method. + """ + + not_specified = "NotSpecified" + soap_to_rest = "SoapToRest" + soap_pass_through = "SoapPassThrough" + +class ApiDeploymentParameterVisibility(str, Enum): + """The Api deployment parameter visibility. + """ + + not_specified = "NotSpecified" + default = "Default" + internal = "Internal" + +class ApiTier(str, Enum): + """The Api tier. + """ + + not_specified = "NotSpecified" + enterprise = "Enterprise" + standard = "Standard" + premium = "Premium" + +class SwaggerSchemaType(str, Enum): + """The swagger schema type. + """ + + string = "String" + number = "Number" + integer = "Integer" + boolean = "Boolean" + array = "Array" + file = "File" + object = "Object" + null = "Null" + +class StatusAnnotation(str, Enum): + """The status annotation. + """ + + not_specified = "NotSpecified" + preview = "Preview" + production = "Production" + +class KeyType(str, Enum): + """The key type. + """ + + not_specified = "NotSpecified" + primary = "Primary" + secondary = "Secondary" + +class TrackEventsOperationOptions(str, Enum): + """The track events operation options. + """ + + none = "None" + disable_source_info_enrich = "DisableSourceInfoEnrich" + +class IntegrationServiceEnvironmentNetworkDependencyHealthState(str, Enum): + """The integration service environment network dependency health state. + """ + + not_specified = "NotSpecified" + healthy = "Healthy" + unhealthy = "Unhealthy" + unknown = "Unknown" + +class AzureAsyncOperationState(str, Enum): + """The Azure async operation state. + """ + + failed = "Failed" + succeeded = "Succeeded" + pending = "Pending" + canceled = "Canceled" diff --git a/src/logic/azext_logic/vendored_sdks/logic/models/_models.py b/src/logic/azext_logic/vendored_sdks/logic/models/_models.py new file mode 100644 index 00000000000..baf7e711522 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/models/_models.py @@ -0,0 +1,7951 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AgreementContent(msrest.serialization.Model): + """The integration account agreement content. + + :param a_s2: The AS2 agreement content. + :type a_s2: ~azure.mgmt.logic.models.As2AgreementContent + :param x12: The X12 agreement content. + :type x12: ~azure.mgmt.logic.models.X12AgreementContent + :param edifact: The EDIFACT agreement content. + :type edifact: ~azure.mgmt.logic.models.EdifactAgreementContent + """ + + _attribute_map = { + 'a_s2': {'key': 'aS2', 'type': 'As2AgreementContent'}, + 'x12': {'key': 'x12', 'type': 'X12AgreementContent'}, + 'edifact': {'key': 'edifact', 'type': 'EdifactAgreementContent'}, + } + + def __init__( + self, + **kwargs + ): + super(AgreementContent, self).__init__(**kwargs) + self.a_s2 = kwargs.get('a_s2', None) + self.x12 = kwargs.get('x12', None) + self.edifact = kwargs.get('edifact', None) + + +class ApiDeploymentParameterMetadata(msrest.serialization.Model): + """The API deployment parameter metadata. + + :param type: The type. + :type type: str + :param is_required: Indicates whether its required. + :type is_required: bool + :param display_name: The display name. + :type display_name: str + :param description: The description. + :type description: str + :param visibility: The visibility. Possible values include: "NotSpecified", "Default", + "Internal". + :type visibility: str or ~azure.mgmt.logic.models.ApiDeploymentParameterVisibility + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'is_required': {'key': 'isRequired', 'type': 'bool'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'visibility': {'key': 'visibility', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiDeploymentParameterMetadata, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.is_required = kwargs.get('is_required', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.visibility = kwargs.get('visibility', None) + + +class ApiDeploymentParameterMetadataSet(msrest.serialization.Model): + """The API deployment parameters metadata. + + :param package_content_link: The package content link parameter. + :type package_content_link: ~azure.mgmt.logic.models.ApiDeploymentParameterMetadata + :param redis_cache_connection_string: The package content link parameter. + :type redis_cache_connection_string: ~azure.mgmt.logic.models.ApiDeploymentParameterMetadata + """ + + _attribute_map = { + 'package_content_link': {'key': 'packageContentLink', 'type': 'ApiDeploymentParameterMetadata'}, + 'redis_cache_connection_string': {'key': 'redisCacheConnectionString', 'type': 'ApiDeploymentParameterMetadata'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiDeploymentParameterMetadataSet, self).__init__(**kwargs) + self.package_content_link = kwargs.get('package_content_link', None) + self.redis_cache_connection_string = kwargs.get('redis_cache_connection_string', None) + + +class Resource(msrest.serialization.Model): + """The base resource type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + """ + + _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}'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class ApiOperation(Resource): + """The api operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param properties: The api operations properties. + :type properties: ~azure.mgmt.logic.models.ApiOperationPropertiesDefinition + """ + + _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}'}, + 'properties': {'key': 'properties', 'type': 'ApiOperationPropertiesDefinition'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiOperation, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ApiOperationAnnotation(msrest.serialization.Model): + """The Api Operation Annotation. + + :param status: The status annotation. Possible values include: "NotSpecified", "Preview", + "Production". + :type status: str or ~azure.mgmt.logic.models.StatusAnnotation + :param family: The family. + :type family: str + :param revision: The revision. + :type revision: int + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiOperationAnnotation, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.family = kwargs.get('family', None) + self.revision = kwargs.get('revision', None) + + +class ApiOperationListResult(msrest.serialization.Model): + """The list of managed API operations. + + :param value: The api operation definitions for an API. + :type value: list[~azure.mgmt.logic.models.ApiOperation] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApiOperation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiOperationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class ApiOperationPropertiesDefinition(msrest.serialization.Model): + """The api operations properties. + + :param summary: The summary of the api operation. + :type summary: str + :param description: The description of the api operation. + :type description: str + :param visibility: The visibility of the api operation. + :type visibility: str + :param trigger: The trigger type of api operation. + :type trigger: str + :param trigger_hint: The trigger hint for the api operation. + :type trigger_hint: str + :param pageable: Indicates whether the api operation is pageable. + :type pageable: bool + :param annotation: The annotation of api operation. + :type annotation: ~azure.mgmt.logic.models.ApiOperationAnnotation + :param api: The api reference. + :type api: ~azure.mgmt.logic.models.ApiReference + :param inputs_definition: The operation inputs definition schema. + :type inputs_definition: ~azure.mgmt.logic.models.SwaggerSchema + :param responses_definition: The operation responses definition schemas. + :type responses_definition: dict[str, ~azure.mgmt.logic.models.SwaggerSchema] + :param is_webhook: Indicates whether the API operation is webhook or not. + :type is_webhook: bool + :param is_notification: Indicates whether the API operation is notification or not. + :type is_notification: bool + """ + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'visibility': {'key': 'visibility', 'type': 'str'}, + 'trigger': {'key': 'trigger', 'type': 'str'}, + 'trigger_hint': {'key': 'triggerHint', 'type': 'str'}, + 'pageable': {'key': 'pageable', 'type': 'bool'}, + 'annotation': {'key': 'annotation', 'type': 'ApiOperationAnnotation'}, + 'api': {'key': 'api', 'type': 'ApiReference'}, + 'inputs_definition': {'key': 'inputsDefinition', 'type': 'SwaggerSchema'}, + 'responses_definition': {'key': 'responsesDefinition', 'type': '{SwaggerSchema}'}, + 'is_webhook': {'key': 'isWebhook', 'type': 'bool'}, + 'is_notification': {'key': 'isNotification', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiOperationPropertiesDefinition, self).__init__(**kwargs) + self.summary = kwargs.get('summary', None) + self.description = kwargs.get('description', None) + self.visibility = kwargs.get('visibility', None) + self.trigger = kwargs.get('trigger', None) + self.trigger_hint = kwargs.get('trigger_hint', None) + self.pageable = kwargs.get('pageable', None) + self.annotation = kwargs.get('annotation', None) + self.api = kwargs.get('api', None) + self.inputs_definition = kwargs.get('inputs_definition', None) + self.responses_definition = kwargs.get('responses_definition', None) + self.is_webhook = kwargs.get('is_webhook', None) + self.is_notification = kwargs.get('is_notification', None) + + +class ResourceReference(msrest.serialization.Model): + """The resource reference. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The resource id. + :type id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.type = None + + +class ApiReference(ResourceReference): + """The Api reference. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The resource id. + :type id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param display_name: The display name of the api. + :type display_name: str + :param description: The description of the api. + :type description: str + :param icon_uri: The icon uri of the api. + :type icon_uri: str + :param swagger: The swagger of the api. + :type swagger: object + :param brand_color: The brand color of the api. + :type brand_color: str + :param category: The tier. Possible values include: "NotSpecified", "Enterprise", "Standard", + "Premium". + :type category: str or ~azure.mgmt.logic.models.ApiTier + :param integration_service_environment: The integration service environment reference. + :type integration_service_environment: ~azure.mgmt.logic.models.ResourceReference + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'icon_uri': {'key': 'iconUri', 'type': 'str'}, + 'swagger': {'key': 'swagger', 'type': 'object'}, + 'brand_color': {'key': 'brandColor', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'integration_service_environment': {'key': 'integrationServiceEnvironment', 'type': 'ResourceReference'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiReference, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.icon_uri = kwargs.get('icon_uri', None) + self.swagger = kwargs.get('swagger', None) + self.brand_color = kwargs.get('brand_color', None) + self.category = kwargs.get('category', None) + self.integration_service_environment = kwargs.get('integration_service_environment', None) + + +class ApiResourceBackendService(msrest.serialization.Model): + """The API backend service. + + :param service_url: The service URL. + :type service_url: str + """ + + _attribute_map = { + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiResourceBackendService, self).__init__(**kwargs) + self.service_url = kwargs.get('service_url', None) + + +class ApiResourceDefinitions(msrest.serialization.Model): + """The Api resource definition. + + :param original_swagger_url: The original swagger url. + :type original_swagger_url: str + :param modified_swagger_url: The modified swagger url. + :type modified_swagger_url: str + """ + + _attribute_map = { + 'original_swagger_url': {'key': 'originalSwaggerUrl', 'type': 'str'}, + 'modified_swagger_url': {'key': 'modifiedSwaggerUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiResourceDefinitions, self).__init__(**kwargs) + self.original_swagger_url = kwargs.get('original_swagger_url', None) + self.modified_swagger_url = kwargs.get('modified_swagger_url', None) + + +class ApiResourceGeneralInformation(msrest.serialization.Model): + """The API general information. + + :param icon_url: The icon url. + :type icon_url: str + :param display_name: The display name. + :type display_name: str + :param description: The description. + :type description: str + :param terms_of_use_url: The terms of use url. + :type terms_of_use_url: str + :param release_tag: The release tag. + :type release_tag: str + :param tier: The tier. Possible values include: "NotSpecified", "Enterprise", "Standard", + "Premium". + :type tier: str or ~azure.mgmt.logic.models.ApiTier + """ + + _attribute_map = { + 'icon_url': {'key': 'iconUrl', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'terms_of_use_url': {'key': 'termsOfUseUrl', 'type': 'str'}, + 'release_tag': {'key': 'releaseTag', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiResourceGeneralInformation, self).__init__(**kwargs) + self.icon_url = kwargs.get('icon_url', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.terms_of_use_url = kwargs.get('terms_of_use_url', None) + self.release_tag = kwargs.get('release_tag', None) + self.tier = kwargs.get('tier', None) + + +class ApiResourceMetadata(msrest.serialization.Model): + """The api resource metadata. + + :param source: The source. + :type source: str + :param brand_color: The brand color. + :type brand_color: str + :param hide_key: The hide key. + :type hide_key: str + :param tags: A set of tags. The tags. + :type tags: dict[str, str] + :param api_type: The api type. Possible values include: "NotSpecified", "Rest", "Soap". + :type api_type: str or ~azure.mgmt.logic.models.ApiType + :param wsdl_service: The WSDL service. + :type wsdl_service: ~azure.mgmt.logic.models.WsdlService + :param wsdl_import_method: The WSDL import method. Possible values include: "NotSpecified", + "SoapToRest", "SoapPassThrough". + :type wsdl_import_method: str or ~azure.mgmt.logic.models.WsdlImportMethod + :param connection_type: The connection type. + :type connection_type: str + :param provisioning_state: The provisioning state. Possible values include: "NotSpecified", + "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", + "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :type provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState + :param deployment_parameters: The connector deployment parameters metadata. + :type deployment_parameters: ~azure.mgmt.logic.models.ApiDeploymentParameterMetadataSet + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'brand_color': {'key': 'brandColor', 'type': 'str'}, + 'hide_key': {'key': 'hideKey', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'api_type': {'key': 'ApiType', 'type': 'str'}, + 'wsdl_service': {'key': 'wsdlService', 'type': 'WsdlService'}, + 'wsdl_import_method': {'key': 'wsdlImportMethod', 'type': 'str'}, + 'connection_type': {'key': 'connectionType', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_parameters': {'key': 'deploymentParameters', 'type': 'ApiDeploymentParameterMetadataSet'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiResourceMetadata, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.brand_color = kwargs.get('brand_color', None) + self.hide_key = kwargs.get('hide_key', None) + self.tags = kwargs.get('tags', None) + self.api_type = kwargs.get('api_type', None) + self.wsdl_service = kwargs.get('wsdl_service', None) + self.wsdl_import_method = kwargs.get('wsdl_import_method', None) + self.connection_type = kwargs.get('connection_type', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.deployment_parameters = kwargs.get('deployment_parameters', None) + + +class ApiResourcePolicies(msrest.serialization.Model): + """The API resource policies. + + :param content: The API level only policies XML as embedded content. + :type content: str + :param content_link: The content link to the policies. + :type content_link: str + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'str'}, + 'content_link': {'key': 'contentLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiResourcePolicies, self).__init__(**kwargs) + self.content = kwargs.get('content', None) + self.content_link = kwargs.get('content_link', None) + + +class ApiResourceProperties(msrest.serialization.Model): + """The API resource properties. + + :param name: The name. + :type name: str + :param connection_parameters: The connection parameters. + :type connection_parameters: dict[str, object] + :param metadata: The metadata. + :type metadata: ~azure.mgmt.logic.models.ApiResourceMetadata + :param runtime_urls: The runtime urls. + :type runtime_urls: list[str] + :param general_information: The api general information. + :type general_information: ~azure.mgmt.logic.models.ApiResourceGeneralInformation + :param capabilities: The capabilities. + :type capabilities: list[str] + :param backend_service: The backend service. + :type backend_service: ~azure.mgmt.logic.models.ApiResourceBackendService + :param policies: The policies for the API. + :type policies: ~azure.mgmt.logic.models.ApiResourcePolicies + :param api_definition_url: The API definition. + :type api_definition_url: str + :param api_definitions: The api definitions. + :type api_definitions: ~azure.mgmt.logic.models.ApiResourceDefinitions + :param integration_service_environment: The integration service environment reference. + :type integration_service_environment: ~azure.mgmt.logic.models.ResourceReference + :param provisioning_state: The provisioning state. Possible values include: "NotSpecified", + "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", + "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :type provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState + :param category: The category. Possible values include: "NotSpecified", "Enterprise", + "Standard", "Premium". + :type category: str or ~azure.mgmt.logic.models.ApiTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'connection_parameters': {'key': 'connectionParameters', 'type': '{object}'}, + 'metadata': {'key': 'metadata', 'type': 'ApiResourceMetadata'}, + 'runtime_urls': {'key': 'runtimeUrls', 'type': '[str]'}, + 'general_information': {'key': 'generalInformation', 'type': 'ApiResourceGeneralInformation'}, + 'capabilities': {'key': 'capabilities', 'type': '[str]'}, + 'backend_service': {'key': 'backendService', 'type': 'ApiResourceBackendService'}, + 'policies': {'key': 'policies', 'type': 'ApiResourcePolicies'}, + 'api_definition_url': {'key': 'apiDefinitionUrl', 'type': 'str'}, + 'api_definitions': {'key': 'apiDefinitions', 'type': 'ApiResourceDefinitions'}, + 'integration_service_environment': {'key': 'integrationServiceEnvironment', 'type': 'ResourceReference'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiResourceProperties, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.connection_parameters = kwargs.get('connection_parameters', None) + self.metadata = kwargs.get('metadata', None) + self.runtime_urls = kwargs.get('runtime_urls', None) + self.general_information = kwargs.get('general_information', None) + self.capabilities = kwargs.get('capabilities', None) + self.backend_service = kwargs.get('backend_service', None) + self.policies = kwargs.get('policies', None) + self.api_definition_url = kwargs.get('api_definition_url', None) + self.api_definitions = kwargs.get('api_definitions', None) + self.integration_service_environment = kwargs.get('integration_service_environment', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.category = kwargs.get('category', None) + + +class ArtifactProperties(msrest.serialization.Model): + """The artifact properties definition. + + :param created_time: The artifact creation time. + :type created_time: ~datetime.datetime + :param changed_time: The artifact changed time. + :type changed_time: ~datetime.datetime + :param metadata: Any object. + :type metadata: object + """ + + _attribute_map = { + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ArtifactProperties, self).__init__(**kwargs) + self.created_time = kwargs.get('created_time', None) + self.changed_time = kwargs.get('changed_time', None) + self.metadata = kwargs.get('metadata', None) + + +class ArtifactContentPropertiesDefinition(ArtifactProperties): + """The artifact content properties definition. + + :param created_time: The artifact creation time. + :type created_time: ~datetime.datetime + :param changed_time: The artifact changed time. + :type changed_time: ~datetime.datetime + :param metadata: Any object. + :type metadata: object + :param content: Any object. + :type content: object + :param content_type: The content type. + :type content_type: str + :param content_link: The content link. + :type content_link: ~azure.mgmt.logic.models.ContentLink + """ + + _attribute_map = { + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + 'content': {'key': 'content', 'type': 'object'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'content_link': {'key': 'contentLink', 'type': 'ContentLink'}, + } + + def __init__( + self, + **kwargs + ): + super(ArtifactContentPropertiesDefinition, self).__init__(**kwargs) + self.content = kwargs.get('content', None) + self.content_type = kwargs.get('content_type', None) + self.content_link = kwargs.get('content_link', None) + + +class As2AcknowledgementConnectionSettings(msrest.serialization.Model): + """The AS2 agreement acknowledgement connection settings. + + All required parameters must be populated in order to send to Azure. + + :param ignore_certificate_name_mismatch: Required. Indicates whether to ignore mismatch in + certificate name. + :type ignore_certificate_name_mismatch: bool + :param support_http_status_code_continue: Required. Indicates whether to support HTTP status + code 'CONTINUE'. + :type support_http_status_code_continue: bool + :param keep_http_connection_alive: Required. Indicates whether to keep the connection alive. + :type keep_http_connection_alive: bool + :param unfold_http_headers: Required. Indicates whether to unfold the HTTP headers. + :type unfold_http_headers: bool + """ + + _validation = { + 'ignore_certificate_name_mismatch': {'required': True}, + 'support_http_status_code_continue': {'required': True}, + 'keep_http_connection_alive': {'required': True}, + 'unfold_http_headers': {'required': True}, + } + + _attribute_map = { + 'ignore_certificate_name_mismatch': {'key': 'ignoreCertificateNameMismatch', 'type': 'bool'}, + 'support_http_status_code_continue': {'key': 'supportHttpStatusCodeContinue', 'type': 'bool'}, + 'keep_http_connection_alive': {'key': 'keepHttpConnectionAlive', 'type': 'bool'}, + 'unfold_http_headers': {'key': 'unfoldHttpHeaders', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(As2AcknowledgementConnectionSettings, self).__init__(**kwargs) + self.ignore_certificate_name_mismatch = kwargs['ignore_certificate_name_mismatch'] + self.support_http_status_code_continue = kwargs['support_http_status_code_continue'] + self.keep_http_connection_alive = kwargs['keep_http_connection_alive'] + self.unfold_http_headers = kwargs['unfold_http_headers'] + + +class As2AgreementContent(msrest.serialization.Model): + """The integration account AS2 agreement content. + + All required parameters must be populated in order to send to Azure. + + :param receive_agreement: Required. The AS2 one-way receive agreement. + :type receive_agreement: ~azure.mgmt.logic.models.As2OneWayAgreement + :param send_agreement: Required. The AS2 one-way send agreement. + :type send_agreement: ~azure.mgmt.logic.models.As2OneWayAgreement + """ + + _validation = { + 'receive_agreement': {'required': True}, + 'send_agreement': {'required': True}, + } + + _attribute_map = { + 'receive_agreement': {'key': 'receiveAgreement', 'type': 'As2OneWayAgreement'}, + 'send_agreement': {'key': 'sendAgreement', 'type': 'As2OneWayAgreement'}, + } + + def __init__( + self, + **kwargs + ): + super(As2AgreementContent, self).__init__(**kwargs) + self.receive_agreement = kwargs['receive_agreement'] + self.send_agreement = kwargs['send_agreement'] + + +class As2EnvelopeSettings(msrest.serialization.Model): + """The AS2 agreement envelope settings. + + All required parameters must be populated in order to send to Azure. + + :param message_content_type: Required. The message content type. + :type message_content_type: str + :param transmit_file_name_in_mime_header: Required. The value indicating whether to transmit + file name in mime header. + :type transmit_file_name_in_mime_header: bool + :param file_name_template: Required. The template for file name. + :type file_name_template: str + :param suspend_message_on_file_name_generation_error: Required. The value indicating whether to + suspend message on file name generation error. + :type suspend_message_on_file_name_generation_error: bool + :param autogenerate_file_name: Required. The value indicating whether to auto generate file + name. + :type autogenerate_file_name: bool + """ + + _validation = { + 'message_content_type': {'required': True}, + 'transmit_file_name_in_mime_header': {'required': True}, + 'file_name_template': {'required': True}, + 'suspend_message_on_file_name_generation_error': {'required': True}, + 'autogenerate_file_name': {'required': True}, + } + + _attribute_map = { + 'message_content_type': {'key': 'messageContentType', 'type': 'str'}, + 'transmit_file_name_in_mime_header': {'key': 'transmitFileNameInMimeHeader', 'type': 'bool'}, + 'file_name_template': {'key': 'fileNameTemplate', 'type': 'str'}, + 'suspend_message_on_file_name_generation_error': {'key': 'suspendMessageOnFileNameGenerationError', 'type': 'bool'}, + 'autogenerate_file_name': {'key': 'autogenerateFileName', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(As2EnvelopeSettings, self).__init__(**kwargs) + self.message_content_type = kwargs['message_content_type'] + self.transmit_file_name_in_mime_header = kwargs['transmit_file_name_in_mime_header'] + self.file_name_template = kwargs['file_name_template'] + self.suspend_message_on_file_name_generation_error = kwargs['suspend_message_on_file_name_generation_error'] + self.autogenerate_file_name = kwargs['autogenerate_file_name'] + + +class As2ErrorSettings(msrest.serialization.Model): + """The AS2 agreement error settings. + + All required parameters must be populated in order to send to Azure. + + :param suspend_duplicate_message: Required. The value indicating whether to suspend duplicate + message. + :type suspend_duplicate_message: bool + :param resend_if_mdn_not_received: Required. The value indicating whether to resend message If + MDN is not received. + :type resend_if_mdn_not_received: bool + """ + + _validation = { + 'suspend_duplicate_message': {'required': True}, + 'resend_if_mdn_not_received': {'required': True}, + } + + _attribute_map = { + 'suspend_duplicate_message': {'key': 'suspendDuplicateMessage', 'type': 'bool'}, + 'resend_if_mdn_not_received': {'key': 'resendIfMDNNotReceived', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(As2ErrorSettings, self).__init__(**kwargs) + self.suspend_duplicate_message = kwargs['suspend_duplicate_message'] + self.resend_if_mdn_not_received = kwargs['resend_if_mdn_not_received'] + + +class As2MdnSettings(msrest.serialization.Model): + """The AS2 agreement mdn settings. + + All required parameters must be populated in order to send to Azure. + + :param need_mdn: Required. The value indicating whether to send or request a MDN. + :type need_mdn: bool + :param sign_mdn: Required. The value indicating whether the MDN needs to be signed or not. + :type sign_mdn: bool + :param send_mdn_asynchronously: Required. The value indicating whether to send the asynchronous + MDN. + :type send_mdn_asynchronously: bool + :param receipt_delivery_url: The receipt delivery URL. + :type receipt_delivery_url: str + :param disposition_notification_to: The disposition notification to header value. + :type disposition_notification_to: str + :param sign_outbound_mdn_if_optional: Required. The value indicating whether to sign the + outbound MDN if optional. + :type sign_outbound_mdn_if_optional: bool + :param mdn_text: The MDN text. + :type mdn_text: str + :param send_inbound_mdn_to_message_box: Required. The value indicating whether to send inbound + MDN to message box. + :type send_inbound_mdn_to_message_box: bool + :param mic_hashing_algorithm: Required. The signing or hashing algorithm. Possible values + include: "NotSpecified", "None", "MD5", "SHA1", "SHA2256", "SHA2384", "SHA2512". + :type mic_hashing_algorithm: str or ~azure.mgmt.logic.models.HashingAlgorithm + """ + + _validation = { + 'need_mdn': {'required': True}, + 'sign_mdn': {'required': True}, + 'send_mdn_asynchronously': {'required': True}, + 'sign_outbound_mdn_if_optional': {'required': True}, + 'send_inbound_mdn_to_message_box': {'required': True}, + 'mic_hashing_algorithm': {'required': True}, + } + + _attribute_map = { + 'need_mdn': {'key': 'needMDN', 'type': 'bool'}, + 'sign_mdn': {'key': 'signMDN', 'type': 'bool'}, + 'send_mdn_asynchronously': {'key': 'sendMDNAsynchronously', 'type': 'bool'}, + 'receipt_delivery_url': {'key': 'receiptDeliveryUrl', 'type': 'str'}, + 'disposition_notification_to': {'key': 'dispositionNotificationTo', 'type': 'str'}, + 'sign_outbound_mdn_if_optional': {'key': 'signOutboundMDNIfOptional', 'type': 'bool'}, + 'mdn_text': {'key': 'mdnText', 'type': 'str'}, + 'send_inbound_mdn_to_message_box': {'key': 'sendInboundMDNToMessageBox', 'type': 'bool'}, + 'mic_hashing_algorithm': {'key': 'micHashingAlgorithm', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(As2MdnSettings, self).__init__(**kwargs) + self.need_mdn = kwargs['need_mdn'] + self.sign_mdn = kwargs['sign_mdn'] + self.send_mdn_asynchronously = kwargs['send_mdn_asynchronously'] + self.receipt_delivery_url = kwargs.get('receipt_delivery_url', None) + self.disposition_notification_to = kwargs.get('disposition_notification_to', None) + self.sign_outbound_mdn_if_optional = kwargs['sign_outbound_mdn_if_optional'] + self.mdn_text = kwargs.get('mdn_text', None) + self.send_inbound_mdn_to_message_box = kwargs['send_inbound_mdn_to_message_box'] + self.mic_hashing_algorithm = kwargs['mic_hashing_algorithm'] + + +class As2MessageConnectionSettings(msrest.serialization.Model): + """The AS2 agreement message connection settings. + + All required parameters must be populated in order to send to Azure. + + :param ignore_certificate_name_mismatch: Required. The value indicating whether to ignore + mismatch in certificate name. + :type ignore_certificate_name_mismatch: bool + :param support_http_status_code_continue: Required. The value indicating whether to support + HTTP status code 'CONTINUE'. + :type support_http_status_code_continue: bool + :param keep_http_connection_alive: Required. The value indicating whether to keep the + connection alive. + :type keep_http_connection_alive: bool + :param unfold_http_headers: Required. The value indicating whether to unfold the HTTP headers. + :type unfold_http_headers: bool + """ + + _validation = { + 'ignore_certificate_name_mismatch': {'required': True}, + 'support_http_status_code_continue': {'required': True}, + 'keep_http_connection_alive': {'required': True}, + 'unfold_http_headers': {'required': True}, + } + + _attribute_map = { + 'ignore_certificate_name_mismatch': {'key': 'ignoreCertificateNameMismatch', 'type': 'bool'}, + 'support_http_status_code_continue': {'key': 'supportHttpStatusCodeContinue', 'type': 'bool'}, + 'keep_http_connection_alive': {'key': 'keepHttpConnectionAlive', 'type': 'bool'}, + 'unfold_http_headers': {'key': 'unfoldHttpHeaders', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(As2MessageConnectionSettings, self).__init__(**kwargs) + self.ignore_certificate_name_mismatch = kwargs['ignore_certificate_name_mismatch'] + self.support_http_status_code_continue = kwargs['support_http_status_code_continue'] + self.keep_http_connection_alive = kwargs['keep_http_connection_alive'] + self.unfold_http_headers = kwargs['unfold_http_headers'] + + +class As2OneWayAgreement(msrest.serialization.Model): + """The integration account AS2 one-way agreement. + + All required parameters must be populated in order to send to Azure. + + :param sender_business_identity: Required. The sender business identity. + :type sender_business_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param receiver_business_identity: Required. The receiver business identity. + :type receiver_business_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param protocol_settings: Required. The AS2 protocol settings. + :type protocol_settings: ~azure.mgmt.logic.models.As2ProtocolSettings + """ + + _validation = { + 'sender_business_identity': {'required': True}, + 'receiver_business_identity': {'required': True}, + 'protocol_settings': {'required': True}, + } + + _attribute_map = { + 'sender_business_identity': {'key': 'senderBusinessIdentity', 'type': 'BusinessIdentity'}, + 'receiver_business_identity': {'key': 'receiverBusinessIdentity', 'type': 'BusinessIdentity'}, + 'protocol_settings': {'key': 'protocolSettings', 'type': 'As2ProtocolSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(As2OneWayAgreement, self).__init__(**kwargs) + self.sender_business_identity = kwargs['sender_business_identity'] + self.receiver_business_identity = kwargs['receiver_business_identity'] + self.protocol_settings = kwargs['protocol_settings'] + + +class As2ProtocolSettings(msrest.serialization.Model): + """The AS2 agreement protocol settings. + + All required parameters must be populated in order to send to Azure. + + :param message_connection_settings: Required. The message connection settings. + :type message_connection_settings: ~azure.mgmt.logic.models.As2MessageConnectionSettings + :param acknowledgement_connection_settings: Required. The acknowledgement connection settings. + :type acknowledgement_connection_settings: + ~azure.mgmt.logic.models.As2AcknowledgementConnectionSettings + :param mdn_settings: Required. The MDN settings. + :type mdn_settings: ~azure.mgmt.logic.models.As2MdnSettings + :param security_settings: Required. The security settings. + :type security_settings: ~azure.mgmt.logic.models.As2SecuritySettings + :param validation_settings: Required. The validation settings. + :type validation_settings: ~azure.mgmt.logic.models.As2ValidationSettings + :param envelope_settings: Required. The envelope settings. + :type envelope_settings: ~azure.mgmt.logic.models.As2EnvelopeSettings + :param error_settings: Required. The error settings. + :type error_settings: ~azure.mgmt.logic.models.As2ErrorSettings + """ + + _validation = { + 'message_connection_settings': {'required': True}, + 'acknowledgement_connection_settings': {'required': True}, + 'mdn_settings': {'required': True}, + 'security_settings': {'required': True}, + 'validation_settings': {'required': True}, + 'envelope_settings': {'required': True}, + 'error_settings': {'required': True}, + } + + _attribute_map = { + 'message_connection_settings': {'key': 'messageConnectionSettings', 'type': 'As2MessageConnectionSettings'}, + 'acknowledgement_connection_settings': {'key': 'acknowledgementConnectionSettings', 'type': 'As2AcknowledgementConnectionSettings'}, + 'mdn_settings': {'key': 'mdnSettings', 'type': 'As2MdnSettings'}, + 'security_settings': {'key': 'securitySettings', 'type': 'As2SecuritySettings'}, + 'validation_settings': {'key': 'validationSettings', 'type': 'As2ValidationSettings'}, + 'envelope_settings': {'key': 'envelopeSettings', 'type': 'As2EnvelopeSettings'}, + 'error_settings': {'key': 'errorSettings', 'type': 'As2ErrorSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(As2ProtocolSettings, self).__init__(**kwargs) + self.message_connection_settings = kwargs['message_connection_settings'] + self.acknowledgement_connection_settings = kwargs['acknowledgement_connection_settings'] + self.mdn_settings = kwargs['mdn_settings'] + self.security_settings = kwargs['security_settings'] + self.validation_settings = kwargs['validation_settings'] + self.envelope_settings = kwargs['envelope_settings'] + self.error_settings = kwargs['error_settings'] + + +class As2SecuritySettings(msrest.serialization.Model): + """The AS2 agreement security settings. + + All required parameters must be populated in order to send to Azure. + + :param override_group_signing_certificate: Required. The value indicating whether to send or + request a MDN. + :type override_group_signing_certificate: bool + :param signing_certificate_name: The name of the signing certificate. + :type signing_certificate_name: str + :param encryption_certificate_name: The name of the encryption certificate. + :type encryption_certificate_name: str + :param enable_nrr_for_inbound_encoded_messages: Required. The value indicating whether to + enable NRR for inbound encoded messages. + :type enable_nrr_for_inbound_encoded_messages: bool + :param enable_nrr_for_inbound_decoded_messages: Required. The value indicating whether to + enable NRR for inbound decoded messages. + :type enable_nrr_for_inbound_decoded_messages: bool + :param enable_nrr_for_outbound_mdn: Required. The value indicating whether to enable NRR for + outbound MDN. + :type enable_nrr_for_outbound_mdn: bool + :param enable_nrr_for_outbound_encoded_messages: Required. The value indicating whether to + enable NRR for outbound encoded messages. + :type enable_nrr_for_outbound_encoded_messages: bool + :param enable_nrr_for_outbound_decoded_messages: Required. The value indicating whether to + enable NRR for outbound decoded messages. + :type enable_nrr_for_outbound_decoded_messages: bool + :param enable_nrr_for_inbound_mdn: Required. The value indicating whether to enable NRR for + inbound MDN. + :type enable_nrr_for_inbound_mdn: bool + :param sha2_algorithm_format: The Sha2 algorithm format. Valid values are Sha2, ShaHashSize, + ShaHyphenHashSize, Sha2UnderscoreHashSize. + :type sha2_algorithm_format: str + """ + + _validation = { + 'override_group_signing_certificate': {'required': True}, + 'enable_nrr_for_inbound_encoded_messages': {'required': True}, + 'enable_nrr_for_inbound_decoded_messages': {'required': True}, + 'enable_nrr_for_outbound_mdn': {'required': True}, + 'enable_nrr_for_outbound_encoded_messages': {'required': True}, + 'enable_nrr_for_outbound_decoded_messages': {'required': True}, + 'enable_nrr_for_inbound_mdn': {'required': True}, + } + + _attribute_map = { + 'override_group_signing_certificate': {'key': 'overrideGroupSigningCertificate', 'type': 'bool'}, + 'signing_certificate_name': {'key': 'signingCertificateName', 'type': 'str'}, + 'encryption_certificate_name': {'key': 'encryptionCertificateName', 'type': 'str'}, + 'enable_nrr_for_inbound_encoded_messages': {'key': 'enableNRRForInboundEncodedMessages', 'type': 'bool'}, + 'enable_nrr_for_inbound_decoded_messages': {'key': 'enableNRRForInboundDecodedMessages', 'type': 'bool'}, + 'enable_nrr_for_outbound_mdn': {'key': 'enableNRRForOutboundMDN', 'type': 'bool'}, + 'enable_nrr_for_outbound_encoded_messages': {'key': 'enableNRRForOutboundEncodedMessages', 'type': 'bool'}, + 'enable_nrr_for_outbound_decoded_messages': {'key': 'enableNRRForOutboundDecodedMessages', 'type': 'bool'}, + 'enable_nrr_for_inbound_mdn': {'key': 'enableNRRForInboundMDN', 'type': 'bool'}, + 'sha2_algorithm_format': {'key': 'sha2AlgorithmFormat', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(As2SecuritySettings, self).__init__(**kwargs) + self.override_group_signing_certificate = kwargs['override_group_signing_certificate'] + self.signing_certificate_name = kwargs.get('signing_certificate_name', None) + self.encryption_certificate_name = kwargs.get('encryption_certificate_name', None) + self.enable_nrr_for_inbound_encoded_messages = kwargs['enable_nrr_for_inbound_encoded_messages'] + self.enable_nrr_for_inbound_decoded_messages = kwargs['enable_nrr_for_inbound_decoded_messages'] + self.enable_nrr_for_outbound_mdn = kwargs['enable_nrr_for_outbound_mdn'] + self.enable_nrr_for_outbound_encoded_messages = kwargs['enable_nrr_for_outbound_encoded_messages'] + self.enable_nrr_for_outbound_decoded_messages = kwargs['enable_nrr_for_outbound_decoded_messages'] + self.enable_nrr_for_inbound_mdn = kwargs['enable_nrr_for_inbound_mdn'] + self.sha2_algorithm_format = kwargs.get('sha2_algorithm_format', None) + + +class As2ValidationSettings(msrest.serialization.Model): + """The AS2 agreement validation settings. + + All required parameters must be populated in order to send to Azure. + + :param override_message_properties: Required. The value indicating whether to override incoming + message properties with those in agreement. + :type override_message_properties: bool + :param encrypt_message: Required. The value indicating whether the message has to be encrypted. + :type encrypt_message: bool + :param sign_message: Required. The value indicating whether the message has to be signed. + :type sign_message: bool + :param compress_message: Required. The value indicating whether the message has to be + compressed. + :type compress_message: bool + :param check_duplicate_message: Required. The value indicating whether to check for duplicate + message. + :type check_duplicate_message: bool + :param interchange_duplicates_validity_days: Required. The number of days to look back for + duplicate interchange. + :type interchange_duplicates_validity_days: int + :param check_certificate_revocation_list_on_send: Required. The value indicating whether to + check for certificate revocation list on send. + :type check_certificate_revocation_list_on_send: bool + :param check_certificate_revocation_list_on_receive: Required. The value indicating whether to + check for certificate revocation list on receive. + :type check_certificate_revocation_list_on_receive: bool + :param encryption_algorithm: Required. The encryption algorithm. Possible values include: + "NotSpecified", "None", "DES3", "RC2", "AES128", "AES192", "AES256". + :type encryption_algorithm: str or ~azure.mgmt.logic.models.EncryptionAlgorithm + :param signing_algorithm: The signing algorithm. Possible values include: "NotSpecified", + "Default", "SHA1", "SHA2256", "SHA2384", "SHA2512". + :type signing_algorithm: str or ~azure.mgmt.logic.models.SigningAlgorithm + """ + + _validation = { + 'override_message_properties': {'required': True}, + 'encrypt_message': {'required': True}, + 'sign_message': {'required': True}, + 'compress_message': {'required': True}, + 'check_duplicate_message': {'required': True}, + 'interchange_duplicates_validity_days': {'required': True}, + 'check_certificate_revocation_list_on_send': {'required': True}, + 'check_certificate_revocation_list_on_receive': {'required': True}, + 'encryption_algorithm': {'required': True}, + } + + _attribute_map = { + 'override_message_properties': {'key': 'overrideMessageProperties', 'type': 'bool'}, + 'encrypt_message': {'key': 'encryptMessage', 'type': 'bool'}, + 'sign_message': {'key': 'signMessage', 'type': 'bool'}, + 'compress_message': {'key': 'compressMessage', 'type': 'bool'}, + 'check_duplicate_message': {'key': 'checkDuplicateMessage', 'type': 'bool'}, + 'interchange_duplicates_validity_days': {'key': 'interchangeDuplicatesValidityDays', 'type': 'int'}, + 'check_certificate_revocation_list_on_send': {'key': 'checkCertificateRevocationListOnSend', 'type': 'bool'}, + 'check_certificate_revocation_list_on_receive': {'key': 'checkCertificateRevocationListOnReceive', 'type': 'bool'}, + 'encryption_algorithm': {'key': 'encryptionAlgorithm', 'type': 'str'}, + 'signing_algorithm': {'key': 'signingAlgorithm', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(As2ValidationSettings, self).__init__(**kwargs) + self.override_message_properties = kwargs['override_message_properties'] + self.encrypt_message = kwargs['encrypt_message'] + self.sign_message = kwargs['sign_message'] + self.compress_message = kwargs['compress_message'] + self.check_duplicate_message = kwargs['check_duplicate_message'] + self.interchange_duplicates_validity_days = kwargs['interchange_duplicates_validity_days'] + self.check_certificate_revocation_list_on_send = kwargs['check_certificate_revocation_list_on_send'] + self.check_certificate_revocation_list_on_receive = kwargs['check_certificate_revocation_list_on_receive'] + self.encryption_algorithm = kwargs['encryption_algorithm'] + self.signing_algorithm = kwargs.get('signing_algorithm', None) + + +class AssemblyCollection(msrest.serialization.Model): + """A collection of assembly definitions. + + :param value: + :type value: list[~azure.mgmt.logic.models.AssemblyDefinition] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AssemblyDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(AssemblyCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class AssemblyDefinition(Resource): + """The assembly definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param properties: Required. The assembly properties. + :type properties: ~azure.mgmt.logic.models.AssemblyProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'required': 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}'}, + 'properties': {'key': 'properties', 'type': 'AssemblyProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(AssemblyDefinition, self).__init__(**kwargs) + self.properties = kwargs['properties'] + + +class AssemblyProperties(ArtifactContentPropertiesDefinition): + """The assembly properties definition. + + All required parameters must be populated in order to send to Azure. + + :param created_time: The artifact creation time. + :type created_time: ~datetime.datetime + :param changed_time: The artifact changed time. + :type changed_time: ~datetime.datetime + :param metadata: Any object. + :type metadata: object + :param content: Any object. + :type content: object + :param content_type: The content type. + :type content_type: str + :param content_link: The content link. + :type content_link: ~azure.mgmt.logic.models.ContentLink + :param assembly_name: Required. The assembly name. + :type assembly_name: str + :param assembly_version: The assembly version. + :type assembly_version: str + :param assembly_culture: The assembly culture. + :type assembly_culture: str + :param assembly_public_key_token: The assembly public key token. + :type assembly_public_key_token: str + """ + + _validation = { + 'assembly_name': {'required': True}, + } + + _attribute_map = { + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + 'content': {'key': 'content', 'type': 'object'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'content_link': {'key': 'contentLink', 'type': 'ContentLink'}, + 'assembly_name': {'key': 'assemblyName', 'type': 'str'}, + 'assembly_version': {'key': 'assemblyVersion', 'type': 'str'}, + 'assembly_culture': {'key': 'assemblyCulture', 'type': 'str'}, + 'assembly_public_key_token': {'key': 'assemblyPublicKeyToken', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AssemblyProperties, self).__init__(**kwargs) + self.assembly_name = kwargs['assembly_name'] + self.assembly_version = kwargs.get('assembly_version', None) + self.assembly_culture = kwargs.get('assembly_culture', None) + self.assembly_public_key_token = kwargs.get('assembly_public_key_token', None) + + +class ErrorInfo(msrest.serialization.Model): + """The error info. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code. + :type code: str + """ + + _validation = { + 'code': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorInfo, self).__init__(**kwargs) + self.code = kwargs['code'] + + +class AzureResourceErrorInfo(ErrorInfo): + """The azure resource error info. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code. + :type code: str + :param message: Required. The error message. + :type message: str + :param details: The error details. + :type details: list[~azure.mgmt.logic.models.AzureResourceErrorInfo] + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[AzureResourceErrorInfo]'}, + } + + def __init__( + self, + **kwargs + ): + super(AzureResourceErrorInfo, self).__init__(**kwargs) + self.message = kwargs['message'] + self.details = kwargs.get('details', None) + + +class B2BPartnerContent(msrest.serialization.Model): + """The B2B partner content. + + :param business_identities: The list of partner business identities. + :type business_identities: list[~azure.mgmt.logic.models.BusinessIdentity] + """ + + _attribute_map = { + 'business_identities': {'key': 'businessIdentities', 'type': '[BusinessIdentity]'}, + } + + def __init__( + self, + **kwargs + ): + super(B2BPartnerContent, self).__init__(**kwargs) + self.business_identities = kwargs.get('business_identities', None) + + +class BatchConfiguration(Resource): + """The batch configuration resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param properties: Required. The batch configuration properties. + :type properties: ~azure.mgmt.logic.models.BatchConfigurationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'required': 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}'}, + 'properties': {'key': 'properties', 'type': 'BatchConfigurationProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchConfiguration, self).__init__(**kwargs) + self.properties = kwargs['properties'] + + +class BatchConfigurationCollection(msrest.serialization.Model): + """A collection of batch configurations. + + :param value: + :type value: list[~azure.mgmt.logic.models.BatchConfiguration] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BatchConfiguration]'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchConfigurationCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class BatchConfigurationProperties(ArtifactProperties): + """The batch configuration properties definition. + + All required parameters must be populated in order to send to Azure. + + :param metadata: Any object. + :type metadata: object + :param batch_group_name: Required. The name of the batch group. + :type batch_group_name: str + :param release_criteria: Required. The batch release criteria. + :type release_criteria: ~azure.mgmt.logic.models.BatchReleaseCriteria + :param created_time: The created time. + :type created_time: ~datetime.datetime + :param changed_time: The changed time. + :type changed_time: ~datetime.datetime + """ + + _validation = { + 'batch_group_name': {'required': True}, + 'release_criteria': {'required': True}, + } + + _attribute_map = { + 'metadata': {'key': 'metadata', 'type': 'object'}, + 'batch_group_name': {'key': 'batchGroupName', 'type': 'str'}, + 'release_criteria': {'key': 'releaseCriteria', 'type': 'BatchReleaseCriteria'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchConfigurationProperties, self).__init__(**kwargs) + self.batch_group_name = kwargs['batch_group_name'] + self.release_criteria = kwargs['release_criteria'] + self.created_time = kwargs.get('created_time', None) + self.changed_time = kwargs.get('changed_time', None) + + +class BatchReleaseCriteria(msrest.serialization.Model): + """The batch release criteria. + + :param message_count: The message count. + :type message_count: int + :param batch_size: The batch size in bytes. + :type batch_size: int + :param recurrence: The recurrence. + :type recurrence: ~azure.mgmt.logic.models.WorkflowTriggerRecurrence + """ + + _attribute_map = { + 'message_count': {'key': 'messageCount', 'type': 'int'}, + 'batch_size': {'key': 'batchSize', 'type': 'int'}, + 'recurrence': {'key': 'recurrence', 'type': 'WorkflowTriggerRecurrence'}, + } + + def __init__( + self, + **kwargs + ): + super(BatchReleaseCriteria, self).__init__(**kwargs) + self.message_count = kwargs.get('message_count', None) + self.batch_size = kwargs.get('batch_size', None) + self.recurrence = kwargs.get('recurrence', None) + + +class BusinessIdentity(msrest.serialization.Model): + """The integration account partner's business identity. + + All required parameters must be populated in order to send to Azure. + + :param qualifier: Required. The business identity qualifier e.g. as2identity, ZZ, ZZZ, 31, 32. + :type qualifier: str + :param value: Required. The user defined business identity value. + :type value: str + """ + + _validation = { + 'qualifier': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'qualifier': {'key': 'qualifier', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BusinessIdentity, self).__init__(**kwargs) + self.qualifier = kwargs['qualifier'] + self.value = kwargs['value'] + + +class CallbackUrl(msrest.serialization.Model): + """The callback url. + + :param value: The URL value. + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CallbackUrl, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ContentHash(msrest.serialization.Model): + """The content hash. + + :param algorithm: The algorithm of the content hash. + :type algorithm: str + :param value: The value of the content hash. + :type value: str + """ + + _attribute_map = { + 'algorithm': {'key': 'algorithm', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContentHash, self).__init__(**kwargs) + self.algorithm = kwargs.get('algorithm', None) + self.value = kwargs.get('value', None) + + +class ContentLink(msrest.serialization.Model): + """The content link. + + :param uri: The content link URI. + :type uri: str + :param content_version: The content version. + :type content_version: str + :param content_size: The content size. + :type content_size: long + :param content_hash: The content hash. + :type content_hash: ~azure.mgmt.logic.models.ContentHash + :param metadata: The metadata. + :type metadata: object + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + 'content_size': {'key': 'contentSize', 'type': 'long'}, + 'content_hash': {'key': 'contentHash', 'type': 'ContentHash'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ContentLink, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + self.content_version = kwargs.get('content_version', None) + self.content_size = kwargs.get('content_size', None) + self.content_hash = kwargs.get('content_hash', None) + self.metadata = kwargs.get('metadata', None) + + +class Correlation(msrest.serialization.Model): + """The correlation property. + + :param client_tracking_id: The client tracking id. + :type client_tracking_id: str + """ + + _attribute_map = { + 'client_tracking_id': {'key': 'clientTrackingId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Correlation, self).__init__(**kwargs) + self.client_tracking_id = kwargs.get('client_tracking_id', None) + + +class EdifactAcknowledgementSettings(msrest.serialization.Model): + """The Edifact agreement acknowledgement settings. + + All required parameters must be populated in order to send to Azure. + + :param need_technical_acknowledgement: Required. The value indicating whether technical + acknowledgement is needed. + :type need_technical_acknowledgement: bool + :param batch_technical_acknowledgements: Required. The value indicating whether to batch the + technical acknowledgements. + :type batch_technical_acknowledgements: bool + :param need_functional_acknowledgement: Required. The value indicating whether functional + acknowledgement is needed. + :type need_functional_acknowledgement: bool + :param batch_functional_acknowledgements: Required. The value indicating whether to batch + functional acknowledgements. + :type batch_functional_acknowledgements: bool + :param need_loop_for_valid_messages: Required. The value indicating whether a loop is needed + for valid messages. + :type need_loop_for_valid_messages: bool + :param send_synchronous_acknowledgement: Required. The value indicating whether to send + synchronous acknowledgement. + :type send_synchronous_acknowledgement: bool + :param acknowledgement_control_number_prefix: The acknowledgement control number prefix. + :type acknowledgement_control_number_prefix: str + :param acknowledgement_control_number_suffix: The acknowledgement control number suffix. + :type acknowledgement_control_number_suffix: str + :param acknowledgement_control_number_lower_bound: Required. The acknowledgement control number + lower bound. + :type acknowledgement_control_number_lower_bound: int + :param acknowledgement_control_number_upper_bound: Required. The acknowledgement control number + upper bound. + :type acknowledgement_control_number_upper_bound: int + :param rollover_acknowledgement_control_number: Required. The value indicating whether to + rollover acknowledgement control number. + :type rollover_acknowledgement_control_number: bool + """ + + _validation = { + 'need_technical_acknowledgement': {'required': True}, + 'batch_technical_acknowledgements': {'required': True}, + 'need_functional_acknowledgement': {'required': True}, + 'batch_functional_acknowledgements': {'required': True}, + 'need_loop_for_valid_messages': {'required': True}, + 'send_synchronous_acknowledgement': {'required': True}, + 'acknowledgement_control_number_lower_bound': {'required': True}, + 'acknowledgement_control_number_upper_bound': {'required': True}, + 'rollover_acknowledgement_control_number': {'required': True}, + } + + _attribute_map = { + 'need_technical_acknowledgement': {'key': 'needTechnicalAcknowledgement', 'type': 'bool'}, + 'batch_technical_acknowledgements': {'key': 'batchTechnicalAcknowledgements', 'type': 'bool'}, + 'need_functional_acknowledgement': {'key': 'needFunctionalAcknowledgement', 'type': 'bool'}, + 'batch_functional_acknowledgements': {'key': 'batchFunctionalAcknowledgements', 'type': 'bool'}, + 'need_loop_for_valid_messages': {'key': 'needLoopForValidMessages', 'type': 'bool'}, + 'send_synchronous_acknowledgement': {'key': 'sendSynchronousAcknowledgement', 'type': 'bool'}, + 'acknowledgement_control_number_prefix': {'key': 'acknowledgementControlNumberPrefix', 'type': 'str'}, + 'acknowledgement_control_number_suffix': {'key': 'acknowledgementControlNumberSuffix', 'type': 'str'}, + 'acknowledgement_control_number_lower_bound': {'key': 'acknowledgementControlNumberLowerBound', 'type': 'int'}, + 'acknowledgement_control_number_upper_bound': {'key': 'acknowledgementControlNumberUpperBound', 'type': 'int'}, + 'rollover_acknowledgement_control_number': {'key': 'rolloverAcknowledgementControlNumber', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(EdifactAcknowledgementSettings, self).__init__(**kwargs) + self.need_technical_acknowledgement = kwargs['need_technical_acknowledgement'] + self.batch_technical_acknowledgements = kwargs['batch_technical_acknowledgements'] + self.need_functional_acknowledgement = kwargs['need_functional_acknowledgement'] + self.batch_functional_acknowledgements = kwargs['batch_functional_acknowledgements'] + self.need_loop_for_valid_messages = kwargs['need_loop_for_valid_messages'] + self.send_synchronous_acknowledgement = kwargs['send_synchronous_acknowledgement'] + self.acknowledgement_control_number_prefix = kwargs.get('acknowledgement_control_number_prefix', None) + self.acknowledgement_control_number_suffix = kwargs.get('acknowledgement_control_number_suffix', None) + self.acknowledgement_control_number_lower_bound = kwargs['acknowledgement_control_number_lower_bound'] + self.acknowledgement_control_number_upper_bound = kwargs['acknowledgement_control_number_upper_bound'] + self.rollover_acknowledgement_control_number = kwargs['rollover_acknowledgement_control_number'] + + +class EdifactAgreementContent(msrest.serialization.Model): + """The Edifact agreement content. + + All required parameters must be populated in order to send to Azure. + + :param receive_agreement: Required. The EDIFACT one-way receive agreement. + :type receive_agreement: ~azure.mgmt.logic.models.EdifactOneWayAgreement + :param send_agreement: Required. The EDIFACT one-way send agreement. + :type send_agreement: ~azure.mgmt.logic.models.EdifactOneWayAgreement + """ + + _validation = { + 'receive_agreement': {'required': True}, + 'send_agreement': {'required': True}, + } + + _attribute_map = { + 'receive_agreement': {'key': 'receiveAgreement', 'type': 'EdifactOneWayAgreement'}, + 'send_agreement': {'key': 'sendAgreement', 'type': 'EdifactOneWayAgreement'}, + } + + def __init__( + self, + **kwargs + ): + super(EdifactAgreementContent, self).__init__(**kwargs) + self.receive_agreement = kwargs['receive_agreement'] + self.send_agreement = kwargs['send_agreement'] + + +class EdifactDelimiterOverride(msrest.serialization.Model): + """The Edifact delimiter override settings. + + All required parameters must be populated in order to send to Azure. + + :param message_id: The message id. + :type message_id: str + :param message_version: The message version. + :type message_version: str + :param message_release: The message release. + :type message_release: str + :param data_element_separator: Required. The data element separator. + :type data_element_separator: int + :param component_separator: Required. The component separator. + :type component_separator: int + :param segment_terminator: Required. The segment terminator. + :type segment_terminator: int + :param repetition_separator: Required. The repetition separator. + :type repetition_separator: int + :param segment_terminator_suffix: Required. The segment terminator suffix. Possible values + include: "NotSpecified", "None", "CR", "LF", "CRLF". + :type segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix + :param decimal_point_indicator: Required. The decimal point indicator. Possible values include: + "NotSpecified", "Comma", "Decimal". + :type decimal_point_indicator: str or ~azure.mgmt.logic.models.EdifactDecimalIndicator + :param release_indicator: Required. The release indicator. + :type release_indicator: int + :param message_association_assigned_code: The message association assigned code. + :type message_association_assigned_code: str + :param target_namespace: The target namespace on which this delimiter settings has to be + applied. + :type target_namespace: str + """ + + _validation = { + 'data_element_separator': {'required': True}, + 'component_separator': {'required': True}, + 'segment_terminator': {'required': True}, + 'repetition_separator': {'required': True}, + 'segment_terminator_suffix': {'required': True}, + 'decimal_point_indicator': {'required': True}, + 'release_indicator': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'message_version': {'key': 'messageVersion', 'type': 'str'}, + 'message_release': {'key': 'messageRelease', 'type': 'str'}, + 'data_element_separator': {'key': 'dataElementSeparator', 'type': 'int'}, + 'component_separator': {'key': 'componentSeparator', 'type': 'int'}, + 'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'}, + 'repetition_separator': {'key': 'repetitionSeparator', 'type': 'int'}, + 'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'}, + 'decimal_point_indicator': {'key': 'decimalPointIndicator', 'type': 'str'}, + 'release_indicator': {'key': 'releaseIndicator', 'type': 'int'}, + 'message_association_assigned_code': {'key': 'messageAssociationAssignedCode', 'type': 'str'}, + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdifactDelimiterOverride, self).__init__(**kwargs) + self.message_id = kwargs.get('message_id', None) + self.message_version = kwargs.get('message_version', None) + self.message_release = kwargs.get('message_release', None) + self.data_element_separator = kwargs['data_element_separator'] + self.component_separator = kwargs['component_separator'] + self.segment_terminator = kwargs['segment_terminator'] + self.repetition_separator = kwargs['repetition_separator'] + self.segment_terminator_suffix = kwargs['segment_terminator_suffix'] + self.decimal_point_indicator = kwargs['decimal_point_indicator'] + self.release_indicator = kwargs['release_indicator'] + self.message_association_assigned_code = kwargs.get('message_association_assigned_code', None) + self.target_namespace = kwargs.get('target_namespace', None) + + +class EdifactEnvelopeOverride(msrest.serialization.Model): + """The Edifact envelope override settings. + + :param message_id: The message id on which this envelope settings has to be applied. + :type message_id: str + :param message_version: The message version on which this envelope settings has to be applied. + :type message_version: str + :param message_release: The message release version on which this envelope settings has to be + applied. + :type message_release: str + :param message_association_assigned_code: The message association assigned code. + :type message_association_assigned_code: str + :param target_namespace: The target namespace on which this envelope settings has to be + applied. + :type target_namespace: str + :param functional_group_id: The functional group id. + :type functional_group_id: str + :param sender_application_qualifier: The sender application qualifier. + :type sender_application_qualifier: str + :param sender_application_id: The sender application id. + :type sender_application_id: str + :param receiver_application_qualifier: The receiver application qualifier. + :type receiver_application_qualifier: str + :param receiver_application_id: The receiver application id. + :type receiver_application_id: str + :param controlling_agency_code: The controlling agency code. + :type controlling_agency_code: str + :param group_header_message_version: The group header message version. + :type group_header_message_version: str + :param group_header_message_release: The group header message release. + :type group_header_message_release: str + :param association_assigned_code: The association assigned code. + :type association_assigned_code: str + :param application_password: The application password. + :type application_password: str + """ + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'message_version': {'key': 'messageVersion', 'type': 'str'}, + 'message_release': {'key': 'messageRelease', 'type': 'str'}, + 'message_association_assigned_code': {'key': 'messageAssociationAssignedCode', 'type': 'str'}, + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + 'functional_group_id': {'key': 'functionalGroupId', 'type': 'str'}, + 'sender_application_qualifier': {'key': 'senderApplicationQualifier', 'type': 'str'}, + 'sender_application_id': {'key': 'senderApplicationId', 'type': 'str'}, + 'receiver_application_qualifier': {'key': 'receiverApplicationQualifier', 'type': 'str'}, + 'receiver_application_id': {'key': 'receiverApplicationId', 'type': 'str'}, + 'controlling_agency_code': {'key': 'controllingAgencyCode', 'type': 'str'}, + 'group_header_message_version': {'key': 'groupHeaderMessageVersion', 'type': 'str'}, + 'group_header_message_release': {'key': 'groupHeaderMessageRelease', 'type': 'str'}, + 'association_assigned_code': {'key': 'associationAssignedCode', 'type': 'str'}, + 'application_password': {'key': 'applicationPassword', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdifactEnvelopeOverride, self).__init__(**kwargs) + self.message_id = kwargs.get('message_id', None) + self.message_version = kwargs.get('message_version', None) + self.message_release = kwargs.get('message_release', None) + self.message_association_assigned_code = kwargs.get('message_association_assigned_code', None) + self.target_namespace = kwargs.get('target_namespace', None) + self.functional_group_id = kwargs.get('functional_group_id', None) + self.sender_application_qualifier = kwargs.get('sender_application_qualifier', None) + self.sender_application_id = kwargs.get('sender_application_id', None) + self.receiver_application_qualifier = kwargs.get('receiver_application_qualifier', None) + self.receiver_application_id = kwargs.get('receiver_application_id', None) + self.controlling_agency_code = kwargs.get('controlling_agency_code', None) + self.group_header_message_version = kwargs.get('group_header_message_version', None) + self.group_header_message_release = kwargs.get('group_header_message_release', None) + self.association_assigned_code = kwargs.get('association_assigned_code', None) + self.application_password = kwargs.get('application_password', None) + + +class EdifactEnvelopeSettings(msrest.serialization.Model): + """The Edifact agreement envelope settings. + + All required parameters must be populated in order to send to Azure. + + :param group_association_assigned_code: The group association assigned code. + :type group_association_assigned_code: str + :param communication_agreement_id: The communication agreement id. + :type communication_agreement_id: str + :param apply_delimiter_string_advice: Required. The value indicating whether to apply delimiter + string advice. + :type apply_delimiter_string_advice: bool + :param create_grouping_segments: Required. The value indicating whether to create grouping + segments. + :type create_grouping_segments: bool + :param enable_default_group_headers: Required. The value indicating whether to enable default + group headers. + :type enable_default_group_headers: bool + :param recipient_reference_password_value: The recipient reference password value. + :type recipient_reference_password_value: str + :param recipient_reference_password_qualifier: The recipient reference password qualifier. + :type recipient_reference_password_qualifier: str + :param application_reference_id: The application reference id. + :type application_reference_id: str + :param processing_priority_code: The processing priority code. + :type processing_priority_code: str + :param interchange_control_number_lower_bound: Required. The interchange control number lower + bound. + :type interchange_control_number_lower_bound: long + :param interchange_control_number_upper_bound: Required. The interchange control number upper + bound. + :type interchange_control_number_upper_bound: long + :param rollover_interchange_control_number: Required. The value indicating whether to rollover + interchange control number. + :type rollover_interchange_control_number: bool + :param interchange_control_number_prefix: The interchange control number prefix. + :type interchange_control_number_prefix: str + :param interchange_control_number_suffix: The interchange control number suffix. + :type interchange_control_number_suffix: str + :param sender_reverse_routing_address: The sender reverse routing address. + :type sender_reverse_routing_address: str + :param receiver_reverse_routing_address: The receiver reverse routing address. + :type receiver_reverse_routing_address: str + :param functional_group_id: The functional group id. + :type functional_group_id: str + :param group_controlling_agency_code: The group controlling agency code. + :type group_controlling_agency_code: str + :param group_message_version: The group message version. + :type group_message_version: str + :param group_message_release: The group message release. + :type group_message_release: str + :param group_control_number_lower_bound: Required. The group control number lower bound. + :type group_control_number_lower_bound: long + :param group_control_number_upper_bound: Required. The group control number upper bound. + :type group_control_number_upper_bound: long + :param rollover_group_control_number: Required. The value indicating whether to rollover group + control number. + :type rollover_group_control_number: bool + :param group_control_number_prefix: The group control number prefix. + :type group_control_number_prefix: str + :param group_control_number_suffix: The group control number suffix. + :type group_control_number_suffix: str + :param group_application_receiver_qualifier: The group application receiver qualifier. + :type group_application_receiver_qualifier: str + :param group_application_receiver_id: The group application receiver id. + :type group_application_receiver_id: str + :param group_application_sender_qualifier: The group application sender qualifier. + :type group_application_sender_qualifier: str + :param group_application_sender_id: The group application sender id. + :type group_application_sender_id: str + :param group_application_password: The group application password. + :type group_application_password: str + :param overwrite_existing_transaction_set_control_number: Required. The value indicating + whether to overwrite existing transaction set control number. + :type overwrite_existing_transaction_set_control_number: bool + :param transaction_set_control_number_prefix: The transaction set control number prefix. + :type transaction_set_control_number_prefix: str + :param transaction_set_control_number_suffix: The transaction set control number suffix. + :type transaction_set_control_number_suffix: str + :param transaction_set_control_number_lower_bound: Required. The transaction set control number + lower bound. + :type transaction_set_control_number_lower_bound: long + :param transaction_set_control_number_upper_bound: Required. The transaction set control number + upper bound. + :type transaction_set_control_number_upper_bound: long + :param rollover_transaction_set_control_number: Required. The value indicating whether to + rollover transaction set control number. + :type rollover_transaction_set_control_number: bool + :param is_test_interchange: Required. The value indicating whether the message is a test + interchange. + :type is_test_interchange: bool + :param sender_internal_identification: The sender internal identification. + :type sender_internal_identification: str + :param sender_internal_sub_identification: The sender internal sub identification. + :type sender_internal_sub_identification: str + :param receiver_internal_identification: The receiver internal identification. + :type receiver_internal_identification: str + :param receiver_internal_sub_identification: The receiver internal sub identification. + :type receiver_internal_sub_identification: str + """ + + _validation = { + 'apply_delimiter_string_advice': {'required': True}, + 'create_grouping_segments': {'required': True}, + 'enable_default_group_headers': {'required': True}, + 'interchange_control_number_lower_bound': {'required': True}, + 'interchange_control_number_upper_bound': {'required': True}, + 'rollover_interchange_control_number': {'required': True}, + 'group_control_number_lower_bound': {'required': True}, + 'group_control_number_upper_bound': {'required': True}, + 'rollover_group_control_number': {'required': True}, + 'overwrite_existing_transaction_set_control_number': {'required': True}, + 'transaction_set_control_number_lower_bound': {'required': True}, + 'transaction_set_control_number_upper_bound': {'required': True}, + 'rollover_transaction_set_control_number': {'required': True}, + 'is_test_interchange': {'required': True}, + } + + _attribute_map = { + 'group_association_assigned_code': {'key': 'groupAssociationAssignedCode', 'type': 'str'}, + 'communication_agreement_id': {'key': 'communicationAgreementId', 'type': 'str'}, + 'apply_delimiter_string_advice': {'key': 'applyDelimiterStringAdvice', 'type': 'bool'}, + 'create_grouping_segments': {'key': 'createGroupingSegments', 'type': 'bool'}, + 'enable_default_group_headers': {'key': 'enableDefaultGroupHeaders', 'type': 'bool'}, + 'recipient_reference_password_value': {'key': 'recipientReferencePasswordValue', 'type': 'str'}, + 'recipient_reference_password_qualifier': {'key': 'recipientReferencePasswordQualifier', 'type': 'str'}, + 'application_reference_id': {'key': 'applicationReferenceId', 'type': 'str'}, + 'processing_priority_code': {'key': 'processingPriorityCode', 'type': 'str'}, + 'interchange_control_number_lower_bound': {'key': 'interchangeControlNumberLowerBound', 'type': 'long'}, + 'interchange_control_number_upper_bound': {'key': 'interchangeControlNumberUpperBound', 'type': 'long'}, + 'rollover_interchange_control_number': {'key': 'rolloverInterchangeControlNumber', 'type': 'bool'}, + 'interchange_control_number_prefix': {'key': 'interchangeControlNumberPrefix', 'type': 'str'}, + 'interchange_control_number_suffix': {'key': 'interchangeControlNumberSuffix', 'type': 'str'}, + 'sender_reverse_routing_address': {'key': 'senderReverseRoutingAddress', 'type': 'str'}, + 'receiver_reverse_routing_address': {'key': 'receiverReverseRoutingAddress', 'type': 'str'}, + 'functional_group_id': {'key': 'functionalGroupId', 'type': 'str'}, + 'group_controlling_agency_code': {'key': 'groupControllingAgencyCode', 'type': 'str'}, + 'group_message_version': {'key': 'groupMessageVersion', 'type': 'str'}, + 'group_message_release': {'key': 'groupMessageRelease', 'type': 'str'}, + 'group_control_number_lower_bound': {'key': 'groupControlNumberLowerBound', 'type': 'long'}, + 'group_control_number_upper_bound': {'key': 'groupControlNumberUpperBound', 'type': 'long'}, + 'rollover_group_control_number': {'key': 'rolloverGroupControlNumber', 'type': 'bool'}, + 'group_control_number_prefix': {'key': 'groupControlNumberPrefix', 'type': 'str'}, + 'group_control_number_suffix': {'key': 'groupControlNumberSuffix', 'type': 'str'}, + 'group_application_receiver_qualifier': {'key': 'groupApplicationReceiverQualifier', 'type': 'str'}, + 'group_application_receiver_id': {'key': 'groupApplicationReceiverId', 'type': 'str'}, + 'group_application_sender_qualifier': {'key': 'groupApplicationSenderQualifier', 'type': 'str'}, + 'group_application_sender_id': {'key': 'groupApplicationSenderId', 'type': 'str'}, + 'group_application_password': {'key': 'groupApplicationPassword', 'type': 'str'}, + 'overwrite_existing_transaction_set_control_number': {'key': 'overwriteExistingTransactionSetControlNumber', 'type': 'bool'}, + 'transaction_set_control_number_prefix': {'key': 'transactionSetControlNumberPrefix', 'type': 'str'}, + 'transaction_set_control_number_suffix': {'key': 'transactionSetControlNumberSuffix', 'type': 'str'}, + 'transaction_set_control_number_lower_bound': {'key': 'transactionSetControlNumberLowerBound', 'type': 'long'}, + 'transaction_set_control_number_upper_bound': {'key': 'transactionSetControlNumberUpperBound', 'type': 'long'}, + 'rollover_transaction_set_control_number': {'key': 'rolloverTransactionSetControlNumber', 'type': 'bool'}, + 'is_test_interchange': {'key': 'isTestInterchange', 'type': 'bool'}, + 'sender_internal_identification': {'key': 'senderInternalIdentification', 'type': 'str'}, + 'sender_internal_sub_identification': {'key': 'senderInternalSubIdentification', 'type': 'str'}, + 'receiver_internal_identification': {'key': 'receiverInternalIdentification', 'type': 'str'}, + 'receiver_internal_sub_identification': {'key': 'receiverInternalSubIdentification', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdifactEnvelopeSettings, self).__init__(**kwargs) + self.group_association_assigned_code = kwargs.get('group_association_assigned_code', None) + self.communication_agreement_id = kwargs.get('communication_agreement_id', None) + self.apply_delimiter_string_advice = kwargs['apply_delimiter_string_advice'] + self.create_grouping_segments = kwargs['create_grouping_segments'] + self.enable_default_group_headers = kwargs['enable_default_group_headers'] + self.recipient_reference_password_value = kwargs.get('recipient_reference_password_value', None) + self.recipient_reference_password_qualifier = kwargs.get('recipient_reference_password_qualifier', None) + self.application_reference_id = kwargs.get('application_reference_id', None) + self.processing_priority_code = kwargs.get('processing_priority_code', None) + self.interchange_control_number_lower_bound = kwargs['interchange_control_number_lower_bound'] + self.interchange_control_number_upper_bound = kwargs['interchange_control_number_upper_bound'] + self.rollover_interchange_control_number = kwargs['rollover_interchange_control_number'] + self.interchange_control_number_prefix = kwargs.get('interchange_control_number_prefix', None) + self.interchange_control_number_suffix = kwargs.get('interchange_control_number_suffix', None) + self.sender_reverse_routing_address = kwargs.get('sender_reverse_routing_address', None) + self.receiver_reverse_routing_address = kwargs.get('receiver_reverse_routing_address', None) + self.functional_group_id = kwargs.get('functional_group_id', None) + self.group_controlling_agency_code = kwargs.get('group_controlling_agency_code', None) + self.group_message_version = kwargs.get('group_message_version', None) + self.group_message_release = kwargs.get('group_message_release', None) + self.group_control_number_lower_bound = kwargs['group_control_number_lower_bound'] + self.group_control_number_upper_bound = kwargs['group_control_number_upper_bound'] + self.rollover_group_control_number = kwargs['rollover_group_control_number'] + self.group_control_number_prefix = kwargs.get('group_control_number_prefix', None) + self.group_control_number_suffix = kwargs.get('group_control_number_suffix', None) + self.group_application_receiver_qualifier = kwargs.get('group_application_receiver_qualifier', None) + self.group_application_receiver_id = kwargs.get('group_application_receiver_id', None) + self.group_application_sender_qualifier = kwargs.get('group_application_sender_qualifier', None) + self.group_application_sender_id = kwargs.get('group_application_sender_id', None) + self.group_application_password = kwargs.get('group_application_password', None) + self.overwrite_existing_transaction_set_control_number = kwargs['overwrite_existing_transaction_set_control_number'] + self.transaction_set_control_number_prefix = kwargs.get('transaction_set_control_number_prefix', None) + self.transaction_set_control_number_suffix = kwargs.get('transaction_set_control_number_suffix', None) + self.transaction_set_control_number_lower_bound = kwargs['transaction_set_control_number_lower_bound'] + self.transaction_set_control_number_upper_bound = kwargs['transaction_set_control_number_upper_bound'] + self.rollover_transaction_set_control_number = kwargs['rollover_transaction_set_control_number'] + self.is_test_interchange = kwargs['is_test_interchange'] + self.sender_internal_identification = kwargs.get('sender_internal_identification', None) + self.sender_internal_sub_identification = kwargs.get('sender_internal_sub_identification', None) + self.receiver_internal_identification = kwargs.get('receiver_internal_identification', None) + self.receiver_internal_sub_identification = kwargs.get('receiver_internal_sub_identification', None) + + +class EdifactFramingSettings(msrest.serialization.Model): + """The Edifact agreement framing settings. + + All required parameters must be populated in order to send to Azure. + + :param service_code_list_directory_version: The service code list directory version. + :type service_code_list_directory_version: str + :param character_encoding: The character encoding. + :type character_encoding: str + :param protocol_version: Required. The protocol version. + :type protocol_version: int + :param data_element_separator: Required. The data element separator. + :type data_element_separator: int + :param component_separator: Required. The component separator. + :type component_separator: int + :param segment_terminator: Required. The segment terminator. + :type segment_terminator: int + :param release_indicator: Required. The release indicator. + :type release_indicator: int + :param repetition_separator: Required. The repetition separator. + :type repetition_separator: int + :param character_set: Required. The EDIFACT frame setting characterSet. Possible values + include: "NotSpecified", "UNOB", "UNOA", "UNOC", "UNOD", "UNOE", "UNOF", "UNOG", "UNOH", + "UNOI", "UNOJ", "UNOK", "UNOX", "UNOY", "KECA". + :type character_set: str or ~azure.mgmt.logic.models.EdifactCharacterSet + :param decimal_point_indicator: Required. The EDIFACT frame setting decimal indicator. Possible + values include: "NotSpecified", "Comma", "Decimal". + :type decimal_point_indicator: str or ~azure.mgmt.logic.models.EdifactDecimalIndicator + :param segment_terminator_suffix: Required. The EDIFACT frame setting segment terminator + suffix. Possible values include: "NotSpecified", "None", "CR", "LF", "CRLF". + :type segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix + """ + + _validation = { + 'protocol_version': {'required': True}, + 'data_element_separator': {'required': True}, + 'component_separator': {'required': True}, + 'segment_terminator': {'required': True}, + 'release_indicator': {'required': True}, + 'repetition_separator': {'required': True}, + 'character_set': {'required': True}, + 'decimal_point_indicator': {'required': True}, + 'segment_terminator_suffix': {'required': True}, + } + + _attribute_map = { + 'service_code_list_directory_version': {'key': 'serviceCodeListDirectoryVersion', 'type': 'str'}, + 'character_encoding': {'key': 'characterEncoding', 'type': 'str'}, + 'protocol_version': {'key': 'protocolVersion', 'type': 'int'}, + 'data_element_separator': {'key': 'dataElementSeparator', 'type': 'int'}, + 'component_separator': {'key': 'componentSeparator', 'type': 'int'}, + 'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'}, + 'release_indicator': {'key': 'releaseIndicator', 'type': 'int'}, + 'repetition_separator': {'key': 'repetitionSeparator', 'type': 'int'}, + 'character_set': {'key': 'characterSet', 'type': 'str'}, + 'decimal_point_indicator': {'key': 'decimalPointIndicator', 'type': 'str'}, + 'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdifactFramingSettings, self).__init__(**kwargs) + self.service_code_list_directory_version = kwargs.get('service_code_list_directory_version', None) + self.character_encoding = kwargs.get('character_encoding', None) + self.protocol_version = kwargs['protocol_version'] + self.data_element_separator = kwargs['data_element_separator'] + self.component_separator = kwargs['component_separator'] + self.segment_terminator = kwargs['segment_terminator'] + self.release_indicator = kwargs['release_indicator'] + self.repetition_separator = kwargs['repetition_separator'] + self.character_set = kwargs['character_set'] + self.decimal_point_indicator = kwargs['decimal_point_indicator'] + self.segment_terminator_suffix = kwargs['segment_terminator_suffix'] + + +class EdifactMessageFilter(msrest.serialization.Model): + """The Edifact message filter for odata query. + + All required parameters must be populated in order to send to Azure. + + :param message_filter_type: Required. The message filter type. Possible values include: + "NotSpecified", "Include", "Exclude". + :type message_filter_type: str or ~azure.mgmt.logic.models.MessageFilterType + """ + + _validation = { + 'message_filter_type': {'required': True}, + } + + _attribute_map = { + 'message_filter_type': {'key': 'messageFilterType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdifactMessageFilter, self).__init__(**kwargs) + self.message_filter_type = kwargs['message_filter_type'] + + +class EdifactMessageIdentifier(msrest.serialization.Model): + """The Edifact message identifier. + + All required parameters must be populated in order to send to Azure. + + :param message_id: Required. The message id on which this envelope settings has to be applied. + :type message_id: str + """ + + _validation = { + 'message_id': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdifactMessageIdentifier, self).__init__(**kwargs) + self.message_id = kwargs['message_id'] + + +class EdifactOneWayAgreement(msrest.serialization.Model): + """The Edifact one way agreement. + + All required parameters must be populated in order to send to Azure. + + :param sender_business_identity: Required. The sender business identity. + :type sender_business_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param receiver_business_identity: Required. The receiver business identity. + :type receiver_business_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param protocol_settings: Required. The EDIFACT protocol settings. + :type protocol_settings: ~azure.mgmt.logic.models.EdifactProtocolSettings + """ + + _validation = { + 'sender_business_identity': {'required': True}, + 'receiver_business_identity': {'required': True}, + 'protocol_settings': {'required': True}, + } + + _attribute_map = { + 'sender_business_identity': {'key': 'senderBusinessIdentity', 'type': 'BusinessIdentity'}, + 'receiver_business_identity': {'key': 'receiverBusinessIdentity', 'type': 'BusinessIdentity'}, + 'protocol_settings': {'key': 'protocolSettings', 'type': 'EdifactProtocolSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(EdifactOneWayAgreement, self).__init__(**kwargs) + self.sender_business_identity = kwargs['sender_business_identity'] + self.receiver_business_identity = kwargs['receiver_business_identity'] + self.protocol_settings = kwargs['protocol_settings'] + + +class EdifactProcessingSettings(msrest.serialization.Model): + """The Edifact agreement protocol settings. + + All required parameters must be populated in order to send to Azure. + + :param mask_security_info: Required. The value indicating whether to mask security information. + :type mask_security_info: bool + :param preserve_interchange: Required. The value indicating whether to preserve interchange. + :type preserve_interchange: bool + :param suspend_interchange_on_error: Required. The value indicating whether to suspend + interchange on error. + :type suspend_interchange_on_error: bool + :param create_empty_xml_tags_for_trailing_separators: Required. The value indicating whether to + create empty xml tags for trailing separators. + :type create_empty_xml_tags_for_trailing_separators: bool + :param use_dot_as_decimal_separator: Required. The value indicating whether to use dot as + decimal separator. + :type use_dot_as_decimal_separator: bool + """ + + _validation = { + 'mask_security_info': {'required': True}, + 'preserve_interchange': {'required': True}, + 'suspend_interchange_on_error': {'required': True}, + 'create_empty_xml_tags_for_trailing_separators': {'required': True}, + 'use_dot_as_decimal_separator': {'required': True}, + } + + _attribute_map = { + 'mask_security_info': {'key': 'maskSecurityInfo', 'type': 'bool'}, + 'preserve_interchange': {'key': 'preserveInterchange', 'type': 'bool'}, + 'suspend_interchange_on_error': {'key': 'suspendInterchangeOnError', 'type': 'bool'}, + 'create_empty_xml_tags_for_trailing_separators': {'key': 'createEmptyXmlTagsForTrailingSeparators', 'type': 'bool'}, + 'use_dot_as_decimal_separator': {'key': 'useDotAsDecimalSeparator', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(EdifactProcessingSettings, self).__init__(**kwargs) + self.mask_security_info = kwargs['mask_security_info'] + self.preserve_interchange = kwargs['preserve_interchange'] + self.suspend_interchange_on_error = kwargs['suspend_interchange_on_error'] + self.create_empty_xml_tags_for_trailing_separators = kwargs['create_empty_xml_tags_for_trailing_separators'] + self.use_dot_as_decimal_separator = kwargs['use_dot_as_decimal_separator'] + + +class EdifactProtocolSettings(msrest.serialization.Model): + """The Edifact agreement protocol settings. + + All required parameters must be populated in order to send to Azure. + + :param validation_settings: Required. The EDIFACT validation settings. + :type validation_settings: ~azure.mgmt.logic.models.EdifactValidationSettings + :param framing_settings: Required. The EDIFACT framing settings. + :type framing_settings: ~azure.mgmt.logic.models.EdifactFramingSettings + :param envelope_settings: Required. The EDIFACT envelope settings. + :type envelope_settings: ~azure.mgmt.logic.models.EdifactEnvelopeSettings + :param acknowledgement_settings: Required. The EDIFACT acknowledgement settings. + :type acknowledgement_settings: ~azure.mgmt.logic.models.EdifactAcknowledgementSettings + :param message_filter: Required. The EDIFACT message filter. + :type message_filter: ~azure.mgmt.logic.models.EdifactMessageFilter + :param processing_settings: Required. The EDIFACT processing Settings. + :type processing_settings: ~azure.mgmt.logic.models.EdifactProcessingSettings + :param envelope_overrides: The EDIFACT envelope override settings. + :type envelope_overrides: list[~azure.mgmt.logic.models.EdifactEnvelopeOverride] + :param message_filter_list: The EDIFACT message filter list. + :type message_filter_list: list[~azure.mgmt.logic.models.EdifactMessageIdentifier] + :param schema_references: Required. The EDIFACT schema references. + :type schema_references: list[~azure.mgmt.logic.models.EdifactSchemaReference] + :param validation_overrides: The EDIFACT validation override settings. + :type validation_overrides: list[~azure.mgmt.logic.models.EdifactValidationOverride] + :param edifact_delimiter_overrides: The EDIFACT delimiter override settings. + :type edifact_delimiter_overrides: list[~azure.mgmt.logic.models.EdifactDelimiterOverride] + """ + + _validation = { + 'validation_settings': {'required': True}, + 'framing_settings': {'required': True}, + 'envelope_settings': {'required': True}, + 'acknowledgement_settings': {'required': True}, + 'message_filter': {'required': True}, + 'processing_settings': {'required': True}, + 'schema_references': {'required': True}, + } + + _attribute_map = { + 'validation_settings': {'key': 'validationSettings', 'type': 'EdifactValidationSettings'}, + 'framing_settings': {'key': 'framingSettings', 'type': 'EdifactFramingSettings'}, + 'envelope_settings': {'key': 'envelopeSettings', 'type': 'EdifactEnvelopeSettings'}, + 'acknowledgement_settings': {'key': 'acknowledgementSettings', 'type': 'EdifactAcknowledgementSettings'}, + 'message_filter': {'key': 'messageFilter', 'type': 'EdifactMessageFilter'}, + 'processing_settings': {'key': 'processingSettings', 'type': 'EdifactProcessingSettings'}, + 'envelope_overrides': {'key': 'envelopeOverrides', 'type': '[EdifactEnvelopeOverride]'}, + 'message_filter_list': {'key': 'messageFilterList', 'type': '[EdifactMessageIdentifier]'}, + 'schema_references': {'key': 'schemaReferences', 'type': '[EdifactSchemaReference]'}, + 'validation_overrides': {'key': 'validationOverrides', 'type': '[EdifactValidationOverride]'}, + 'edifact_delimiter_overrides': {'key': 'edifactDelimiterOverrides', 'type': '[EdifactDelimiterOverride]'}, + } + + def __init__( + self, + **kwargs + ): + super(EdifactProtocolSettings, self).__init__(**kwargs) + self.validation_settings = kwargs['validation_settings'] + self.framing_settings = kwargs['framing_settings'] + self.envelope_settings = kwargs['envelope_settings'] + self.acknowledgement_settings = kwargs['acknowledgement_settings'] + self.message_filter = kwargs['message_filter'] + self.processing_settings = kwargs['processing_settings'] + self.envelope_overrides = kwargs.get('envelope_overrides', None) + self.message_filter_list = kwargs.get('message_filter_list', None) + self.schema_references = kwargs['schema_references'] + self.validation_overrides = kwargs.get('validation_overrides', None) + self.edifact_delimiter_overrides = kwargs.get('edifact_delimiter_overrides', None) + + +class EdifactSchemaReference(msrest.serialization.Model): + """The Edifact schema reference. + + All required parameters must be populated in order to send to Azure. + + :param message_id: Required. The message id. + :type message_id: str + :param message_version: Required. The message version. + :type message_version: str + :param message_release: Required. The message release version. + :type message_release: str + :param sender_application_id: The sender application id. + :type sender_application_id: str + :param sender_application_qualifier: The sender application qualifier. + :type sender_application_qualifier: str + :param association_assigned_code: The association assigned code. + :type association_assigned_code: str + :param schema_name: Required. The schema name. + :type schema_name: str + """ + + _validation = { + 'message_id': {'required': True}, + 'message_version': {'required': True}, + 'message_release': {'required': True}, + 'schema_name': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'message_version': {'key': 'messageVersion', 'type': 'str'}, + 'message_release': {'key': 'messageRelease', 'type': 'str'}, + 'sender_application_id': {'key': 'senderApplicationId', 'type': 'str'}, + 'sender_application_qualifier': {'key': 'senderApplicationQualifier', 'type': 'str'}, + 'association_assigned_code': {'key': 'associationAssignedCode', 'type': 'str'}, + 'schema_name': {'key': 'schemaName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdifactSchemaReference, self).__init__(**kwargs) + self.message_id = kwargs['message_id'] + self.message_version = kwargs['message_version'] + self.message_release = kwargs['message_release'] + self.sender_application_id = kwargs.get('sender_application_id', None) + self.sender_application_qualifier = kwargs.get('sender_application_qualifier', None) + self.association_assigned_code = kwargs.get('association_assigned_code', None) + self.schema_name = kwargs['schema_name'] + + +class EdifactValidationOverride(msrest.serialization.Model): + """The Edifact validation override settings. + + All required parameters must be populated in order to send to Azure. + + :param message_id: Required. The message id on which the validation settings has to be applied. + :type message_id: str + :param enforce_character_set: Required. The value indicating whether to validate character Set. + :type enforce_character_set: bool + :param validate_edi_types: Required. The value indicating whether to validate EDI types. + :type validate_edi_types: bool + :param validate_xsd_types: Required. The value indicating whether to validate XSD types. + :type validate_xsd_types: bool + :param allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + allow leading and trailing spaces and zeroes. + :type allow_leading_and_trailing_spaces_and_zeroes: bool + :param trailing_separator_policy: Required. The trailing separator policy. Possible values + include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :type trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy + :param trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + trim leading and trailing spaces and zeroes. + :type trim_leading_and_trailing_spaces_and_zeroes: bool + """ + + _validation = { + 'message_id': {'required': True}, + 'enforce_character_set': {'required': True}, + 'validate_edi_types': {'required': True}, + 'validate_xsd_types': {'required': True}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'required': True}, + 'trailing_separator_policy': {'required': True}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'enforce_character_set': {'key': 'enforceCharacterSet', 'type': 'bool'}, + 'validate_edi_types': {'key': 'validateEDITypes', 'type': 'bool'}, + 'validate_xsd_types': {'key': 'validateXSDTypes', 'type': 'bool'}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'key': 'allowLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + 'trailing_separator_policy': {'key': 'trailingSeparatorPolicy', 'type': 'str'}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'key': 'trimLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(EdifactValidationOverride, self).__init__(**kwargs) + self.message_id = kwargs['message_id'] + self.enforce_character_set = kwargs['enforce_character_set'] + self.validate_edi_types = kwargs['validate_edi_types'] + self.validate_xsd_types = kwargs['validate_xsd_types'] + self.allow_leading_and_trailing_spaces_and_zeroes = kwargs['allow_leading_and_trailing_spaces_and_zeroes'] + self.trailing_separator_policy = kwargs['trailing_separator_policy'] + self.trim_leading_and_trailing_spaces_and_zeroes = kwargs['trim_leading_and_trailing_spaces_and_zeroes'] + + +class EdifactValidationSettings(msrest.serialization.Model): + """The Edifact agreement validation settings. + + All required parameters must be populated in order to send to Azure. + + :param validate_character_set: Required. The value indicating whether to validate character set + in the message. + :type validate_character_set: bool + :param check_duplicate_interchange_control_number: Required. The value indicating whether to + check for duplicate interchange control number. + :type check_duplicate_interchange_control_number: bool + :param interchange_control_number_validity_days: Required. The validity period of interchange + control number. + :type interchange_control_number_validity_days: int + :param check_duplicate_group_control_number: Required. The value indicating whether to check + for duplicate group control number. + :type check_duplicate_group_control_number: bool + :param check_duplicate_transaction_set_control_number: Required. The value indicating whether + to check for duplicate transaction set control number. + :type check_duplicate_transaction_set_control_number: bool + :param validate_edi_types: Required. The value indicating whether to Whether to validate EDI + types. + :type validate_edi_types: bool + :param validate_xsd_types: Required. The value indicating whether to Whether to validate XSD + types. + :type validate_xsd_types: bool + :param allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + allow leading and trailing spaces and zeroes. + :type allow_leading_and_trailing_spaces_and_zeroes: bool + :param trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + trim leading and trailing spaces and zeroes. + :type trim_leading_and_trailing_spaces_and_zeroes: bool + :param trailing_separator_policy: Required. The trailing separator policy. Possible values + include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :type trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy + """ + + _validation = { + 'validate_character_set': {'required': True}, + 'check_duplicate_interchange_control_number': {'required': True}, + 'interchange_control_number_validity_days': {'required': True}, + 'check_duplicate_group_control_number': {'required': True}, + 'check_duplicate_transaction_set_control_number': {'required': True}, + 'validate_edi_types': {'required': True}, + 'validate_xsd_types': {'required': True}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'required': True}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'required': True}, + 'trailing_separator_policy': {'required': True}, + } + + _attribute_map = { + 'validate_character_set': {'key': 'validateCharacterSet', 'type': 'bool'}, + 'check_duplicate_interchange_control_number': {'key': 'checkDuplicateInterchangeControlNumber', 'type': 'bool'}, + 'interchange_control_number_validity_days': {'key': 'interchangeControlNumberValidityDays', 'type': 'int'}, + 'check_duplicate_group_control_number': {'key': 'checkDuplicateGroupControlNumber', 'type': 'bool'}, + 'check_duplicate_transaction_set_control_number': {'key': 'checkDuplicateTransactionSetControlNumber', 'type': 'bool'}, + 'validate_edi_types': {'key': 'validateEDITypes', 'type': 'bool'}, + 'validate_xsd_types': {'key': 'validateXSDTypes', 'type': 'bool'}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'key': 'allowLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'key': 'trimLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + 'trailing_separator_policy': {'key': 'trailingSeparatorPolicy', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdifactValidationSettings, self).__init__(**kwargs) + self.validate_character_set = kwargs['validate_character_set'] + self.check_duplicate_interchange_control_number = kwargs['check_duplicate_interchange_control_number'] + self.interchange_control_number_validity_days = kwargs['interchange_control_number_validity_days'] + self.check_duplicate_group_control_number = kwargs['check_duplicate_group_control_number'] + self.check_duplicate_transaction_set_control_number = kwargs['check_duplicate_transaction_set_control_number'] + self.validate_edi_types = kwargs['validate_edi_types'] + self.validate_xsd_types = kwargs['validate_xsd_types'] + self.allow_leading_and_trailing_spaces_and_zeroes = kwargs['allow_leading_and_trailing_spaces_and_zeroes'] + self.trim_leading_and_trailing_spaces_and_zeroes = kwargs['trim_leading_and_trailing_spaces_and_zeroes'] + self.trailing_separator_policy = kwargs['trailing_separator_policy'] + + +class ErrorProperties(msrest.serialization.Model): + """Error properties indicate why the Logic service was not able to process the incoming request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorProperties, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ErrorResponse(msrest.serialization.Model): + """Error response indicates Logic service is not able to process the incoming request. The error property contains the error details. + + :param error: The error properties. + :type error: ~azure.mgmt.logic.models.ErrorProperties + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class Expression(msrest.serialization.Model): + """The expression. + + :param text: The text. + :type text: str + :param value: Any object. + :type value: object + :param subexpressions: The sub expressions. + :type subexpressions: list[~azure.mgmt.logic.models.Expression] + :param error: The azure resource error info. + :type error: ~azure.mgmt.logic.models.AzureResourceErrorInfo + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'subexpressions': {'key': 'subexpressions', 'type': '[Expression]'}, + 'error': {'key': 'error', 'type': 'AzureResourceErrorInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(Expression, self).__init__(**kwargs) + self.text = kwargs.get('text', None) + self.value = kwargs.get('value', None) + self.subexpressions = kwargs.get('subexpressions', None) + self.error = kwargs.get('error', None) + + +class ExpressionRoot(Expression): + """The expression root. + + :param text: The text. + :type text: str + :param value: Any object. + :type value: object + :param subexpressions: The sub expressions. + :type subexpressions: list[~azure.mgmt.logic.models.Expression] + :param error: The azure resource error info. + :type error: ~azure.mgmt.logic.models.AzureResourceErrorInfo + :param path: The path. + :type path: str + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'subexpressions': {'key': 'subexpressions', 'type': '[Expression]'}, + 'error': {'key': 'error', 'type': 'AzureResourceErrorInfo'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressionRoot, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + + +class ExpressionTraces(msrest.serialization.Model): + """The expression traces. + + :param inputs: + :type inputs: list[~azure.mgmt.logic.models.ExpressionRoot] + """ + + _attribute_map = { + 'inputs': {'key': 'inputs', 'type': '[ExpressionRoot]'}, + } + + def __init__( + self, + **kwargs + ): + super(ExpressionTraces, self).__init__(**kwargs) + self.inputs = kwargs.get('inputs', None) + + +class ExtendedErrorInfo(msrest.serialization.Model): + """The extended error info. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code. Possible values include: "NotSpecified", + "IntegrationServiceEnvironmentNotFound", "InternalServerError", "InvalidOperationId". + :type code: str or ~azure.mgmt.logic.models.ErrorResponseCode + :param message: Required. The error message. + :type message: str + :param details: The error message details. + :type details: list[~azure.mgmt.logic.models.ExtendedErrorInfo] + :param inner_error: The inner error. + :type inner_error: object + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ExtendedErrorInfo]'}, + 'inner_error': {'key': 'innerError', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ExtendedErrorInfo, self).__init__(**kwargs) + self.code = kwargs['code'] + self.message = kwargs['message'] + self.details = kwargs.get('details', None) + self.inner_error = kwargs.get('inner_error', None) + + +class FlowAccessControlConfiguration(msrest.serialization.Model): + """The access control configuration. + + :param triggers: The access control configuration for invoking workflow triggers. + :type triggers: ~azure.mgmt.logic.models.FlowAccessControlConfigurationPolicy + :param contents: The access control configuration for accessing workflow run contents. + :type contents: ~azure.mgmt.logic.models.FlowAccessControlConfigurationPolicy + :param actions: The access control configuration for workflow actions. + :type actions: ~azure.mgmt.logic.models.FlowAccessControlConfigurationPolicy + :param workflow_management: The access control configuration for workflow management. + :type workflow_management: ~azure.mgmt.logic.models.FlowAccessControlConfigurationPolicy + """ + + _attribute_map = { + 'triggers': {'key': 'triggers', 'type': 'FlowAccessControlConfigurationPolicy'}, + 'contents': {'key': 'contents', 'type': 'FlowAccessControlConfigurationPolicy'}, + 'actions': {'key': 'actions', 'type': 'FlowAccessControlConfigurationPolicy'}, + 'workflow_management': {'key': 'workflowManagement', 'type': 'FlowAccessControlConfigurationPolicy'}, + } + + def __init__( + self, + **kwargs + ): + super(FlowAccessControlConfiguration, self).__init__(**kwargs) + self.triggers = kwargs.get('triggers', None) + self.contents = kwargs.get('contents', None) + self.actions = kwargs.get('actions', None) + self.workflow_management = kwargs.get('workflow_management', None) + + +class FlowAccessControlConfigurationPolicy(msrest.serialization.Model): + """The access control configuration policy. + + :param allowed_caller_ip_addresses: The allowed caller IP address ranges. + :type allowed_caller_ip_addresses: list[~azure.mgmt.logic.models.IpAddressRange] + :param open_authentication_policies: The authentication policies for workflow. + :type open_authentication_policies: ~azure.mgmt.logic.models.OpenAuthenticationAccessPolicies + """ + + _attribute_map = { + 'allowed_caller_ip_addresses': {'key': 'allowedCallerIpAddresses', 'type': '[IpAddressRange]'}, + 'open_authentication_policies': {'key': 'openAuthenticationPolicies', 'type': 'OpenAuthenticationAccessPolicies'}, + } + + def __init__( + self, + **kwargs + ): + super(FlowAccessControlConfigurationPolicy, self).__init__(**kwargs) + self.allowed_caller_ip_addresses = kwargs.get('allowed_caller_ip_addresses', None) + self.open_authentication_policies = kwargs.get('open_authentication_policies', None) + + +class FlowEndpoints(msrest.serialization.Model): + """The flow endpoints configuration. + + :param outgoing_ip_addresses: The outgoing ip address. + :type outgoing_ip_addresses: list[~azure.mgmt.logic.models.IpAddress] + :param access_endpoint_ip_addresses: The access endpoint ip address. + :type access_endpoint_ip_addresses: list[~azure.mgmt.logic.models.IpAddress] + """ + + _attribute_map = { + 'outgoing_ip_addresses': {'key': 'outgoingIpAddresses', 'type': '[IpAddress]'}, + 'access_endpoint_ip_addresses': {'key': 'accessEndpointIpAddresses', 'type': '[IpAddress]'}, + } + + def __init__( + self, + **kwargs + ): + super(FlowEndpoints, self).__init__(**kwargs) + self.outgoing_ip_addresses = kwargs.get('outgoing_ip_addresses', None) + self.access_endpoint_ip_addresses = kwargs.get('access_endpoint_ip_addresses', None) + + +class FlowEndpointsConfiguration(msrest.serialization.Model): + """The endpoints configuration. + + :param workflow: The workflow endpoints. + :type workflow: ~azure.mgmt.logic.models.FlowEndpoints + :param connector: The connector endpoints. + :type connector: ~azure.mgmt.logic.models.FlowEndpoints + """ + + _attribute_map = { + 'workflow': {'key': 'workflow', 'type': 'FlowEndpoints'}, + 'connector': {'key': 'connector', 'type': 'FlowEndpoints'}, + } + + def __init__( + self, + **kwargs + ): + super(FlowEndpointsConfiguration, self).__init__(**kwargs) + self.workflow = kwargs.get('workflow', None) + self.connector = kwargs.get('connector', None) + + +class GenerateUpgradedDefinitionParameters(msrest.serialization.Model): + """The parameters to generate upgraded definition. + + :param target_schema_version: The target schema version. + :type target_schema_version: str + """ + + _attribute_map = { + 'target_schema_version': {'key': 'targetSchemaVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GenerateUpgradedDefinitionParameters, self).__init__(**kwargs) + self.target_schema_version = kwargs.get('target_schema_version', None) + + +class GetCallbackUrlParameters(msrest.serialization.Model): + """The callback url parameters. + + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. Possible values include: "NotSpecified", "Primary", "Secondary". + :type key_type: str or ~azure.mgmt.logic.models.KeyType + """ + + _attribute_map = { + 'not_after': {'key': 'notAfter', 'type': 'iso-8601'}, + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GetCallbackUrlParameters, self).__init__(**kwargs) + self.not_after = kwargs.get('not_after', None) + self.key_type = kwargs.get('key_type', None) + + +class IntegrationAccount(Resource): + """The integration account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param sku: The sku. + :type sku: ~azure.mgmt.logic.models.IntegrationAccountSku + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~azure.mgmt.logic.models.IntegrationServiceEnvironment + :param state: The workflow state. Possible values include: "NotSpecified", "Completed", + "Enabled", "Disabled", "Deleted", "Suspended". + :type state: str or ~azure.mgmt.logic.models.WorkflowState + """ + + _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}'}, + 'sku': {'key': 'sku', 'type': 'IntegrationAccountSku'}, + 'integration_service_environment': {'key': 'properties.integrationServiceEnvironment', 'type': 'IntegrationServiceEnvironment'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccount, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.integration_service_environment = kwargs.get('integration_service_environment', None) + self.state = kwargs.get('state', None) + + +class IntegrationAccountAgreement(Resource): + """The integration account agreement. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :ivar created_time: The created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: The changed time. + :vartype changed_time: ~datetime.datetime + :param metadata: The metadata. + :type metadata: object + :param agreement_type: Required. The agreement type. Possible values include: "NotSpecified", + "AS2", "X12", "Edifact". + :type agreement_type: str or ~azure.mgmt.logic.models.AgreementType + :param host_partner: Required. The integration account partner that is set as host partner for + this agreement. + :type host_partner: str + :param guest_partner: Required. The integration account partner that is set as guest partner + for this agreement. + :type guest_partner: str + :param host_identity: Required. The business identity of the host partner. + :type host_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param guest_identity: Required. The business identity of the guest partner. + :type guest_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param content: Required. The agreement content. + :type content: ~azure.mgmt.logic.models.AgreementContent + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'agreement_type': {'required': True}, + 'host_partner': {'required': True}, + 'guest_partner': {'required': True}, + 'host_identity': {'required': True}, + 'guest_identity': {'required': True}, + 'content': {'required': 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}'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'agreement_type': {'key': 'properties.agreementType', 'type': 'str'}, + 'host_partner': {'key': 'properties.hostPartner', 'type': 'str'}, + 'guest_partner': {'key': 'properties.guestPartner', 'type': 'str'}, + 'host_identity': {'key': 'properties.hostIdentity', 'type': 'BusinessIdentity'}, + 'guest_identity': {'key': 'properties.guestIdentity', 'type': 'BusinessIdentity'}, + 'content': {'key': 'properties.content', 'type': 'AgreementContent'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountAgreement, self).__init__(**kwargs) + self.created_time = None + self.changed_time = None + self.metadata = kwargs.get('metadata', None) + self.agreement_type = kwargs['agreement_type'] + self.host_partner = kwargs['host_partner'] + self.guest_partner = kwargs['guest_partner'] + self.host_identity = kwargs['host_identity'] + self.guest_identity = kwargs['guest_identity'] + self.content = kwargs['content'] + + +class IntegrationAccountAgreementFilter(msrest.serialization.Model): + """The integration account agreement filter for odata query. + + All required parameters must be populated in order to send to Azure. + + :param agreement_type: Required. The agreement type of integration account agreement. Possible + values include: "NotSpecified", "AS2", "X12", "Edifact". + :type agreement_type: str or ~azure.mgmt.logic.models.AgreementType + """ + + _validation = { + 'agreement_type': {'required': True}, + } + + _attribute_map = { + 'agreement_type': {'key': 'agreementType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountAgreementFilter, self).__init__(**kwargs) + self.agreement_type = kwargs['agreement_type'] + + +class IntegrationAccountAgreementListResult(msrest.serialization.Model): + """The list of integration account agreements. + + :param value: The list of integration account agreements. + :type value: list[~azure.mgmt.logic.models.IntegrationAccountAgreement] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationAccountAgreement]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountAgreementListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class IntegrationAccountCertificate(Resource): + """The integration account certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :ivar created_time: The created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: The changed time. + :vartype changed_time: ~datetime.datetime + :param metadata: The metadata. + :type metadata: object + :param key: The key details in the key vault. + :type key: ~azure.mgmt.logic.models.KeyVaultKeyReference + :param public_certificate: The public certificate. + :type public_certificate: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'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}'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'key': {'key': 'properties.key', 'type': 'KeyVaultKeyReference'}, + 'public_certificate': {'key': 'properties.publicCertificate', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountCertificate, self).__init__(**kwargs) + self.created_time = None + self.changed_time = None + self.metadata = kwargs.get('metadata', None) + self.key = kwargs.get('key', None) + self.public_certificate = kwargs.get('public_certificate', None) + + +class IntegrationAccountCertificateListResult(msrest.serialization.Model): + """The list of integration account certificates. + + :param value: The list of integration account certificates. + :type value: list[~azure.mgmt.logic.models.IntegrationAccountCertificate] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationAccountCertificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountCertificateListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class IntegrationAccountListResult(msrest.serialization.Model): + """The list of integration accounts. + + :param value: The list of integration accounts. + :type value: list[~azure.mgmt.logic.models.IntegrationAccount] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class IntegrationAccountMap(Resource): + """The integration account map. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param map_type: Required. The map type. Possible values include: "NotSpecified", "Xslt", + "Xslt20", "Xslt30", "Liquid". + :type map_type: str or ~azure.mgmt.logic.models.MapType + :param parameters_schema: The parameters schema of integration account map. + :type parameters_schema: + ~azure.mgmt.logic.models.IntegrationAccountMapPropertiesParametersSchema + :ivar created_time: The created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: The changed time. + :vartype changed_time: ~datetime.datetime + :param content: The content. + :type content: str + :param content_type: The content type. + :type content_type: str + :ivar content_link: The content link. + :vartype content_link: ~azure.mgmt.logic.models.ContentLink + :param metadata: The metadata. + :type metadata: object + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'map_type': {'required': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'content_link': {'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}'}, + 'map_type': {'key': 'properties.mapType', 'type': 'str'}, + 'parameters_schema': {'key': 'properties.parametersSchema', 'type': 'IntegrationAccountMapPropertiesParametersSchema'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'content': {'key': 'properties.content', 'type': 'str'}, + 'content_type': {'key': 'properties.contentType', 'type': 'str'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountMap, self).__init__(**kwargs) + self.map_type = kwargs['map_type'] + self.parameters_schema = kwargs.get('parameters_schema', None) + self.created_time = None + self.changed_time = None + self.content = kwargs.get('content', None) + self.content_type = kwargs.get('content_type', None) + self.content_link = None + self.metadata = kwargs.get('metadata', None) + + +class IntegrationAccountMapFilter(msrest.serialization.Model): + """The integration account map filter for odata query. + + All required parameters must be populated in order to send to Azure. + + :param map_type: Required. The map type of integration account map. Possible values include: + "NotSpecified", "Xslt", "Xslt20", "Xslt30", "Liquid". + :type map_type: str or ~azure.mgmt.logic.models.MapType + """ + + _validation = { + 'map_type': {'required': True}, + } + + _attribute_map = { + 'map_type': {'key': 'mapType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountMapFilter, self).__init__(**kwargs) + self.map_type = kwargs['map_type'] + + +class IntegrationAccountMapListResult(msrest.serialization.Model): + """The list of integration account maps. + + :param value: The list of integration account maps. + :type value: list[~azure.mgmt.logic.models.IntegrationAccountMap] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationAccountMap]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountMapListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class IntegrationAccountMapPropertiesParametersSchema(msrest.serialization.Model): + """The parameters schema of integration account map. + + :param ref: The reference name. + :type ref: str + """ + + _attribute_map = { + 'ref': {'key': 'ref', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountMapPropertiesParametersSchema, self).__init__(**kwargs) + self.ref = kwargs.get('ref', None) + + +class IntegrationAccountPartner(Resource): + """The integration account partner. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param partner_type: Required. The partner type. Possible values include: "NotSpecified", + "B2B". + :type partner_type: str or ~azure.mgmt.logic.models.PartnerType + :ivar created_time: The created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: The changed time. + :vartype changed_time: ~datetime.datetime + :param metadata: The metadata. + :type metadata: object + :param content: Required. The partner content. + :type content: ~azure.mgmt.logic.models.PartnerContent + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'partner_type': {'required': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'content': {'required': 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}'}, + 'partner_type': {'key': 'properties.partnerType', 'type': 'str'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'content': {'key': 'properties.content', 'type': 'PartnerContent'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountPartner, self).__init__(**kwargs) + self.partner_type = kwargs['partner_type'] + self.created_time = None + self.changed_time = None + self.metadata = kwargs.get('metadata', None) + self.content = kwargs['content'] + + +class IntegrationAccountPartnerFilter(msrest.serialization.Model): + """The integration account partner filter for odata query. + + All required parameters must be populated in order to send to Azure. + + :param partner_type: Required. The partner type of integration account partner. Possible values + include: "NotSpecified", "B2B". + :type partner_type: str or ~azure.mgmt.logic.models.PartnerType + """ + + _validation = { + 'partner_type': {'required': True}, + } + + _attribute_map = { + 'partner_type': {'key': 'partnerType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountPartnerFilter, self).__init__(**kwargs) + self.partner_type = kwargs['partner_type'] + + +class IntegrationAccountPartnerListResult(msrest.serialization.Model): + """The list of integration account partners. + + :param value: The list of integration account partners. + :type value: list[~azure.mgmt.logic.models.IntegrationAccountPartner] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationAccountPartner]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountPartnerListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class IntegrationAccountSchema(Resource): + """The integration account schema. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param schema_type: Required. The schema type. Possible values include: "NotSpecified", "Xml". + :type schema_type: str or ~azure.mgmt.logic.models.SchemaType + :param target_namespace: The target namespace of the schema. + :type target_namespace: str + :param document_name: The document name. + :type document_name: str + :param file_name: The file name. + :type file_name: str + :ivar created_time: The created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: The changed time. + :vartype changed_time: ~datetime.datetime + :param metadata: The metadata. + :type metadata: object + :param content: The content. + :type content: str + :param content_type: The content type. + :type content_type: str + :ivar content_link: The content link. + :vartype content_link: ~azure.mgmt.logic.models.ContentLink + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'schema_type': {'required': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'content_link': {'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}'}, + 'schema_type': {'key': 'properties.schemaType', 'type': 'str'}, + 'target_namespace': {'key': 'properties.targetNamespace', 'type': 'str'}, + 'document_name': {'key': 'properties.documentName', 'type': 'str'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'content': {'key': 'properties.content', 'type': 'str'}, + 'content_type': {'key': 'properties.contentType', 'type': 'str'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountSchema, self).__init__(**kwargs) + self.schema_type = kwargs['schema_type'] + self.target_namespace = kwargs.get('target_namespace', None) + self.document_name = kwargs.get('document_name', None) + self.file_name = kwargs.get('file_name', None) + self.created_time = None + self.changed_time = None + self.metadata = kwargs.get('metadata', None) + self.content = kwargs.get('content', None) + self.content_type = kwargs.get('content_type', None) + self.content_link = None + + +class IntegrationAccountSchemaFilter(msrest.serialization.Model): + """The integration account schema filter for odata query. + + All required parameters must be populated in order to send to Azure. + + :param schema_type: Required. The schema type of integration account schema. Possible values + include: "NotSpecified", "Xml". + :type schema_type: str or ~azure.mgmt.logic.models.SchemaType + """ + + _validation = { + 'schema_type': {'required': True}, + } + + _attribute_map = { + 'schema_type': {'key': 'schemaType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountSchemaFilter, self).__init__(**kwargs) + self.schema_type = kwargs['schema_type'] + + +class IntegrationAccountSchemaListResult(msrest.serialization.Model): + """The list of integration account schemas. + + :param value: The list of integration account schemas. + :type value: list[~azure.mgmt.logic.models.IntegrationAccountSchema] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationAccountSchema]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountSchemaListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class IntegrationAccountSession(Resource): + """The integration account session. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :ivar created_time: The created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: The changed time. + :vartype changed_time: ~datetime.datetime + :param content: The session content. + :type content: object + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'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}'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'content': {'key': 'properties.content', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountSession, self).__init__(**kwargs) + self.created_time = None + self.changed_time = None + self.content = kwargs.get('content', None) + + +class IntegrationAccountSessionFilter(msrest.serialization.Model): + """The integration account session filter. + + All required parameters must be populated in order to send to Azure. + + :param changed_time: Required. The changed time of integration account sessions. + :type changed_time: ~datetime.datetime + """ + + _validation = { + 'changed_time': {'required': True}, + } + + _attribute_map = { + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountSessionFilter, self).__init__(**kwargs) + self.changed_time = kwargs['changed_time'] + + +class IntegrationAccountSessionListResult(msrest.serialization.Model): + """The list of integration account sessions. + + :param value: The list of integration account sessions. + :type value: list[~azure.mgmt.logic.models.IntegrationAccountSession] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationAccountSession]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountSessionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class IntegrationAccountSku(msrest.serialization.Model): + """The integration account sku. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The sku name. Possible values include: "NotSpecified", "Free", "Basic", + "Standard". + :type name: str or ~azure.mgmt.logic.models.IntegrationAccountSkuName + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationAccountSku, self).__init__(**kwargs) + self.name = kwargs['name'] + + +class IntegrationServiceEnvironment(Resource): + """The integration service environment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param properties: The integration service environment properties. + :type properties: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentProperties + :param sku: The sku. + :type sku: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSku + """ + + _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}'}, + 'properties': {'key': 'properties', 'type': 'IntegrationServiceEnvironmentProperties'}, + 'sku': {'key': 'sku', 'type': 'IntegrationServiceEnvironmentSku'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationServiceEnvironment, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.sku = kwargs.get('sku', None) + + +class IntegrationServiceEnvironmentAccessEndpoint(msrest.serialization.Model): + """The integration service environment access endpoint. + + :param type: The access endpoint type. Possible values include: "NotSpecified", "External", + "Internal". + :type type: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentAccessEndpointType + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationServiceEnvironmentAccessEndpoint, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + + +class IntegrationServiceEnvironmentListResult(msrest.serialization.Model): + """The list of integration service environments. + + :param value: + :type value: list[~azure.mgmt.logic.models.IntegrationServiceEnvironment] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationServiceEnvironment]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationServiceEnvironmentListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class IntegrationServiceEnvironmentNetworkDependency(msrest.serialization.Model): + """The azure async operation resource. + + :param category: The network dependency category type. Possible values include: "NotSpecified", + "AzureStorage", "AzureManagement", "AzureActiveDirectory", "SSLCertificateVerification", + "DiagnosticLogsAndMetrics", "IntegrationServiceEnvironmentConnectors", "RedisCache", + "AccessEndpoints", "RecoveryService", "SQL", "RegionalService". + :type category: str or + ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependencyCategoryType + :param display_name: The display name. + :type display_name: str + :param endpoints: The endpoints. + :type endpoints: list[~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkEndpoint] + """ + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[IntegrationServiceEnvironmentNetworkEndpoint]'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationServiceEnvironmentNetworkDependency, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.display_name = kwargs.get('display_name', None) + self.endpoints = kwargs.get('endpoints', None) + + +class IntegrationServiceEnvironmentNetworkDependencyHealth(msrest.serialization.Model): + """The integration service environment subnet network health. + + :param error: The error if any occurred during the operation. + :type error: ~azure.mgmt.logic.models.ExtendedErrorInfo + :param state: The network dependency health state. Possible values include: "NotSpecified", + "Healthy", "Unhealthy", "Unknown". + :type state: str or + ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependencyHealthState + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ExtendedErrorInfo'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationServiceEnvironmentNetworkDependencyHealth, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + self.state = kwargs.get('state', None) + + +class IntegrationServiceEnvironmentNetworkEndpoint(msrest.serialization.Model): + """The network endpoint. + + :param accessibility: The accessibility state. Possible values include: "NotSpecified", + "Unknown", "Available", "NotAvailable". + :type accessibility: str or + ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState + :param domain_name: The domain name. + :type domain_name: str + :param ports: The ports. + :type ports: list[str] + """ + + _attribute_map = { + 'accessibility': {'key': 'accessibility', 'type': 'str'}, + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'ports': {'key': 'ports', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationServiceEnvironmentNetworkEndpoint, self).__init__(**kwargs) + self.accessibility = kwargs.get('accessibility', None) + self.domain_name = kwargs.get('domain_name', None) + self.ports = kwargs.get('ports', None) + + +class IntegrationServiceEnvironmentProperties(msrest.serialization.Model): + """The integration service environment properties. + + :param provisioning_state: The provisioning state. Possible values include: "NotSpecified", + "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", + "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :type provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState + :param state: The integration service environment state. Possible values include: + "NotSpecified", "Completed", "Enabled", "Disabled", "Deleted", "Suspended". + :type state: str or ~azure.mgmt.logic.models.WorkflowState + :param integration_service_environment_id: Gets the tracking id. + :type integration_service_environment_id: str + :param endpoints_configuration: The endpoints configuration. + :type endpoints_configuration: ~azure.mgmt.logic.models.FlowEndpointsConfiguration + :param network_configuration: The network configuration. + :type network_configuration: ~azure.mgmt.logic.models.NetworkConfiguration + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'integration_service_environment_id': {'key': 'integrationServiceEnvironmentId', 'type': 'str'}, + 'endpoints_configuration': {'key': 'endpointsConfiguration', 'type': 'FlowEndpointsConfiguration'}, + 'network_configuration': {'key': 'networkConfiguration', 'type': 'NetworkConfiguration'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationServiceEnvironmentProperties, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.state = kwargs.get('state', None) + self.integration_service_environment_id = kwargs.get('integration_service_environment_id', None) + self.endpoints_configuration = kwargs.get('endpoints_configuration', None) + self.network_configuration = kwargs.get('network_configuration', None) + + +class IntegrationServiceEnvironmentSku(msrest.serialization.Model): + """The integration service environment sku. + + :param name: The sku name. Possible values include: "NotSpecified", "Premium", "Developer". + :type name: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuName + :param capacity: The sku capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationServiceEnvironmentSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.capacity = kwargs.get('capacity', None) + + +class IntegrationServiceEnvironmentSkuCapacity(msrest.serialization.Model): + """The integration service environment sku capacity. + + :param minimum: The minimum capacity. + :type minimum: int + :param maximum: The maximum capacity. + :type maximum: int + :param default: The default capacity. + :type default: int + :param scale_type: The sku scale type. Possible values include: "Manual", "Automatic", "None". + :type scale_type: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuScaleType + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationServiceEnvironmentSkuCapacity, self).__init__(**kwargs) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + self.default = kwargs.get('default', None) + self.scale_type = kwargs.get('scale_type', None) + + +class IntegrationServiceEnvironmentSkuDefinition(msrest.serialization.Model): + """The integration service environment sku definition. + + :param resource_type: The resource type. + :type resource_type: str + :param sku: The sku. + :type sku: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuDefinitionSku + :param capacity: The sku capacity. + :type capacity: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuCapacity + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'IntegrationServiceEnvironmentSkuDefinitionSku'}, + 'capacity': {'key': 'capacity', 'type': 'IntegrationServiceEnvironmentSkuCapacity'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationServiceEnvironmentSkuDefinition, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.sku = kwargs.get('sku', None) + self.capacity = kwargs.get('capacity', None) + + +class IntegrationServiceEnvironmentSkuDefinitionSku(msrest.serialization.Model): + """The sku. + + :param name: The sku name. Possible values include: "NotSpecified", "Premium", "Developer". + :type name: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuName + :param tier: The sku tier. + :type tier: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationServiceEnvironmentSkuDefinitionSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class IntegrationServiceEnvironmentSkuList(msrest.serialization.Model): + """The list of integration service environment skus. + + :param value: The list of integration service environment skus. + :type value: list[~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuDefinition] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationServiceEnvironmentSkuDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationServiceEnvironmentSkuList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class IntegrationServiceEnvironmentSubnetNetworkHealth(msrest.serialization.Model): + """The integration service environment subnet network health. + + All required parameters must be populated in order to send to Azure. + + :param outbound_network_dependencies: The outbound network dependencies. + :type outbound_network_dependencies: + list[~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependency] + :param outbound_network_health: The integration service environment network health. + :type outbound_network_health: + ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependencyHealth + :param network_dependency_health_state: Required. The integration service environment network + health state. Possible values include: "NotSpecified", "Unknown", "Available", "NotAvailable". + :type network_dependency_health_state: str or + ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState + """ + + _validation = { + 'network_dependency_health_state': {'required': True}, + } + + _attribute_map = { + 'outbound_network_dependencies': {'key': 'outboundNetworkDependencies', 'type': '[IntegrationServiceEnvironmentNetworkDependency]'}, + 'outbound_network_health': {'key': 'outboundNetworkHealth', 'type': 'IntegrationServiceEnvironmentNetworkDependencyHealth'}, + 'network_dependency_health_state': {'key': 'networkDependencyHealthState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IntegrationServiceEnvironmentSubnetNetworkHealth, self).__init__(**kwargs) + self.outbound_network_dependencies = kwargs.get('outbound_network_dependencies', None) + self.outbound_network_health = kwargs.get('outbound_network_health', None) + self.network_dependency_health_state = kwargs['network_dependency_health_state'] + + +class IpAddress(msrest.serialization.Model): + """The ip address. + + :param address: The address. + :type address: str + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IpAddress, self).__init__(**kwargs) + self.address = kwargs.get('address', None) + + +class IpAddressRange(msrest.serialization.Model): + """The ip address range. + + :param address_range: The IP address range. + :type address_range: str + """ + + _attribute_map = { + 'address_range': {'key': 'addressRange', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IpAddressRange, self).__init__(**kwargs) + self.address_range = kwargs.get('address_range', None) + + +class JsonSchema(msrest.serialization.Model): + """The JSON schema. + + :param title: The JSON title. + :type title: str + :param content: The JSON content. + :type content: str + """ + + _attribute_map = { + 'title': {'key': 'title', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(JsonSchema, self).__init__(**kwargs) + self.title = kwargs.get('title', None) + self.content = kwargs.get('content', None) + + +class KeyVaultKey(msrest.serialization.Model): + """The key vault key. + + :param kid: The key id. + :type kid: str + :param attributes: The key attributes. + :type attributes: ~azure.mgmt.logic.models.KeyVaultKeyAttributes + """ + + _attribute_map = { + 'kid': {'key': 'kid', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'KeyVaultKeyAttributes'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyVaultKey, self).__init__(**kwargs) + self.kid = kwargs.get('kid', None) + self.attributes = kwargs.get('attributes', None) + + +class KeyVaultKeyAttributes(msrest.serialization.Model): + """The key attributes. + + :param enabled: Whether the key is enabled or not. + :type enabled: bool + :param created: When the key was created. + :type created: long + :param updated: When the key was updated. + :type updated: long + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'long'}, + 'updated': {'key': 'updated', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyVaultKeyAttributes, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.created = kwargs.get('created', None) + self.updated = kwargs.get('updated', None) + + +class KeyVaultKeyCollection(msrest.serialization.Model): + """Collection of key vault keys. + + :param value: The key vault keys. + :type value: list[~azure.mgmt.logic.models.KeyVaultKey] + :param skip_token: The skip token. + :type skip_token: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[KeyVaultKey]'}, + 'skip_token': {'key': 'skipToken', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyVaultKeyCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.skip_token = kwargs.get('skip_token', None) + + +class KeyVaultKeyReference(msrest.serialization.Model): + """The reference to the key vault key. + + All required parameters must be populated in order to send to Azure. + + :param key_vault: Required. The key vault reference. + :type key_vault: ~azure.mgmt.logic.models.KeyVaultKeyReferenceKeyVault + :param key_name: Required. The private key name in key vault. + :type key_name: str + :param key_version: The private key version in key vault. + :type key_version: str + """ + + _validation = { + 'key_vault': {'required': True}, + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_vault': {'key': 'keyVault', 'type': 'KeyVaultKeyReferenceKeyVault'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_version': {'key': 'keyVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_vault = kwargs['key_vault'] + self.key_name = kwargs['key_name'] + self.key_version = kwargs.get('key_version', None) + + +class KeyVaultKeyReferenceKeyVault(msrest.serialization.Model): + """The key vault reference. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The resource id. + :type id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyVaultKeyReferenceKeyVault, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.name = None + self.type = None + + +class KeyVaultReference(ResourceReference): + """The key vault reference. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The resource id. + :type id: str + :ivar type: Gets the resource type. + :vartype type: str + :param name: The key vault name. + :type name: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyVaultReference, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class ListKeyVaultKeysDefinition(msrest.serialization.Model): + """The list key vault keys definition. + + All required parameters must be populated in order to send to Azure. + + :param key_vault: Required. The key vault reference. + :type key_vault: ~azure.mgmt.logic.models.KeyVaultReference + :param skip_token: The skip token. + :type skip_token: str + """ + + _validation = { + 'key_vault': {'required': True}, + } + + _attribute_map = { + 'key_vault': {'key': 'keyVault', 'type': 'KeyVaultReference'}, + 'skip_token': {'key': 'skipToken', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ListKeyVaultKeysDefinition, self).__init__(**kwargs) + self.key_vault = kwargs['key_vault'] + self.skip_token = kwargs.get('skip_token', None) + + +class ManagedApi(Resource): + """The managed api definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param properties: The api resource properties. + :type properties: ~azure.mgmt.logic.models.ApiResourceProperties + """ + + _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}'}, + 'properties': {'key': 'properties', 'type': 'ApiResourceProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedApi, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ManagedApiListResult(msrest.serialization.Model): + """The list of managed APIs. + + :param value: The managed APIs. + :type value: list[~azure.mgmt.logic.models.ManagedApi] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ManagedApi]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedApiListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class NetworkConfiguration(msrest.serialization.Model): + """The network configuration. + + :param virtual_network_address_space: Gets the virtual network address space. + :type virtual_network_address_space: str + :param access_endpoint: The access endpoint. + :type access_endpoint: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentAccessEndpoint + :param subnets: The subnets. + :type subnets: list[~azure.mgmt.logic.models.ResourceReference] + """ + + _attribute_map = { + 'virtual_network_address_space': {'key': 'virtualNetworkAddressSpace', 'type': 'str'}, + 'access_endpoint': {'key': 'accessEndpoint', 'type': 'IntegrationServiceEnvironmentAccessEndpoint'}, + 'subnets': {'key': 'subnets', 'type': '[ResourceReference]'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkConfiguration, self).__init__(**kwargs) + self.virtual_network_address_space = kwargs.get('virtual_network_address_space', None) + self.access_endpoint = kwargs.get('access_endpoint', None) + self.subnets = kwargs.get('subnets', None) + + +class OpenAuthenticationAccessPolicies(msrest.serialization.Model): + """AuthenticationPolicy of type Open. + + :param policies: Open authentication policies. + :type policies: dict[str, ~azure.mgmt.logic.models.OpenAuthenticationAccessPolicy] + """ + + _attribute_map = { + 'policies': {'key': 'policies', 'type': '{OpenAuthenticationAccessPolicy}'}, + } + + def __init__( + self, + **kwargs + ): + super(OpenAuthenticationAccessPolicies, self).__init__(**kwargs) + self.policies = kwargs.get('policies', None) + + +class OpenAuthenticationAccessPolicy(msrest.serialization.Model): + """Open authentication access policy defined by user. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Type of provider for OAuth. Default value: "AAD". + :vartype type: str + :param claims: The access policy claims. + :type claims: list[~azure.mgmt.logic.models.OpenAuthenticationPolicyClaim] + """ + + _validation = { + 'type': {'readonly': True, 'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'claims': {'key': 'claims', 'type': '[OpenAuthenticationPolicyClaim]'}, + } + + type = "AAD" + + def __init__( + self, + **kwargs + ): + super(OpenAuthenticationAccessPolicy, self).__init__(**kwargs) + self.type = None + self.claims = kwargs.get('claims', None) + + +class OpenAuthenticationPolicyClaim(msrest.serialization.Model): + """Open authentication policy claim. + + :param name: The name of the claim. + :type name: str + :param value: The value of the claim. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OpenAuthenticationPolicyClaim, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class Operation(msrest.serialization.Model): + """Logic REST API operation. + + :param origin: Operation: origin. + :type origin: str + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.logic.models.OperationDisplay + :param properties: The properties. + :type properties: object + """ + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.origin = kwargs.get('origin', None) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.properties = kwargs.get('properties', None) + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Logic. + :type provider: str + :param resource: Resource on which the operation is performed: Profile, endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Operation: description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list Logic operations. It contains a list of operations and a URL link to get the next set of results. + + :param value: List of Logic operations supported by the Logic resource provider. + :type value: list[~azure.mgmt.logic.models.Operation] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class OperationResultProperties(msrest.serialization.Model): + """The run operation result properties. + + :param start_time: The start time of the workflow scope repetition. + :type start_time: ~datetime.datetime + :param end_time: The end time of the workflow scope repetition. + :type end_time: ~datetime.datetime + :param correlation: The correlation properties. + :type correlation: ~azure.mgmt.logic.models.RunActionCorrelation + :param status: The status of the workflow scope repetition. Possible values include: + "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", + "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :type status: str or ~azure.mgmt.logic.models.WorkflowStatus + :param code: The workflow scope repetition code. + :type code: str + :param error: Any object. + :type error: object + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'correlation': {'key': 'correlation', 'type': 'RunActionCorrelation'}, + 'status': {'key': 'status', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationResultProperties, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.correlation = kwargs.get('correlation', None) + self.status = kwargs.get('status', None) + self.code = kwargs.get('code', None) + self.error = kwargs.get('error', None) + + +class OperationResult(OperationResultProperties): + """The operation result definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param start_time: The start time of the workflow scope repetition. + :type start_time: ~datetime.datetime + :param end_time: The end time of the workflow scope repetition. + :type end_time: ~datetime.datetime + :param correlation: The correlation properties. + :type correlation: ~azure.mgmt.logic.models.RunActionCorrelation + :param status: The status of the workflow scope repetition. Possible values include: + "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", + "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :type status: str or ~azure.mgmt.logic.models.WorkflowStatus + :param code: The workflow scope repetition code. + :type code: str + :param error: Any object. + :type error: object + :ivar tracking_id: Gets the tracking id. + :vartype tracking_id: str + :ivar inputs: Gets the inputs. + :vartype inputs: object + :ivar inputs_link: Gets the link to inputs. + :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar outputs: Gets the outputs. + :vartype outputs: object + :ivar outputs_link: Gets the link to outputs. + :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar tracked_properties: Gets the tracked properties. + :vartype tracked_properties: object + :param retry_history: Gets the retry histories. + :type retry_history: list[~azure.mgmt.logic.models.RetryHistory] + :param iteration_count: + :type iteration_count: int + """ + + _validation = { + 'tracking_id': {'readonly': True}, + 'inputs': {'readonly': True}, + 'inputs_link': {'readonly': True}, + 'outputs': {'readonly': True}, + 'outputs_link': {'readonly': True}, + 'tracked_properties': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'correlation': {'key': 'correlation', 'type': 'RunActionCorrelation'}, + 'status': {'key': 'status', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'object'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': 'object'}, + 'inputs_link': {'key': 'inputsLink', 'type': 'ContentLink'}, + 'outputs': {'key': 'outputs', 'type': 'object'}, + 'outputs_link': {'key': 'outputsLink', 'type': 'ContentLink'}, + 'tracked_properties': {'key': 'trackedProperties', 'type': 'object'}, + 'retry_history': {'key': 'retryHistory', 'type': '[RetryHistory]'}, + 'iteration_count': {'key': 'iterationCount', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationResult, self).__init__(**kwargs) + self.tracking_id = None + self.inputs = None + self.inputs_link = None + self.outputs = None + self.outputs_link = None + self.tracked_properties = None + self.retry_history = kwargs.get('retry_history', None) + self.iteration_count = kwargs.get('iteration_count', None) + + +class PartnerContent(msrest.serialization.Model): + """The integration account partner content. + + :param b2_b: The B2B partner content. + :type b2_b: ~azure.mgmt.logic.models.B2BPartnerContent + """ + + _attribute_map = { + 'b2_b': {'key': 'b2b', 'type': 'B2BPartnerContent'}, + } + + def __init__( + self, + **kwargs + ): + super(PartnerContent, self).__init__(**kwargs) + self.b2_b = kwargs.get('b2_b', None) + + +class RecurrenceSchedule(msrest.serialization.Model): + """The recurrence schedule. + + :param minutes: The minutes. + :type minutes: list[int] + :param hours: The hours. + :type hours: list[int] + :param week_days: The days of the week. + :type week_days: list[str or ~azure.mgmt.logic.models.DaysOfWeek] + :param month_days: The month days. + :type month_days: list[int] + :param monthly_occurrences: The monthly occurrences. + :type monthly_occurrences: list[~azure.mgmt.logic.models.RecurrenceScheduleOccurrence] + """ + + _attribute_map = { + 'minutes': {'key': 'minutes', 'type': '[int]'}, + 'hours': {'key': 'hours', 'type': '[int]'}, + 'week_days': {'key': 'weekDays', 'type': '[str]'}, + 'month_days': {'key': 'monthDays', 'type': '[int]'}, + 'monthly_occurrences': {'key': 'monthlyOccurrences', 'type': '[RecurrenceScheduleOccurrence]'}, + } + + def __init__( + self, + **kwargs + ): + super(RecurrenceSchedule, self).__init__(**kwargs) + self.minutes = kwargs.get('minutes', None) + self.hours = kwargs.get('hours', None) + self.week_days = kwargs.get('week_days', None) + self.month_days = kwargs.get('month_days', None) + self.monthly_occurrences = kwargs.get('monthly_occurrences', None) + + +class RecurrenceScheduleOccurrence(msrest.serialization.Model): + """The recurrence schedule occurrence. + + :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :type day: str or ~azure.mgmt.logic.models.DayOfWeek + :param occurrence: The occurrence. + :type occurrence: int + """ + + _attribute_map = { + 'day': {'key': 'day', 'type': 'str'}, + 'occurrence': {'key': 'occurrence', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RecurrenceScheduleOccurrence, self).__init__(**kwargs) + self.day = kwargs.get('day', None) + self.occurrence = kwargs.get('occurrence', None) + + +class RegenerateActionParameter(msrest.serialization.Model): + """The access key regenerate action content. + + :param key_type: The key type. Possible values include: "NotSpecified", "Primary", "Secondary". + :type key_type: str or ~azure.mgmt.logic.models.KeyType + """ + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RegenerateActionParameter, self).__init__(**kwargs) + self.key_type = kwargs.get('key_type', None) + + +class RepetitionIndex(msrest.serialization.Model): + """The workflow run action repetition index. + + All required parameters must be populated in order to send to Azure. + + :param scope_name: The scope. + :type scope_name: str + :param item_index: Required. The index. + :type item_index: int + """ + + _validation = { + 'item_index': {'required': True}, + } + + _attribute_map = { + 'scope_name': {'key': 'scopeName', 'type': 'str'}, + 'item_index': {'key': 'itemIndex', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(RepetitionIndex, self).__init__(**kwargs) + self.scope_name = kwargs.get('scope_name', None) + self.item_index = kwargs['item_index'] + + +class Request(msrest.serialization.Model): + """A request. + + :param headers: A list of all the headers attached to the request. + :type headers: object + :param uri: The destination for the request. + :type uri: str + :param method: The HTTP method used for the request. + :type method: str + """ + + _attribute_map = { + 'headers': {'key': 'headers', 'type': 'object'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Request, self).__init__(**kwargs) + self.headers = kwargs.get('headers', None) + self.uri = kwargs.get('uri', None) + self.method = kwargs.get('method', None) + + +class RequestHistory(Resource): + """The request history. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param properties: The request history properties. + :type properties: ~azure.mgmt.logic.models.RequestHistoryProperties + """ + + _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}'}, + 'properties': {'key': 'properties', 'type': 'RequestHistoryProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(RequestHistory, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class RequestHistoryListResult(msrest.serialization.Model): + """The list of workflow request histories. + + :param value: A list of workflow request histories. + :type value: list[~azure.mgmt.logic.models.RequestHistory] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RequestHistory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RequestHistoryListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class RequestHistoryProperties(msrest.serialization.Model): + """The request history. + + :param start_time: The time the request started. + :type start_time: ~datetime.datetime + :param end_time: The time the request ended. + :type end_time: ~datetime.datetime + :param request: The request. + :type request: ~azure.mgmt.logic.models.Request + :param response: The response. + :type response: ~azure.mgmt.logic.models.Response + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'request': {'key': 'request', 'type': 'Request'}, + 'response': {'key': 'response', 'type': 'Response'}, + } + + def __init__( + self, + **kwargs + ): + super(RequestHistoryProperties, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.request = kwargs.get('request', None) + self.response = kwargs.get('response', None) + + +class Response(msrest.serialization.Model): + """A response. + + :param headers: A list of all the headers attached to the response. + :type headers: object + :param status_code: The status code of the response. + :type status_code: int + :param body_link: Details on the location of the body content. + :type body_link: ~azure.mgmt.logic.models.ContentLink + """ + + _attribute_map = { + 'headers': {'key': 'headers', 'type': 'object'}, + 'status_code': {'key': 'statusCode', 'type': 'int'}, + 'body_link': {'key': 'bodyLink', 'type': 'ContentLink'}, + } + + def __init__( + self, + **kwargs + ): + super(Response, self).__init__(**kwargs) + self.headers = kwargs.get('headers', None) + self.status_code = kwargs.get('status_code', None) + self.body_link = kwargs.get('body_link', None) + + +class RetryHistory(msrest.serialization.Model): + """The retry history. + + :param start_time: Gets the start time. + :type start_time: ~datetime.datetime + :param end_time: Gets the end time. + :type end_time: ~datetime.datetime + :param code: Gets the status code. + :type code: str + :param client_request_id: Gets the client request Id. + :type client_request_id: str + :param service_request_id: Gets the service request Id. + :type service_request_id: str + :param error: Gets the error response. + :type error: ~azure.mgmt.logic.models.ErrorResponse + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'code': {'key': 'code', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'service_request_id': {'key': 'serviceRequestId', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__( + self, + **kwargs + ): + super(RetryHistory, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.code = kwargs.get('code', None) + self.client_request_id = kwargs.get('client_request_id', None) + self.service_request_id = kwargs.get('service_request_id', None) + self.error = kwargs.get('error', None) + + +class RunCorrelation(msrest.serialization.Model): + """The correlation properties. + + :param client_tracking_id: The client tracking identifier. + :type client_tracking_id: str + :param client_keywords: The client keywords. + :type client_keywords: list[str] + """ + + _attribute_map = { + 'client_tracking_id': {'key': 'clientTrackingId', 'type': 'str'}, + 'client_keywords': {'key': 'clientKeywords', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(RunCorrelation, self).__init__(**kwargs) + self.client_tracking_id = kwargs.get('client_tracking_id', None) + self.client_keywords = kwargs.get('client_keywords', None) + + +class RunActionCorrelation(RunCorrelation): + """The workflow run action correlation properties. + + :param client_tracking_id: The client tracking identifier. + :type client_tracking_id: str + :param client_keywords: The client keywords. + :type client_keywords: list[str] + :param action_tracking_id: The action tracking identifier. + :type action_tracking_id: str + """ + + _attribute_map = { + 'client_tracking_id': {'key': 'clientTrackingId', 'type': 'str'}, + 'client_keywords': {'key': 'clientKeywords', 'type': '[str]'}, + 'action_tracking_id': {'key': 'actionTrackingId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RunActionCorrelation, self).__init__(**kwargs) + self.action_tracking_id = kwargs.get('action_tracking_id', None) + + +class SetTriggerStateActionDefinition(msrest.serialization.Model): + """The set trigger state action definition. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source. + :type source: ~azure.mgmt.logic.models.WorkflowTriggerReference + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'WorkflowTriggerReference'}, + } + + def __init__( + self, + **kwargs + ): + super(SetTriggerStateActionDefinition, self).__init__(**kwargs) + self.source = kwargs['source'] + + +class Sku(msrest.serialization.Model): + """The sku type. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name. Possible values include: "NotSpecified", "Free", "Shared", + "Basic", "Standard", "Premium". + :type name: str or ~azure.mgmt.logic.models.SkuName + :param plan: The reference to plan. + :type plan: ~azure.mgmt.logic.models.ResourceReference + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'plan': {'key': 'plan', 'type': 'ResourceReference'}, + } + + def __init__( + self, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = kwargs['name'] + self.plan = kwargs.get('plan', None) + + +class SubResource(msrest.serialization.Model): + """The sub resource type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubResource, self).__init__(**kwargs) + self.id = None + + +class SwaggerCustomDynamicList(msrest.serialization.Model): + """The swagger custom dynamic list. + + :param operation_id: The operation id to fetch dynamic schema. + :type operation_id: str + :param built_in_operation: The built in operation. + :type built_in_operation: str + :param items_path: The path to a response property (relative to the response object, not the + response body) which contains an array of dynamic value items. + :type items_path: str + :param item_value_path: The path to a property which defines the value which should be used. + :type item_value_path: str + :param item_title_path: The path to an item property which defines the display name of the + item. + :type item_title_path: str + :param parameters: The parameters. + :type parameters: dict[str, ~azure.mgmt.logic.models.SwaggerCustomDynamicProperties] + """ + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'built_in_operation': {'key': 'builtInOperation', 'type': 'str'}, + 'items_path': {'key': 'itemsPath', 'type': 'str'}, + 'item_value_path': {'key': 'itemValuePath', 'type': 'str'}, + 'item_title_path': {'key': 'itemTitlePath', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{SwaggerCustomDynamicProperties}'}, + } + + def __init__( + self, + **kwargs + ): + super(SwaggerCustomDynamicList, self).__init__(**kwargs) + self.operation_id = kwargs.get('operation_id', None) + self.built_in_operation = kwargs.get('built_in_operation', None) + self.items_path = kwargs.get('items_path', None) + self.item_value_path = kwargs.get('item_value_path', None) + self.item_title_path = kwargs.get('item_title_path', None) + self.parameters = kwargs.get('parameters', None) + + +class SwaggerCustomDynamicProperties(msrest.serialization.Model): + """The swagger custom dynamic properties. + + :param operation_id: The operation id to fetch dynamic schema. + :type operation_id: str + :param value_path: Json pointer to the dynamic schema on the response body. + :type value_path: str + :param parameters: The operation parameters. + :type parameters: dict[str, ~azure.mgmt.logic.models.SwaggerCustomDynamicProperties] + """ + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'value_path': {'key': 'valuePath', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{SwaggerCustomDynamicProperties}'}, + } + + def __init__( + self, + **kwargs + ): + super(SwaggerCustomDynamicProperties, self).__init__(**kwargs) + self.operation_id = kwargs.get('operation_id', None) + self.value_path = kwargs.get('value_path', None) + self.parameters = kwargs.get('parameters', None) + + +class SwaggerCustomDynamicSchema(msrest.serialization.Model): + """The swagger custom dynamic schema. + + :param operation_id: The operation id to fetch dynamic schema. + :type operation_id: str + :param value_path: Json pointer to the dynamic schema on the response body. + :type value_path: str + :param parameters: The operation parameters. + :type parameters: dict[str, object] + """ + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'value_path': {'key': 'valuePath', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(SwaggerCustomDynamicSchema, self).__init__(**kwargs) + self.operation_id = kwargs.get('operation_id', None) + self.value_path = kwargs.get('value_path', None) + self.parameters = kwargs.get('parameters', None) + + +class SwaggerCustomDynamicTree(msrest.serialization.Model): + """The swagger custom dynamic tree. + + :param settings: The tree settings. + :type settings: ~azure.mgmt.logic.models.SwaggerCustomDynamicTreeSettings + :param open: The tree on-open configuration. + :type open: ~azure.mgmt.logic.models.SwaggerCustomDynamicTreeCommand + :param browse: The tree on-browse configuration. + :type browse: ~azure.mgmt.logic.models.SwaggerCustomDynamicTreeCommand + """ + + _attribute_map = { + 'settings': {'key': 'settings', 'type': 'SwaggerCustomDynamicTreeSettings'}, + 'open': {'key': 'open', 'type': 'SwaggerCustomDynamicTreeCommand'}, + 'browse': {'key': 'browse', 'type': 'SwaggerCustomDynamicTreeCommand'}, + } + + def __init__( + self, + **kwargs + ): + super(SwaggerCustomDynamicTree, self).__init__(**kwargs) + self.settings = kwargs.get('settings', None) + self.open = kwargs.get('open', None) + self.browse = kwargs.get('browse', None) + + +class SwaggerCustomDynamicTreeCommand(msrest.serialization.Model): + """The swagger tree command. + + :param operation_id: The path to an item property which defines the display name of the item. + :type operation_id: str + :param items_path: The path to an item property which defines the display name of the item. + :type items_path: str + :param item_value_path: The path to an item property which defines the display name of the + item. + :type item_value_path: str + :param item_title_path: The path to an item property which defines the display name of the + item. + :type item_title_path: str + :param item_full_title_path: The path to an item property which defines the display name of the + item. + :type item_full_title_path: str + :param item_is_parent: The path to an item property which defines the display name of the item. + :type item_is_parent: str + :param selectable_filter: The path to an item property which defines the display name of the + item. + :type selectable_filter: str + :param parameters: Dictionary of :code:``. + :type parameters: dict[str, ~azure.mgmt.logic.models.SwaggerCustomDynamicTreeParameter] + """ + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'items_path': {'key': 'itemsPath', 'type': 'str'}, + 'item_value_path': {'key': 'itemValuePath', 'type': 'str'}, + 'item_title_path': {'key': 'itemTitlePath', 'type': 'str'}, + 'item_full_title_path': {'key': 'itemFullTitlePath', 'type': 'str'}, + 'item_is_parent': {'key': 'itemIsParent', 'type': 'str'}, + 'selectable_filter': {'key': 'selectableFilter', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{SwaggerCustomDynamicTreeParameter}'}, + } + + def __init__( + self, + **kwargs + ): + super(SwaggerCustomDynamicTreeCommand, self).__init__(**kwargs) + self.operation_id = kwargs.get('operation_id', None) + self.items_path = kwargs.get('items_path', None) + self.item_value_path = kwargs.get('item_value_path', None) + self.item_title_path = kwargs.get('item_title_path', None) + self.item_full_title_path = kwargs.get('item_full_title_path', None) + self.item_is_parent = kwargs.get('item_is_parent', None) + self.selectable_filter = kwargs.get('selectable_filter', None) + self.parameters = kwargs.get('parameters', None) + + +class SwaggerCustomDynamicTreeParameter(msrest.serialization.Model): + """The swagger custom dynamic tree parameter. + + :param selected_item_value_path: Gets or sets a path to a property in the currently selected + item to pass as a value to a parameter for the given operation. + :type selected_item_value_path: str + :param value: The parameter value. + :type value: object + :param parameter_reference: The parameter reference. + :type parameter_reference: str + :param required: Indicates whether the parameter is required. + :type required: bool + """ + + _attribute_map = { + 'selected_item_value_path': {'key': 'selectedItemValuePath', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'parameter_reference': {'key': 'parameterReference', 'type': 'str'}, + 'required': {'key': 'required', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(SwaggerCustomDynamicTreeParameter, self).__init__(**kwargs) + self.selected_item_value_path = kwargs.get('selected_item_value_path', None) + self.value = kwargs.get('value', None) + self.parameter_reference = kwargs.get('parameter_reference', None) + self.required = kwargs.get('required', None) + + +class SwaggerCustomDynamicTreeSettings(msrest.serialization.Model): + """The swagger custom dynamic tree settings. + + :param can_select_parent_nodes: Indicates whether parent nodes can be selected. + :type can_select_parent_nodes: bool + :param can_select_leaf_nodes: Indicates whether leaf nodes can be selected. + :type can_select_leaf_nodes: bool + """ + + _attribute_map = { + 'can_select_parent_nodes': {'key': 'CanSelectParentNodes', 'type': 'bool'}, + 'can_select_leaf_nodes': {'key': 'CanSelectLeafNodes', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(SwaggerCustomDynamicTreeSettings, self).__init__(**kwargs) + self.can_select_parent_nodes = kwargs.get('can_select_parent_nodes', None) + self.can_select_leaf_nodes = kwargs.get('can_select_leaf_nodes', None) + + +class SwaggerExternalDocumentation(msrest.serialization.Model): + """The swagger external documentation. + + :param description: The document description. + :type description: str + :param uri: The documentation Uri. + :type uri: str + :param extensions: The vendor extensions. + :type extensions: dict[str, object] + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'extensions': {'key': 'extensions', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(SwaggerExternalDocumentation, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.uri = kwargs.get('uri', None) + self.extensions = kwargs.get('extensions', None) + + +class SwaggerSchema(msrest.serialization.Model): + """The swagger schema. + + :param ref: The reference. + :type ref: str + :param type: The type. Possible values include: "String", "Number", "Integer", "Boolean", + "Array", "File", "Object", "Null". + :type type: str or ~azure.mgmt.logic.models.SwaggerSchemaType + :param title: The title. + :type title: str + :param items: The items schema. + :type items: ~azure.mgmt.logic.models.SwaggerSchema + :param properties: The object properties. + :type properties: dict[str, ~azure.mgmt.logic.models.SwaggerSchema] + :param additional_properties: The additional properties. + :type additional_properties: object + :param required: The object required properties. + :type required: list[str] + :param max_properties: The maximum number of allowed properties. + :type max_properties: int + :param min_properties: The minimum number of allowed properties. + :type min_properties: int + :param all_of: The schemas which must pass validation when this schema is used. + :type all_of: list[~azure.mgmt.logic.models.SwaggerSchema] + :param discriminator: The discriminator. + :type discriminator: str + :param read_only: Indicates whether this property must be present in the a request. + :type read_only: bool + :param xml: The xml representation format for a property. + :type xml: ~azure.mgmt.logic.models.SwaggerXml + :param external_docs: The external documentation. + :type external_docs: ~azure.mgmt.logic.models.SwaggerExternalDocumentation + :param example: The example value. + :type example: object + :param notification_url_extension: Indicates the notification url extension. If this is set, + the property's value should be a callback url for a webhook. + :type notification_url_extension: bool + :param dynamic_schema_old: The dynamic schema configuration. + :type dynamic_schema_old: ~azure.mgmt.logic.models.SwaggerCustomDynamicSchema + :param dynamic_schema_new: The dynamic schema configuration. + :type dynamic_schema_new: ~azure.mgmt.logic.models.SwaggerCustomDynamicProperties + :param dynamic_list_new: The dynamic list. + :type dynamic_list_new: ~azure.mgmt.logic.models.SwaggerCustomDynamicList + :param dynamic_tree: The dynamic values tree configuration. + :type dynamic_tree: ~azure.mgmt.logic.models.SwaggerCustomDynamicTree + """ + + _attribute_map = { + 'ref': {'key': 'ref', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'items': {'key': 'items', 'type': 'SwaggerSchema'}, + 'properties': {'key': 'properties', 'type': '{SwaggerSchema}'}, + 'additional_properties': {'key': 'additionalProperties', 'type': 'object'}, + 'required': {'key': 'required', 'type': '[str]'}, + 'max_properties': {'key': 'maxProperties', 'type': 'int'}, + 'min_properties': {'key': 'minProperties', 'type': 'int'}, + 'all_of': {'key': 'allOf', 'type': '[SwaggerSchema]'}, + 'discriminator': {'key': 'discriminator', 'type': 'str'}, + 'read_only': {'key': 'readOnly', 'type': 'bool'}, + 'xml': {'key': 'xml', 'type': 'SwaggerXml'}, + 'external_docs': {'key': 'externalDocs', 'type': 'SwaggerExternalDocumentation'}, + 'example': {'key': 'example', 'type': 'object'}, + 'notification_url_extension': {'key': 'notificationUrlExtension', 'type': 'bool'}, + 'dynamic_schema_old': {'key': 'dynamicSchemaOld', 'type': 'SwaggerCustomDynamicSchema'}, + 'dynamic_schema_new': {'key': 'dynamicSchemaNew', 'type': 'SwaggerCustomDynamicProperties'}, + 'dynamic_list_new': {'key': 'dynamicListNew', 'type': 'SwaggerCustomDynamicList'}, + 'dynamic_tree': {'key': 'dynamicTree', 'type': 'SwaggerCustomDynamicTree'}, + } + + def __init__( + self, + **kwargs + ): + super(SwaggerSchema, self).__init__(**kwargs) + self.ref = kwargs.get('ref', None) + self.type = kwargs.get('type', None) + self.title = kwargs.get('title', None) + self.items = kwargs.get('items', None) + self.properties = kwargs.get('properties', None) + self.additional_properties = kwargs.get('additional_properties', None) + self.required = kwargs.get('required', None) + self.max_properties = kwargs.get('max_properties', None) + self.min_properties = kwargs.get('min_properties', None) + self.all_of = kwargs.get('all_of', None) + self.discriminator = kwargs.get('discriminator', None) + self.read_only = kwargs.get('read_only', None) + self.xml = kwargs.get('xml', None) + self.external_docs = kwargs.get('external_docs', None) + self.example = kwargs.get('example', None) + self.notification_url_extension = kwargs.get('notification_url_extension', None) + self.dynamic_schema_old = kwargs.get('dynamic_schema_old', None) + self.dynamic_schema_new = kwargs.get('dynamic_schema_new', None) + self.dynamic_list_new = kwargs.get('dynamic_list_new', None) + self.dynamic_tree = kwargs.get('dynamic_tree', None) + + +class SwaggerXml(msrest.serialization.Model): + """The Swagger XML. + + :param name: The xml element or attribute name. + :type name: str + :param namespace: The xml namespace. + :type namespace: str + :param prefix: The name prefix. + :type prefix: str + :param attribute: Indicates whether the property should be an attribute instead of an element. + :type attribute: bool + :param wrapped: Indicates whether the array elements are wrapped in a container element. + :type wrapped: bool + :param extensions: The vendor extensions. + :type extensions: dict[str, object] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'prefix': {'key': 'prefix', 'type': 'str'}, + 'attribute': {'key': 'attribute', 'type': 'bool'}, + 'wrapped': {'key': 'wrapped', 'type': 'bool'}, + 'extensions': {'key': 'extensions', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(SwaggerXml, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.namespace = kwargs.get('namespace', None) + self.prefix = kwargs.get('prefix', None) + self.attribute = kwargs.get('attribute', None) + self.wrapped = kwargs.get('wrapped', None) + self.extensions = kwargs.get('extensions', None) + + +class TrackingEvent(msrest.serialization.Model): + """The tracking event. + + All required parameters must be populated in order to send to Azure. + + :param event_level: Required. The event level. Possible values include: "LogAlways", + "Critical", "Error", "Warning", "Informational", "Verbose". + :type event_level: str or ~azure.mgmt.logic.models.EventLevel + :param event_time: Required. The event time. + :type event_time: ~datetime.datetime + :param record_type: Required. The record type. Possible values include: "NotSpecified", + "Custom", "AS2Message", "AS2MDN", "X12Interchange", "X12FunctionalGroup", "X12TransactionSet", + "X12InterchangeAcknowledgment", "X12FunctionalGroupAcknowledgment", + "X12TransactionSetAcknowledgment", "EdifactInterchange", "EdifactFunctionalGroup", + "EdifactTransactionSet", "EdifactInterchangeAcknowledgment", + "EdifactFunctionalGroupAcknowledgment", "EdifactTransactionSetAcknowledgment". + :type record_type: str or ~azure.mgmt.logic.models.TrackingRecordType + :param record: The record. + :type record: object + :param error: The error. + :type error: ~azure.mgmt.logic.models.TrackingEventErrorInfo + """ + + _validation = { + 'event_level': {'required': True}, + 'event_time': {'required': True}, + 'record_type': {'required': True}, + } + + _attribute_map = { + 'event_level': {'key': 'eventLevel', 'type': 'str'}, + 'event_time': {'key': 'eventTime', 'type': 'iso-8601'}, + 'record_type': {'key': 'recordType', 'type': 'str'}, + 'record': {'key': 'record', 'type': 'object'}, + 'error': {'key': 'error', 'type': 'TrackingEventErrorInfo'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackingEvent, self).__init__(**kwargs) + self.event_level = kwargs['event_level'] + self.event_time = kwargs['event_time'] + self.record_type = kwargs['record_type'] + self.record = kwargs.get('record', None) + self.error = kwargs.get('error', None) + + +class TrackingEventErrorInfo(msrest.serialization.Model): + """The tracking event error info. + + :param message: The message. + :type message: str + :param code: The code. + :type code: str + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackingEventErrorInfo, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.code = kwargs.get('code', None) + + +class TrackingEventsDefinition(msrest.serialization.Model): + """The tracking events definition. + + All required parameters must be populated in order to send to Azure. + + :param source_type: Required. The source type. + :type source_type: str + :param track_events_options: The track events options. Possible values include: "None", + "DisableSourceInfoEnrich". + :type track_events_options: str or ~azure.mgmt.logic.models.TrackEventsOperationOptions + :param events: Required. The events. + :type events: list[~azure.mgmt.logic.models.TrackingEvent] + """ + + _validation = { + 'source_type': {'required': True}, + 'events': {'required': True}, + } + + _attribute_map = { + 'source_type': {'key': 'sourceType', 'type': 'str'}, + 'track_events_options': {'key': 'trackEventsOptions', 'type': 'str'}, + 'events': {'key': 'events', 'type': '[TrackingEvent]'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackingEventsDefinition, self).__init__(**kwargs) + self.source_type = kwargs['source_type'] + self.track_events_options = kwargs.get('track_events_options', None) + self.events = kwargs['events'] + + +class Workflow(Resource): + """The workflow type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :ivar provisioning_state: Gets the provisioning state. Possible values include: "NotSpecified", + "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", + "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :vartype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState + :ivar created_time: Gets the created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: Gets the changed time. + :vartype changed_time: ~datetime.datetime + :param state: The state. Possible values include: "NotSpecified", "Completed", "Enabled", + "Disabled", "Deleted", "Suspended". + :type state: str or ~azure.mgmt.logic.models.WorkflowState + :ivar version: Gets the version. + :vartype version: str + :ivar access_endpoint: Gets the access endpoint. + :vartype access_endpoint: str + :param endpoints_configuration: The endpoints configuration. + :type endpoints_configuration: ~azure.mgmt.logic.models.FlowEndpointsConfiguration + :param access_control: The access control configuration. + :type access_control: ~azure.mgmt.logic.models.FlowAccessControlConfiguration + :ivar sku: The sku. + :vartype sku: ~azure.mgmt.logic.models.Sku + :param integration_account: The integration account. + :type integration_account: ~azure.mgmt.logic.models.ResourceReference + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~azure.mgmt.logic.models.ResourceReference + :param definition: The definition. + :type definition: object + :param parameters: The parameters. + :type parameters: dict[str, ~azure.mgmt.logic.models.WorkflowParameter] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'version': {'readonly': True}, + 'access_endpoint': {'readonly': True}, + 'sku': {'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}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'access_endpoint': {'key': 'properties.accessEndpoint', 'type': 'str'}, + 'endpoints_configuration': {'key': 'properties.endpointsConfiguration', 'type': 'FlowEndpointsConfiguration'}, + 'access_control': {'key': 'properties.accessControl', 'type': 'FlowAccessControlConfiguration'}, + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'integration_account': {'key': 'properties.integrationAccount', 'type': 'ResourceReference'}, + 'integration_service_environment': {'key': 'properties.integrationServiceEnvironment', 'type': 'ResourceReference'}, + 'definition': {'key': 'properties.definition', 'type': 'object'}, + 'parameters': {'key': 'properties.parameters', 'type': '{WorkflowParameter}'}, + } + + def __init__( + self, + **kwargs + ): + super(Workflow, self).__init__(**kwargs) + self.provisioning_state = None + self.created_time = None + self.changed_time = None + self.state = kwargs.get('state', None) + self.version = None + self.access_endpoint = None + self.endpoints_configuration = kwargs.get('endpoints_configuration', None) + self.access_control = kwargs.get('access_control', None) + self.sku = None + self.integration_account = kwargs.get('integration_account', None) + self.integration_service_environment = kwargs.get('integration_service_environment', None) + self.definition = kwargs.get('definition', None) + self.parameters = kwargs.get('parameters', None) + + +class WorkflowFilter(msrest.serialization.Model): + """The workflow filter. + + :param state: The state of workflows. Possible values include: "NotSpecified", "Completed", + "Enabled", "Disabled", "Deleted", "Suspended". + :type state: str or ~azure.mgmt.logic.models.WorkflowState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowFilter, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + + +class WorkflowListResult(msrest.serialization.Model): + """The list of workflows. + + :param value: The list of workflows. + :type value: list[~azure.mgmt.logic.models.Workflow] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Workflow]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class WorkflowParameter(msrest.serialization.Model): + """The workflow parameters. + + :param type: The type. Possible values include: "NotSpecified", "String", "SecureString", + "Int", "Float", "Bool", "Array", "Object", "SecureObject". + :type type: str or ~azure.mgmt.logic.models.ParameterType + :param value: The value. + :type value: object + :param metadata: The metadata. + :type metadata: object + :param description: The description. + :type description: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowParameter, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.value = kwargs.get('value', None) + self.metadata = kwargs.get('metadata', None) + self.description = kwargs.get('description', None) + + +class WorkflowOutputParameter(WorkflowParameter): + """The workflow output parameter. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: The type. Possible values include: "NotSpecified", "String", "SecureString", + "Int", "Float", "Bool", "Array", "Object", "SecureObject". + :type type: str or ~azure.mgmt.logic.models.ParameterType + :param value: The value. + :type value: object + :param metadata: The metadata. + :type metadata: object + :param description: The description. + :type description: str + :ivar error: Gets the error. + :vartype error: object + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + 'description': {'key': 'description', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowOutputParameter, self).__init__(**kwargs) + self.error = None + + +class WorkflowReference(ResourceReference): + """The workflow reference. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The resource id. + :type id: str + :ivar type: Gets the resource type. + :vartype type: str + :param name: The workflow name. + :type name: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowReference, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class WorkflowRun(SubResource): + """The workflow run. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the workflow run name. + :vartype name: str + :ivar type: Gets the workflow run type. + :vartype type: str + :ivar wait_end_time: Gets the wait end time. + :vartype wait_end_time: ~datetime.datetime + :ivar start_time: Gets the start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: Gets the end time. + :vartype end_time: ~datetime.datetime + :ivar status: Gets the status. Possible values include: "NotSpecified", "Paused", "Running", + "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", + "Aborted", "Ignored". + :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus + :ivar code: Gets the code. + :vartype code: str + :ivar error: Gets the error. + :vartype error: object + :ivar correlation_id: Gets the correlation id. + :vartype correlation_id: str + :param correlation: The run correlation. + :type correlation: ~azure.mgmt.logic.models.Correlation + :ivar workflow: Gets the reference to workflow version. + :vartype workflow: ~azure.mgmt.logic.models.ResourceReference + :ivar trigger: Gets the fired trigger. + :vartype trigger: ~azure.mgmt.logic.models.WorkflowRunTrigger + :ivar outputs: Gets the outputs. + :vartype outputs: dict[str, ~azure.mgmt.logic.models.WorkflowOutputParameter] + :ivar response: Gets the response of the flow run. + :vartype response: ~azure.mgmt.logic.models.WorkflowRunTrigger + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'wait_end_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'status': {'readonly': True}, + 'code': {'readonly': True}, + 'error': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'workflow': {'readonly': True}, + 'trigger': {'readonly': True}, + 'outputs': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'wait_end_time': {'key': 'properties.waitEndTime', 'type': 'iso-8601'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'code': {'key': 'properties.code', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'object'}, + 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, + 'correlation': {'key': 'properties.correlation', 'type': 'Correlation'}, + 'workflow': {'key': 'properties.workflow', 'type': 'ResourceReference'}, + 'trigger': {'key': 'properties.trigger', 'type': 'WorkflowRunTrigger'}, + 'outputs': {'key': 'properties.outputs', 'type': '{WorkflowOutputParameter}'}, + 'response': {'key': 'properties.response', 'type': 'WorkflowRunTrigger'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowRun, self).__init__(**kwargs) + self.name = None + self.type = None + self.wait_end_time = None + self.start_time = None + self.end_time = None + self.status = None + self.code = None + self.error = None + self.correlation_id = None + self.correlation = kwargs.get('correlation', None) + self.workflow = None + self.trigger = None + self.outputs = None + self.response = None + + +class WorkflowRunAction(SubResource): + """The workflow run action. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the workflow run action name. + :vartype name: str + :ivar type: Gets the workflow run action type. + :vartype type: str + :ivar start_time: Gets the start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: Gets the end time. + :vartype end_time: ~datetime.datetime + :ivar status: Gets the status. Possible values include: "NotSpecified", "Paused", "Running", + "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", + "Aborted", "Ignored". + :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus + :ivar code: Gets the code. + :vartype code: str + :ivar error: Gets the error. + :vartype error: object + :ivar tracking_id: Gets the tracking id. + :vartype tracking_id: str + :param correlation: The correlation properties. + :type correlation: ~azure.mgmt.logic.models.RunActionCorrelation + :ivar inputs_link: Gets the link to inputs. + :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar outputs_link: Gets the link to outputs. + :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar tracked_properties: Gets the tracked properties. + :vartype tracked_properties: object + :param retry_history: Gets the retry histories. + :type retry_history: list[~azure.mgmt.logic.models.RetryHistory] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'status': {'readonly': True}, + 'code': {'readonly': True}, + 'error': {'readonly': True}, + 'tracking_id': {'readonly': True}, + 'inputs_link': {'readonly': True}, + 'outputs_link': {'readonly': True}, + 'tracked_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'code': {'key': 'properties.code', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'object'}, + 'tracking_id': {'key': 'properties.trackingId', 'type': 'str'}, + 'correlation': {'key': 'properties.correlation', 'type': 'RunActionCorrelation'}, + 'inputs_link': {'key': 'properties.inputsLink', 'type': 'ContentLink'}, + 'outputs_link': {'key': 'properties.outputsLink', 'type': 'ContentLink'}, + 'tracked_properties': {'key': 'properties.trackedProperties', 'type': 'object'}, + 'retry_history': {'key': 'properties.retryHistory', 'type': '[RetryHistory]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowRunAction, self).__init__(**kwargs) + self.name = None + self.type = None + self.start_time = None + self.end_time = None + self.status = None + self.code = None + self.error = None + self.tracking_id = None + self.correlation = kwargs.get('correlation', None) + self.inputs_link = None + self.outputs_link = None + self.tracked_properties = None + self.retry_history = kwargs.get('retry_history', None) + + +class WorkflowRunActionFilter(msrest.serialization.Model): + """The workflow run action filter. + + :param status: The status of workflow run action. Possible values include: "NotSpecified", + "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", + "Faulted", "TimedOut", "Aborted", "Ignored". + :type status: str or ~azure.mgmt.logic.models.WorkflowStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowRunActionFilter, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + + +class WorkflowRunActionListResult(msrest.serialization.Model): + """The list of workflow run actions. + + :param value: A list of workflow run actions. + :type value: list[~azure.mgmt.logic.models.WorkflowRunAction] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkflowRunAction]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowRunActionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class WorkflowRunActionRepetitionDefinition(Resource): + """The workflow run action repetition definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param start_time: The start time of the workflow scope repetition. + :type start_time: ~datetime.datetime + :param end_time: The end time of the workflow scope repetition. + :type end_time: ~datetime.datetime + :param correlation: The correlation properties. + :type correlation: ~azure.mgmt.logic.models.RunActionCorrelation + :param status: The status of the workflow scope repetition. Possible values include: + "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", + "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :type status: str or ~azure.mgmt.logic.models.WorkflowStatus + :param code: The workflow scope repetition code. + :type code: str + :param error: Any object. + :type error: object + :ivar tracking_id: Gets the tracking id. + :vartype tracking_id: str + :ivar inputs: Gets the inputs. + :vartype inputs: object + :ivar inputs_link: Gets the link to inputs. + :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar outputs: Gets the outputs. + :vartype outputs: object + :ivar outputs_link: Gets the link to outputs. + :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar tracked_properties: Gets the tracked properties. + :vartype tracked_properties: object + :param retry_history: Gets the retry histories. + :type retry_history: list[~azure.mgmt.logic.models.RetryHistory] + :param iteration_count: + :type iteration_count: int + :param repetition_indexes: The repetition indexes. + :type repetition_indexes: list[~azure.mgmt.logic.models.RepetitionIndex] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tracking_id': {'readonly': True}, + 'inputs': {'readonly': True}, + 'inputs_link': {'readonly': True}, + 'outputs': {'readonly': True}, + 'outputs_link': {'readonly': True}, + 'tracked_properties': {'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}'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'correlation': {'key': 'properties.correlation', 'type': 'RunActionCorrelation'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'code': {'key': 'properties.code', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'object'}, + 'tracking_id': {'key': 'properties.trackingId', 'type': 'str'}, + 'inputs': {'key': 'properties.inputs', 'type': 'object'}, + 'inputs_link': {'key': 'properties.inputsLink', 'type': 'ContentLink'}, + 'outputs': {'key': 'properties.outputs', 'type': 'object'}, + 'outputs_link': {'key': 'properties.outputsLink', 'type': 'ContentLink'}, + 'tracked_properties': {'key': 'properties.trackedProperties', 'type': 'object'}, + 'retry_history': {'key': 'properties.retryHistory', 'type': '[RetryHistory]'}, + 'iteration_count': {'key': 'properties.iterationCount', 'type': 'int'}, + 'repetition_indexes': {'key': 'properties.repetitionIndexes', 'type': '[RepetitionIndex]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowRunActionRepetitionDefinition, self).__init__(**kwargs) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.correlation = kwargs.get('correlation', None) + self.status = kwargs.get('status', None) + self.code = kwargs.get('code', None) + self.error = kwargs.get('error', None) + self.tracking_id = None + self.inputs = None + self.inputs_link = None + self.outputs = None + self.outputs_link = None + self.tracked_properties = None + self.retry_history = kwargs.get('retry_history', None) + self.iteration_count = kwargs.get('iteration_count', None) + self.repetition_indexes = kwargs.get('repetition_indexes', None) + + +class WorkflowRunActionRepetitionDefinitionCollection(msrest.serialization.Model): + """A collection of workflow run action repetitions. + + :param next_link: The link used to get the next page of recommendations. + :type next_link: str + :param value: + :type value: list[~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinition] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[WorkflowRunActionRepetitionDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowRunActionRepetitionDefinitionCollection, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = kwargs.get('value', None) + + +class WorkflowRunActionRepetitionProperties(OperationResult): + """The workflow run action repetition properties definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param start_time: The start time of the workflow scope repetition. + :type start_time: ~datetime.datetime + :param end_time: The end time of the workflow scope repetition. + :type end_time: ~datetime.datetime + :param correlation: The correlation properties. + :type correlation: ~azure.mgmt.logic.models.RunActionCorrelation + :param status: The status of the workflow scope repetition. Possible values include: + "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", + "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :type status: str or ~azure.mgmt.logic.models.WorkflowStatus + :param code: The workflow scope repetition code. + :type code: str + :param error: Any object. + :type error: object + :ivar tracking_id: Gets the tracking id. + :vartype tracking_id: str + :ivar inputs: Gets the inputs. + :vartype inputs: object + :ivar inputs_link: Gets the link to inputs. + :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar outputs: Gets the outputs. + :vartype outputs: object + :ivar outputs_link: Gets the link to outputs. + :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar tracked_properties: Gets the tracked properties. + :vartype tracked_properties: object + :param retry_history: Gets the retry histories. + :type retry_history: list[~azure.mgmt.logic.models.RetryHistory] + :param iteration_count: + :type iteration_count: int + :param repetition_indexes: The repetition indexes. + :type repetition_indexes: list[~azure.mgmt.logic.models.RepetitionIndex] + """ + + _validation = { + 'tracking_id': {'readonly': True}, + 'inputs': {'readonly': True}, + 'inputs_link': {'readonly': True}, + 'outputs': {'readonly': True}, + 'outputs_link': {'readonly': True}, + 'tracked_properties': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'correlation': {'key': 'correlation', 'type': 'RunActionCorrelation'}, + 'status': {'key': 'status', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'object'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': 'object'}, + 'inputs_link': {'key': 'inputsLink', 'type': 'ContentLink'}, + 'outputs': {'key': 'outputs', 'type': 'object'}, + 'outputs_link': {'key': 'outputsLink', 'type': 'ContentLink'}, + 'tracked_properties': {'key': 'trackedProperties', 'type': 'object'}, + 'retry_history': {'key': 'retryHistory', 'type': '[RetryHistory]'}, + 'iteration_count': {'key': 'iterationCount', 'type': 'int'}, + 'repetition_indexes': {'key': 'repetitionIndexes', 'type': '[RepetitionIndex]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowRunActionRepetitionProperties, self).__init__(**kwargs) + self.repetition_indexes = kwargs.get('repetition_indexes', None) + + +class WorkflowRunFilter(msrest.serialization.Model): + """The workflow run filter. + + :param status: The status of workflow run. Possible values include: "NotSpecified", "Paused", + "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", + "TimedOut", "Aborted", "Ignored". + :type status: str or ~azure.mgmt.logic.models.WorkflowStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowRunFilter, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + + +class WorkflowRunListResult(msrest.serialization.Model): + """The list of workflow runs. + + :param value: A list of workflow runs. + :type value: list[~azure.mgmt.logic.models.WorkflowRun] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkflowRun]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowRunListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class WorkflowRunTrigger(msrest.serialization.Model): + """The workflow run trigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Gets the name. + :vartype name: str + :ivar inputs: Gets the inputs. + :vartype inputs: object + :ivar inputs_link: Gets the link to inputs. + :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar outputs: Gets the outputs. + :vartype outputs: object + :ivar outputs_link: Gets the link to outputs. + :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar scheduled_time: Gets the scheduled time. + :vartype scheduled_time: ~datetime.datetime + :ivar start_time: Gets the start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: Gets the end time. + :vartype end_time: ~datetime.datetime + :ivar tracking_id: Gets the tracking id. + :vartype tracking_id: str + :param correlation: The run correlation. + :type correlation: ~azure.mgmt.logic.models.Correlation + :ivar code: Gets the code. + :vartype code: str + :ivar status: Gets the status. Possible values include: "NotSpecified", "Paused", "Running", + "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", + "Aborted", "Ignored". + :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus + :ivar error: Gets the error. + :vartype error: object + :ivar tracked_properties: Gets the tracked properties. + :vartype tracked_properties: object + """ + + _validation = { + 'name': {'readonly': True}, + 'inputs': {'readonly': True}, + 'inputs_link': {'readonly': True}, + 'outputs': {'readonly': True}, + 'outputs_link': {'readonly': True}, + 'scheduled_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'tracking_id': {'readonly': True}, + 'code': {'readonly': True}, + 'status': {'readonly': True}, + 'error': {'readonly': True}, + 'tracked_properties': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': 'object'}, + 'inputs_link': {'key': 'inputsLink', 'type': 'ContentLink'}, + 'outputs': {'key': 'outputs', 'type': 'object'}, + 'outputs_link': {'key': 'outputsLink', 'type': 'ContentLink'}, + 'scheduled_time': {'key': 'scheduledTime', 'type': 'iso-8601'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'correlation': {'key': 'correlation', 'type': 'Correlation'}, + 'code': {'key': 'code', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'object'}, + 'tracked_properties': {'key': 'trackedProperties', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowRunTrigger, self).__init__(**kwargs) + self.name = None + self.inputs = None + self.inputs_link = None + self.outputs = None + self.outputs_link = None + self.scheduled_time = None + self.start_time = None + self.end_time = None + self.tracking_id = None + self.correlation = kwargs.get('correlation', None) + self.code = None + self.status = None + self.error = None + self.tracked_properties = None + + +class WorkflowTrigger(SubResource): + """The workflow trigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the workflow trigger name. + :vartype name: str + :ivar type: Gets the workflow trigger type. + :vartype type: str + :ivar provisioning_state: Gets the provisioning state. Possible values include: "NotSpecified", + "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", + "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + "Unregistered", "Completed". + :vartype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowTriggerProvisioningState + :ivar created_time: Gets the created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: Gets the changed time. + :vartype changed_time: ~datetime.datetime + :ivar state: Gets the state. Possible values include: "NotSpecified", "Completed", "Enabled", + "Disabled", "Deleted", "Suspended". + :vartype state: str or ~azure.mgmt.logic.models.WorkflowState + :ivar status: Gets the status. Possible values include: "NotSpecified", "Paused", "Running", + "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", + "Aborted", "Ignored". + :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus + :ivar last_execution_time: Gets the last execution time. + :vartype last_execution_time: ~datetime.datetime + :ivar next_execution_time: Gets the next execution time. + :vartype next_execution_time: ~datetime.datetime + :ivar recurrence: Gets the workflow trigger recurrence. + :vartype recurrence: ~azure.mgmt.logic.models.WorkflowTriggerRecurrence + :ivar workflow: Gets the reference to workflow. + :vartype workflow: ~azure.mgmt.logic.models.ResourceReference + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'state': {'readonly': True}, + 'status': {'readonly': True}, + 'last_execution_time': {'readonly': True}, + 'next_execution_time': {'readonly': True}, + 'recurrence': {'readonly': True}, + 'workflow': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'last_execution_time': {'key': 'properties.lastExecutionTime', 'type': 'iso-8601'}, + 'next_execution_time': {'key': 'properties.nextExecutionTime', 'type': 'iso-8601'}, + 'recurrence': {'key': 'properties.recurrence', 'type': 'WorkflowTriggerRecurrence'}, + 'workflow': {'key': 'properties.workflow', 'type': 'ResourceReference'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowTrigger, self).__init__(**kwargs) + self.name = None + self.type = None + self.provisioning_state = None + self.created_time = None + self.changed_time = None + self.state = None + self.status = None + self.last_execution_time = None + self.next_execution_time = None + self.recurrence = None + self.workflow = None + + +class WorkflowTriggerCallbackUrl(msrest.serialization.Model): + """The workflow trigger callback URL. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Gets the workflow trigger callback URL. + :vartype value: str + :ivar method: Gets the workflow trigger callback URL HTTP method. + :vartype method: str + :ivar base_path: Gets the workflow trigger callback URL base path. + :vartype base_path: str + :ivar relative_path: Gets the workflow trigger callback URL relative path. + :vartype relative_path: str + :param relative_path_parameters: Gets the workflow trigger callback URL relative path + parameters. + :type relative_path_parameters: list[str] + :param queries: Gets the workflow trigger callback URL query parameters. + :type queries: ~azure.mgmt.logic.models.WorkflowTriggerListCallbackUrlQueries + """ + + _validation = { + 'value': {'readonly': True}, + 'method': {'readonly': True}, + 'base_path': {'readonly': True}, + 'relative_path': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'base_path': {'key': 'basePath', 'type': 'str'}, + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'relative_path_parameters': {'key': 'relativePathParameters', 'type': '[str]'}, + 'queries': {'key': 'queries', 'type': 'WorkflowTriggerListCallbackUrlQueries'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowTriggerCallbackUrl, self).__init__(**kwargs) + self.value = None + self.method = None + self.base_path = None + self.relative_path = None + self.relative_path_parameters = kwargs.get('relative_path_parameters', None) + self.queries = kwargs.get('queries', None) + + +class WorkflowTriggerFilter(msrest.serialization.Model): + """The workflow trigger filter. + + :param state: The state of workflow trigger. Possible values include: "NotSpecified", + "Completed", "Enabled", "Disabled", "Deleted", "Suspended". + :type state: str or ~azure.mgmt.logic.models.WorkflowState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowTriggerFilter, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + + +class WorkflowTriggerHistory(SubResource): + """The workflow trigger history. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the workflow trigger history name. + :vartype name: str + :ivar type: Gets the workflow trigger history type. + :vartype type: str + :ivar start_time: Gets the start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: Gets the end time. + :vartype end_time: ~datetime.datetime + :ivar scheduled_time: The scheduled time. + :vartype scheduled_time: ~datetime.datetime + :ivar status: Gets the status. Possible values include: "NotSpecified", "Paused", "Running", + "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", + "Aborted", "Ignored". + :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus + :ivar code: Gets the code. + :vartype code: str + :ivar error: Gets the error. + :vartype error: object + :ivar tracking_id: Gets the tracking id. + :vartype tracking_id: str + :param correlation: The run correlation. + :type correlation: ~azure.mgmt.logic.models.Correlation + :ivar inputs_link: Gets the link to input parameters. + :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar outputs_link: Gets the link to output parameters. + :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar fired: The value indicating whether trigger was fired. + :vartype fired: bool + :ivar run: Gets the reference to workflow run. + :vartype run: ~azure.mgmt.logic.models.ResourceReference + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'scheduled_time': {'readonly': True}, + 'status': {'readonly': True}, + 'code': {'readonly': True}, + 'error': {'readonly': True}, + 'tracking_id': {'readonly': True}, + 'inputs_link': {'readonly': True}, + 'outputs_link': {'readonly': True}, + 'fired': {'readonly': True}, + 'run': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'scheduled_time': {'key': 'properties.scheduledTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'code': {'key': 'properties.code', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'object'}, + 'tracking_id': {'key': 'properties.trackingId', 'type': 'str'}, + 'correlation': {'key': 'properties.correlation', 'type': 'Correlation'}, + 'inputs_link': {'key': 'properties.inputsLink', 'type': 'ContentLink'}, + 'outputs_link': {'key': 'properties.outputsLink', 'type': 'ContentLink'}, + 'fired': {'key': 'properties.fired', 'type': 'bool'}, + 'run': {'key': 'properties.run', 'type': 'ResourceReference'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowTriggerHistory, self).__init__(**kwargs) + self.name = None + self.type = None + self.start_time = None + self.end_time = None + self.scheduled_time = None + self.status = None + self.code = None + self.error = None + self.tracking_id = None + self.correlation = kwargs.get('correlation', None) + self.inputs_link = None + self.outputs_link = None + self.fired = None + self.run = None + + +class WorkflowTriggerHistoryFilter(msrest.serialization.Model): + """The workflow trigger history filter. + + :param status: The status of workflow trigger history. Possible values include: "NotSpecified", + "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", + "Faulted", "TimedOut", "Aborted", "Ignored". + :type status: str or ~azure.mgmt.logic.models.WorkflowStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowTriggerHistoryFilter, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + + +class WorkflowTriggerHistoryListResult(msrest.serialization.Model): + """The list of workflow trigger histories. + + :param value: A list of workflow trigger histories. + :type value: list[~azure.mgmt.logic.models.WorkflowTriggerHistory] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkflowTriggerHistory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowTriggerHistoryListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class WorkflowTriggerListCallbackUrlQueries(msrest.serialization.Model): + """Gets the workflow trigger callback URL query parameters. + + :param api_version: The api version. + :type api_version: str + :param sp: The SAS permissions. + :type sp: str + :param sv: The SAS version. + :type sv: str + :param sig: The SAS signature. + :type sig: str + :param se: The SAS timestamp. + :type se: str + """ + + _attribute_map = { + 'api_version': {'key': 'api-version', 'type': 'str'}, + 'sp': {'key': 'sp', 'type': 'str'}, + 'sv': {'key': 'sv', 'type': 'str'}, + 'sig': {'key': 'sig', 'type': 'str'}, + 'se': {'key': 'se', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowTriggerListCallbackUrlQueries, self).__init__(**kwargs) + self.api_version = kwargs.get('api_version', None) + self.sp = kwargs.get('sp', None) + self.sv = kwargs.get('sv', None) + self.sig = kwargs.get('sig', None) + self.se = kwargs.get('se', None) + + +class WorkflowTriggerListResult(msrest.serialization.Model): + """The list of workflow triggers. + + :param value: A list of workflow triggers. + :type value: list[~azure.mgmt.logic.models.WorkflowTrigger] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkflowTrigger]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowTriggerListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class WorkflowTriggerRecurrence(msrest.serialization.Model): + """The workflow trigger recurrence. + + :param frequency: The frequency. Possible values include: "NotSpecified", "Second", "Minute", + "Hour", "Day", "Week", "Month", "Year". + :type frequency: str or ~azure.mgmt.logic.models.RecurrenceFrequency + :param interval: The interval. + :type interval: int + :param start_time: The start time. + :type start_time: str + :param end_time: The end time. + :type end_time: str + :param time_zone: The time zone. + :type time_zone: str + :param schedule: The recurrence schedule. + :type schedule: ~azure.mgmt.logic.models.RecurrenceSchedule + """ + + _attribute_map = { + 'frequency': {'key': 'frequency', 'type': 'str'}, + 'interval': {'key': 'interval', 'type': 'int'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowTriggerRecurrence, self).__init__(**kwargs) + self.frequency = kwargs.get('frequency', None) + self.interval = kwargs.get('interval', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.time_zone = kwargs.get('time_zone', None) + self.schedule = kwargs.get('schedule', None) + + +class WorkflowTriggerReference(ResourceReference): + """The workflow trigger reference. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The resource id. + :type id: str + :ivar type: Gets the resource type. + :vartype type: str + :param name: The workflow trigger resource reference name. + :type name: str + :param flow_name: The workflow name. + :type flow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'flow_name': {'key': 'flowName', 'type': 'str'}, + 'trigger_name': {'key': 'triggerName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowTriggerReference, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.flow_name = kwargs.get('flow_name', None) + self.trigger_name = kwargs.get('trigger_name', None) + + +class WorkflowVersion(Resource): + """The workflow version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :ivar provisioning_state: The provisioning state. Possible values include: "NotSpecified", + "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", + "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :vartype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState + :ivar created_time: Gets the created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: Gets the changed time. + :vartype changed_time: ~datetime.datetime + :param state: The state. Possible values include: "NotSpecified", "Completed", "Enabled", + "Disabled", "Deleted", "Suspended". + :type state: str or ~azure.mgmt.logic.models.WorkflowState + :ivar version: Gets the version. + :vartype version: str + :ivar access_endpoint: Gets the access endpoint. + :vartype access_endpoint: str + :param endpoints_configuration: The endpoints configuration. + :type endpoints_configuration: ~azure.mgmt.logic.models.FlowEndpointsConfiguration + :param access_control: The access control configuration. + :type access_control: ~azure.mgmt.logic.models.FlowAccessControlConfiguration + :ivar sku: The sku. + :vartype sku: ~azure.mgmt.logic.models.Sku + :param integration_account: The integration account. + :type integration_account: ~azure.mgmt.logic.models.ResourceReference + :param definition: The definition. + :type definition: object + :param parameters: The parameters. + :type parameters: dict[str, ~azure.mgmt.logic.models.WorkflowParameter] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'version': {'readonly': True}, + 'access_endpoint': {'readonly': True}, + 'sku': {'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}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'access_endpoint': {'key': 'properties.accessEndpoint', 'type': 'str'}, + 'endpoints_configuration': {'key': 'properties.endpointsConfiguration', 'type': 'FlowEndpointsConfiguration'}, + 'access_control': {'key': 'properties.accessControl', 'type': 'FlowAccessControlConfiguration'}, + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'integration_account': {'key': 'properties.integrationAccount', 'type': 'ResourceReference'}, + 'definition': {'key': 'properties.definition', 'type': 'object'}, + 'parameters': {'key': 'properties.parameters', 'type': '{WorkflowParameter}'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowVersion, self).__init__(**kwargs) + self.provisioning_state = None + self.created_time = None + self.changed_time = None + self.state = kwargs.get('state', None) + self.version = None + self.access_endpoint = None + self.endpoints_configuration = kwargs.get('endpoints_configuration', None) + self.access_control = kwargs.get('access_control', None) + self.sku = None + self.integration_account = kwargs.get('integration_account', None) + self.definition = kwargs.get('definition', None) + self.parameters = kwargs.get('parameters', None) + + +class WorkflowVersionListResult(msrest.serialization.Model): + """The list of workflow versions. + + :param value: A list of workflow versions. + :type value: list[~azure.mgmt.logic.models.WorkflowVersion] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkflowVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowVersionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class WsdlService(msrest.serialization.Model): + """The WSDL service. + + :param qualified_name: The qualified name. + :type qualified_name: str + :param endpoint_qualified_names: The list of endpoints' qualified names. + :type endpoint_qualified_names: list[str] + """ + + _attribute_map = { + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + 'endpoint_qualified_names': {'key': 'EndpointQualifiedNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(WsdlService, self).__init__(**kwargs) + self.qualified_name = kwargs.get('qualified_name', None) + self.endpoint_qualified_names = kwargs.get('endpoint_qualified_names', None) + + +class X12AcknowledgementSettings(msrest.serialization.Model): + """The X12 agreement acknowledgement settings. + + All required parameters must be populated in order to send to Azure. + + :param need_technical_acknowledgement: Required. The value indicating whether technical + acknowledgement is needed. + :type need_technical_acknowledgement: bool + :param batch_technical_acknowledgements: Required. The value indicating whether to batch the + technical acknowledgements. + :type batch_technical_acknowledgements: bool + :param need_functional_acknowledgement: Required. The value indicating whether functional + acknowledgement is needed. + :type need_functional_acknowledgement: bool + :param functional_acknowledgement_version: The functional acknowledgement version. + :type functional_acknowledgement_version: str + :param batch_functional_acknowledgements: Required. The value indicating whether to batch + functional acknowledgements. + :type batch_functional_acknowledgements: bool + :param need_implementation_acknowledgement: Required. The value indicating whether + implementation acknowledgement is needed. + :type need_implementation_acknowledgement: bool + :param implementation_acknowledgement_version: The implementation acknowledgement version. + :type implementation_acknowledgement_version: str + :param batch_implementation_acknowledgements: Required. The value indicating whether to batch + implementation acknowledgements. + :type batch_implementation_acknowledgements: bool + :param need_loop_for_valid_messages: Required. The value indicating whether a loop is needed + for valid messages. + :type need_loop_for_valid_messages: bool + :param send_synchronous_acknowledgement: Required. The value indicating whether to send + synchronous acknowledgement. + :type send_synchronous_acknowledgement: bool + :param acknowledgement_control_number_prefix: The acknowledgement control number prefix. + :type acknowledgement_control_number_prefix: str + :param acknowledgement_control_number_suffix: The acknowledgement control number suffix. + :type acknowledgement_control_number_suffix: str + :param acknowledgement_control_number_lower_bound: Required. The acknowledgement control number + lower bound. + :type acknowledgement_control_number_lower_bound: int + :param acknowledgement_control_number_upper_bound: Required. The acknowledgement control number + upper bound. + :type acknowledgement_control_number_upper_bound: int + :param rollover_acknowledgement_control_number: Required. The value indicating whether to + rollover acknowledgement control number. + :type rollover_acknowledgement_control_number: bool + """ + + _validation = { + 'need_technical_acknowledgement': {'required': True}, + 'batch_technical_acknowledgements': {'required': True}, + 'need_functional_acknowledgement': {'required': True}, + 'batch_functional_acknowledgements': {'required': True}, + 'need_implementation_acknowledgement': {'required': True}, + 'batch_implementation_acknowledgements': {'required': True}, + 'need_loop_for_valid_messages': {'required': True}, + 'send_synchronous_acknowledgement': {'required': True}, + 'acknowledgement_control_number_lower_bound': {'required': True}, + 'acknowledgement_control_number_upper_bound': {'required': True}, + 'rollover_acknowledgement_control_number': {'required': True}, + } + + _attribute_map = { + 'need_technical_acknowledgement': {'key': 'needTechnicalAcknowledgement', 'type': 'bool'}, + 'batch_technical_acknowledgements': {'key': 'batchTechnicalAcknowledgements', 'type': 'bool'}, + 'need_functional_acknowledgement': {'key': 'needFunctionalAcknowledgement', 'type': 'bool'}, + 'functional_acknowledgement_version': {'key': 'functionalAcknowledgementVersion', 'type': 'str'}, + 'batch_functional_acknowledgements': {'key': 'batchFunctionalAcknowledgements', 'type': 'bool'}, + 'need_implementation_acknowledgement': {'key': 'needImplementationAcknowledgement', 'type': 'bool'}, + 'implementation_acknowledgement_version': {'key': 'implementationAcknowledgementVersion', 'type': 'str'}, + 'batch_implementation_acknowledgements': {'key': 'batchImplementationAcknowledgements', 'type': 'bool'}, + 'need_loop_for_valid_messages': {'key': 'needLoopForValidMessages', 'type': 'bool'}, + 'send_synchronous_acknowledgement': {'key': 'sendSynchronousAcknowledgement', 'type': 'bool'}, + 'acknowledgement_control_number_prefix': {'key': 'acknowledgementControlNumberPrefix', 'type': 'str'}, + 'acknowledgement_control_number_suffix': {'key': 'acknowledgementControlNumberSuffix', 'type': 'str'}, + 'acknowledgement_control_number_lower_bound': {'key': 'acknowledgementControlNumberLowerBound', 'type': 'int'}, + 'acknowledgement_control_number_upper_bound': {'key': 'acknowledgementControlNumberUpperBound', 'type': 'int'}, + 'rollover_acknowledgement_control_number': {'key': 'rolloverAcknowledgementControlNumber', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(X12AcknowledgementSettings, self).__init__(**kwargs) + self.need_technical_acknowledgement = kwargs['need_technical_acknowledgement'] + self.batch_technical_acknowledgements = kwargs['batch_technical_acknowledgements'] + self.need_functional_acknowledgement = kwargs['need_functional_acknowledgement'] + self.functional_acknowledgement_version = kwargs.get('functional_acknowledgement_version', None) + self.batch_functional_acknowledgements = kwargs['batch_functional_acknowledgements'] + self.need_implementation_acknowledgement = kwargs['need_implementation_acknowledgement'] + self.implementation_acknowledgement_version = kwargs.get('implementation_acknowledgement_version', None) + self.batch_implementation_acknowledgements = kwargs['batch_implementation_acknowledgements'] + self.need_loop_for_valid_messages = kwargs['need_loop_for_valid_messages'] + self.send_synchronous_acknowledgement = kwargs['send_synchronous_acknowledgement'] + self.acknowledgement_control_number_prefix = kwargs.get('acknowledgement_control_number_prefix', None) + self.acknowledgement_control_number_suffix = kwargs.get('acknowledgement_control_number_suffix', None) + self.acknowledgement_control_number_lower_bound = kwargs['acknowledgement_control_number_lower_bound'] + self.acknowledgement_control_number_upper_bound = kwargs['acknowledgement_control_number_upper_bound'] + self.rollover_acknowledgement_control_number = kwargs['rollover_acknowledgement_control_number'] + + +class X12AgreementContent(msrest.serialization.Model): + """The X12 agreement content. + + All required parameters must be populated in order to send to Azure. + + :param receive_agreement: Required. The X12 one-way receive agreement. + :type receive_agreement: ~azure.mgmt.logic.models.X12OneWayAgreement + :param send_agreement: Required. The X12 one-way send agreement. + :type send_agreement: ~azure.mgmt.logic.models.X12OneWayAgreement + """ + + _validation = { + 'receive_agreement': {'required': True}, + 'send_agreement': {'required': True}, + } + + _attribute_map = { + 'receive_agreement': {'key': 'receiveAgreement', 'type': 'X12OneWayAgreement'}, + 'send_agreement': {'key': 'sendAgreement', 'type': 'X12OneWayAgreement'}, + } + + def __init__( + self, + **kwargs + ): + super(X12AgreementContent, self).__init__(**kwargs) + self.receive_agreement = kwargs['receive_agreement'] + self.send_agreement = kwargs['send_agreement'] + + +class X12DelimiterOverrides(msrest.serialization.Model): + """The X12 delimiter override settings. + + All required parameters must be populated in order to send to Azure. + + :param protocol_version: The protocol version. + :type protocol_version: str + :param message_id: The message id. + :type message_id: str + :param data_element_separator: Required. The data element separator. + :type data_element_separator: int + :param component_separator: Required. The component separator. + :type component_separator: int + :param segment_terminator: Required. The segment terminator. + :type segment_terminator: int + :param segment_terminator_suffix: Required. The segment terminator suffix. Possible values + include: "NotSpecified", "None", "CR", "LF", "CRLF". + :type segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix + :param replace_character: Required. The replacement character. + :type replace_character: int + :param replace_separators_in_payload: Required. The value indicating whether to replace + separators in payload. + :type replace_separators_in_payload: bool + :param target_namespace: The target namespace on which this delimiter settings has to be + applied. + :type target_namespace: str + """ + + _validation = { + 'data_element_separator': {'required': True}, + 'component_separator': {'required': True}, + 'segment_terminator': {'required': True}, + 'segment_terminator_suffix': {'required': True}, + 'replace_character': {'required': True}, + 'replace_separators_in_payload': {'required': True}, + } + + _attribute_map = { + 'protocol_version': {'key': 'protocolVersion', 'type': 'str'}, + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'data_element_separator': {'key': 'dataElementSeparator', 'type': 'int'}, + 'component_separator': {'key': 'componentSeparator', 'type': 'int'}, + 'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'}, + 'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'}, + 'replace_character': {'key': 'replaceCharacter', 'type': 'int'}, + 'replace_separators_in_payload': {'key': 'replaceSeparatorsInPayload', 'type': 'bool'}, + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(X12DelimiterOverrides, self).__init__(**kwargs) + self.protocol_version = kwargs.get('protocol_version', None) + self.message_id = kwargs.get('message_id', None) + self.data_element_separator = kwargs['data_element_separator'] + self.component_separator = kwargs['component_separator'] + self.segment_terminator = kwargs['segment_terminator'] + self.segment_terminator_suffix = kwargs['segment_terminator_suffix'] + self.replace_character = kwargs['replace_character'] + self.replace_separators_in_payload = kwargs['replace_separators_in_payload'] + self.target_namespace = kwargs.get('target_namespace', None) + + +class X12EnvelopeOverride(msrest.serialization.Model): + """The X12 envelope override settings. + + All required parameters must be populated in order to send to Azure. + + :param target_namespace: Required. The target namespace on which this envelope settings has to + be applied. + :type target_namespace: str + :param protocol_version: Required. The protocol version on which this envelope settings has to + be applied. + :type protocol_version: str + :param message_id: Required. The message id on which this envelope settings has to be applied. + :type message_id: str + :param responsible_agency_code: Required. The responsible agency code. + :type responsible_agency_code: str + :param header_version: Required. The header version. + :type header_version: str + :param sender_application_id: Required. The sender application id. + :type sender_application_id: str + :param receiver_application_id: Required. The receiver application id. + :type receiver_application_id: str + :param functional_identifier_code: The functional identifier code. + :type functional_identifier_code: str + :param date_format: Required. The date format. Possible values include: "NotSpecified", + "CCYYMMDD", "YYMMDD". + :type date_format: str or ~azure.mgmt.logic.models.X12DateFormat + :param time_format: Required. The time format. Possible values include: "NotSpecified", "HHMM", + "HHMMSS", "HHMMSSdd", "HHMMSSd". + :type time_format: str or ~azure.mgmt.logic.models.X12TimeFormat + """ + + _validation = { + 'target_namespace': {'required': True}, + 'protocol_version': {'required': True}, + 'message_id': {'required': True}, + 'responsible_agency_code': {'required': True}, + 'header_version': {'required': True}, + 'sender_application_id': {'required': True}, + 'receiver_application_id': {'required': True}, + 'date_format': {'required': True}, + 'time_format': {'required': True}, + } + + _attribute_map = { + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + 'protocol_version': {'key': 'protocolVersion', 'type': 'str'}, + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'responsible_agency_code': {'key': 'responsibleAgencyCode', 'type': 'str'}, + 'header_version': {'key': 'headerVersion', 'type': 'str'}, + 'sender_application_id': {'key': 'senderApplicationId', 'type': 'str'}, + 'receiver_application_id': {'key': 'receiverApplicationId', 'type': 'str'}, + 'functional_identifier_code': {'key': 'functionalIdentifierCode', 'type': 'str'}, + 'date_format': {'key': 'dateFormat', 'type': 'str'}, + 'time_format': {'key': 'timeFormat', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(X12EnvelopeOverride, self).__init__(**kwargs) + self.target_namespace = kwargs['target_namespace'] + self.protocol_version = kwargs['protocol_version'] + self.message_id = kwargs['message_id'] + self.responsible_agency_code = kwargs['responsible_agency_code'] + self.header_version = kwargs['header_version'] + self.sender_application_id = kwargs['sender_application_id'] + self.receiver_application_id = kwargs['receiver_application_id'] + self.functional_identifier_code = kwargs.get('functional_identifier_code', None) + self.date_format = kwargs['date_format'] + self.time_format = kwargs['time_format'] + + +class X12EnvelopeSettings(msrest.serialization.Model): + """The X12 agreement envelope settings. + + All required parameters must be populated in order to send to Azure. + + :param control_standards_id: Required. The controls standards id. + :type control_standards_id: int + :param use_control_standards_id_as_repetition_character: Required. The value indicating whether + to use control standards id as repetition character. + :type use_control_standards_id_as_repetition_character: bool + :param sender_application_id: Required. The sender application id. + :type sender_application_id: str + :param receiver_application_id: Required. The receiver application id. + :type receiver_application_id: str + :param control_version_number: Required. The control version number. + :type control_version_number: str + :param interchange_control_number_lower_bound: Required. The interchange control number lower + bound. + :type interchange_control_number_lower_bound: int + :param interchange_control_number_upper_bound: Required. The interchange control number upper + bound. + :type interchange_control_number_upper_bound: int + :param rollover_interchange_control_number: Required. The value indicating whether to rollover + interchange control number. + :type rollover_interchange_control_number: bool + :param enable_default_group_headers: Required. The value indicating whether to enable default + group headers. + :type enable_default_group_headers: bool + :param functional_group_id: The functional group id. + :type functional_group_id: str + :param group_control_number_lower_bound: Required. The group control number lower bound. + :type group_control_number_lower_bound: int + :param group_control_number_upper_bound: Required. The group control number upper bound. + :type group_control_number_upper_bound: int + :param rollover_group_control_number: Required. The value indicating whether to rollover group + control number. + :type rollover_group_control_number: bool + :param group_header_agency_code: Required. The group header agency code. + :type group_header_agency_code: str + :param group_header_version: Required. The group header version. + :type group_header_version: str + :param transaction_set_control_number_lower_bound: Required. The transaction set control number + lower bound. + :type transaction_set_control_number_lower_bound: int + :param transaction_set_control_number_upper_bound: Required. The transaction set control number + upper bound. + :type transaction_set_control_number_upper_bound: int + :param rollover_transaction_set_control_number: Required. The value indicating whether to + rollover transaction set control number. + :type rollover_transaction_set_control_number: bool + :param transaction_set_control_number_prefix: The transaction set control number prefix. + :type transaction_set_control_number_prefix: str + :param transaction_set_control_number_suffix: The transaction set control number suffix. + :type transaction_set_control_number_suffix: str + :param overwrite_existing_transaction_set_control_number: Required. The value indicating + whether to overwrite existing transaction set control number. + :type overwrite_existing_transaction_set_control_number: bool + :param group_header_date_format: Required. The group header date format. Possible values + include: "NotSpecified", "CCYYMMDD", "YYMMDD". + :type group_header_date_format: str or ~azure.mgmt.logic.models.X12DateFormat + :param group_header_time_format: Required. The group header time format. Possible values + include: "NotSpecified", "HHMM", "HHMMSS", "HHMMSSdd", "HHMMSSd". + :type group_header_time_format: str or ~azure.mgmt.logic.models.X12TimeFormat + :param usage_indicator: Required. The usage indicator. Possible values include: "NotSpecified", + "Test", "Information", "Production". + :type usage_indicator: str or ~azure.mgmt.logic.models.UsageIndicator + """ + + _validation = { + 'control_standards_id': {'required': True}, + 'use_control_standards_id_as_repetition_character': {'required': True}, + 'sender_application_id': {'required': True}, + 'receiver_application_id': {'required': True}, + 'control_version_number': {'required': True}, + 'interchange_control_number_lower_bound': {'required': True}, + 'interchange_control_number_upper_bound': {'required': True}, + 'rollover_interchange_control_number': {'required': True}, + 'enable_default_group_headers': {'required': True}, + 'group_control_number_lower_bound': {'required': True}, + 'group_control_number_upper_bound': {'required': True}, + 'rollover_group_control_number': {'required': True}, + 'group_header_agency_code': {'required': True}, + 'group_header_version': {'required': True}, + 'transaction_set_control_number_lower_bound': {'required': True}, + 'transaction_set_control_number_upper_bound': {'required': True}, + 'rollover_transaction_set_control_number': {'required': True}, + 'overwrite_existing_transaction_set_control_number': {'required': True}, + 'group_header_date_format': {'required': True}, + 'group_header_time_format': {'required': True}, + 'usage_indicator': {'required': True}, + } + + _attribute_map = { + 'control_standards_id': {'key': 'controlStandardsId', 'type': 'int'}, + 'use_control_standards_id_as_repetition_character': {'key': 'useControlStandardsIdAsRepetitionCharacter', 'type': 'bool'}, + 'sender_application_id': {'key': 'senderApplicationId', 'type': 'str'}, + 'receiver_application_id': {'key': 'receiverApplicationId', 'type': 'str'}, + 'control_version_number': {'key': 'controlVersionNumber', 'type': 'str'}, + 'interchange_control_number_lower_bound': {'key': 'interchangeControlNumberLowerBound', 'type': 'int'}, + 'interchange_control_number_upper_bound': {'key': 'interchangeControlNumberUpperBound', 'type': 'int'}, + 'rollover_interchange_control_number': {'key': 'rolloverInterchangeControlNumber', 'type': 'bool'}, + 'enable_default_group_headers': {'key': 'enableDefaultGroupHeaders', 'type': 'bool'}, + 'functional_group_id': {'key': 'functionalGroupId', 'type': 'str'}, + 'group_control_number_lower_bound': {'key': 'groupControlNumberLowerBound', 'type': 'int'}, + 'group_control_number_upper_bound': {'key': 'groupControlNumberUpperBound', 'type': 'int'}, + 'rollover_group_control_number': {'key': 'rolloverGroupControlNumber', 'type': 'bool'}, + 'group_header_agency_code': {'key': 'groupHeaderAgencyCode', 'type': 'str'}, + 'group_header_version': {'key': 'groupHeaderVersion', 'type': 'str'}, + 'transaction_set_control_number_lower_bound': {'key': 'transactionSetControlNumberLowerBound', 'type': 'int'}, + 'transaction_set_control_number_upper_bound': {'key': 'transactionSetControlNumberUpperBound', 'type': 'int'}, + 'rollover_transaction_set_control_number': {'key': 'rolloverTransactionSetControlNumber', 'type': 'bool'}, + 'transaction_set_control_number_prefix': {'key': 'transactionSetControlNumberPrefix', 'type': 'str'}, + 'transaction_set_control_number_suffix': {'key': 'transactionSetControlNumberSuffix', 'type': 'str'}, + 'overwrite_existing_transaction_set_control_number': {'key': 'overwriteExistingTransactionSetControlNumber', 'type': 'bool'}, + 'group_header_date_format': {'key': 'groupHeaderDateFormat', 'type': 'str'}, + 'group_header_time_format': {'key': 'groupHeaderTimeFormat', 'type': 'str'}, + 'usage_indicator': {'key': 'usageIndicator', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(X12EnvelopeSettings, self).__init__(**kwargs) + self.control_standards_id = kwargs['control_standards_id'] + self.use_control_standards_id_as_repetition_character = kwargs['use_control_standards_id_as_repetition_character'] + self.sender_application_id = kwargs['sender_application_id'] + self.receiver_application_id = kwargs['receiver_application_id'] + self.control_version_number = kwargs['control_version_number'] + self.interchange_control_number_lower_bound = kwargs['interchange_control_number_lower_bound'] + self.interchange_control_number_upper_bound = kwargs['interchange_control_number_upper_bound'] + self.rollover_interchange_control_number = kwargs['rollover_interchange_control_number'] + self.enable_default_group_headers = kwargs['enable_default_group_headers'] + self.functional_group_id = kwargs.get('functional_group_id', None) + self.group_control_number_lower_bound = kwargs['group_control_number_lower_bound'] + self.group_control_number_upper_bound = kwargs['group_control_number_upper_bound'] + self.rollover_group_control_number = kwargs['rollover_group_control_number'] + self.group_header_agency_code = kwargs['group_header_agency_code'] + self.group_header_version = kwargs['group_header_version'] + self.transaction_set_control_number_lower_bound = kwargs['transaction_set_control_number_lower_bound'] + self.transaction_set_control_number_upper_bound = kwargs['transaction_set_control_number_upper_bound'] + self.rollover_transaction_set_control_number = kwargs['rollover_transaction_set_control_number'] + self.transaction_set_control_number_prefix = kwargs.get('transaction_set_control_number_prefix', None) + self.transaction_set_control_number_suffix = kwargs.get('transaction_set_control_number_suffix', None) + self.overwrite_existing_transaction_set_control_number = kwargs['overwrite_existing_transaction_set_control_number'] + self.group_header_date_format = kwargs['group_header_date_format'] + self.group_header_time_format = kwargs['group_header_time_format'] + self.usage_indicator = kwargs['usage_indicator'] + + +class X12FramingSettings(msrest.serialization.Model): + """The X12 agreement framing settings. + + All required parameters must be populated in order to send to Azure. + + :param data_element_separator: Required. The data element separator. + :type data_element_separator: int + :param component_separator: Required. The component separator. + :type component_separator: int + :param replace_separators_in_payload: Required. The value indicating whether to replace + separators in payload. + :type replace_separators_in_payload: bool + :param replace_character: Required. The replacement character. + :type replace_character: int + :param segment_terminator: Required. The segment terminator. + :type segment_terminator: int + :param character_set: Required. The X12 character set. Possible values include: "NotSpecified", + "Basic", "Extended", "UTF8". + :type character_set: str or ~azure.mgmt.logic.models.X12CharacterSet + :param segment_terminator_suffix: Required. The segment terminator suffix. Possible values + include: "NotSpecified", "None", "CR", "LF", "CRLF". + :type segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix + """ + + _validation = { + 'data_element_separator': {'required': True}, + 'component_separator': {'required': True}, + 'replace_separators_in_payload': {'required': True}, + 'replace_character': {'required': True}, + 'segment_terminator': {'required': True}, + 'character_set': {'required': True}, + 'segment_terminator_suffix': {'required': True}, + } + + _attribute_map = { + 'data_element_separator': {'key': 'dataElementSeparator', 'type': 'int'}, + 'component_separator': {'key': 'componentSeparator', 'type': 'int'}, + 'replace_separators_in_payload': {'key': 'replaceSeparatorsInPayload', 'type': 'bool'}, + 'replace_character': {'key': 'replaceCharacter', 'type': 'int'}, + 'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'}, + 'character_set': {'key': 'characterSet', 'type': 'str'}, + 'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(X12FramingSettings, self).__init__(**kwargs) + self.data_element_separator = kwargs['data_element_separator'] + self.component_separator = kwargs['component_separator'] + self.replace_separators_in_payload = kwargs['replace_separators_in_payload'] + self.replace_character = kwargs['replace_character'] + self.segment_terminator = kwargs['segment_terminator'] + self.character_set = kwargs['character_set'] + self.segment_terminator_suffix = kwargs['segment_terminator_suffix'] + + +class X12MessageFilter(msrest.serialization.Model): + """The X12 message filter for odata query. + + All required parameters must be populated in order to send to Azure. + + :param message_filter_type: Required. The message filter type. Possible values include: + "NotSpecified", "Include", "Exclude". + :type message_filter_type: str or ~azure.mgmt.logic.models.MessageFilterType + """ + + _validation = { + 'message_filter_type': {'required': True}, + } + + _attribute_map = { + 'message_filter_type': {'key': 'messageFilterType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(X12MessageFilter, self).__init__(**kwargs) + self.message_filter_type = kwargs['message_filter_type'] + + +class X12MessageIdentifier(msrest.serialization.Model): + """The X12 message identifier. + + All required parameters must be populated in order to send to Azure. + + :param message_id: Required. The message id. + :type message_id: str + """ + + _validation = { + 'message_id': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(X12MessageIdentifier, self).__init__(**kwargs) + self.message_id = kwargs['message_id'] + + +class X12OneWayAgreement(msrest.serialization.Model): + """The X12 one-way agreement. + + All required parameters must be populated in order to send to Azure. + + :param sender_business_identity: Required. The sender business identity. + :type sender_business_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param receiver_business_identity: Required. The receiver business identity. + :type receiver_business_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param protocol_settings: Required. The X12 protocol settings. + :type protocol_settings: ~azure.mgmt.logic.models.X12ProtocolSettings + """ + + _validation = { + 'sender_business_identity': {'required': True}, + 'receiver_business_identity': {'required': True}, + 'protocol_settings': {'required': True}, + } + + _attribute_map = { + 'sender_business_identity': {'key': 'senderBusinessIdentity', 'type': 'BusinessIdentity'}, + 'receiver_business_identity': {'key': 'receiverBusinessIdentity', 'type': 'BusinessIdentity'}, + 'protocol_settings': {'key': 'protocolSettings', 'type': 'X12ProtocolSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(X12OneWayAgreement, self).__init__(**kwargs) + self.sender_business_identity = kwargs['sender_business_identity'] + self.receiver_business_identity = kwargs['receiver_business_identity'] + self.protocol_settings = kwargs['protocol_settings'] + + +class X12ProcessingSettings(msrest.serialization.Model): + """The X12 processing settings. + + All required parameters must be populated in order to send to Azure. + + :param mask_security_info: Required. The value indicating whether to mask security information. + :type mask_security_info: bool + :param convert_implied_decimal: Required. The value indicating whether to convert numerical + type to implied decimal. + :type convert_implied_decimal: bool + :param preserve_interchange: Required. The value indicating whether to preserve interchange. + :type preserve_interchange: bool + :param suspend_interchange_on_error: Required. The value indicating whether to suspend + interchange on error. + :type suspend_interchange_on_error: bool + :param create_empty_xml_tags_for_trailing_separators: Required. The value indicating whether to + create empty xml tags for trailing separators. + :type create_empty_xml_tags_for_trailing_separators: bool + :param use_dot_as_decimal_separator: Required. The value indicating whether to use dot as + decimal separator. + :type use_dot_as_decimal_separator: bool + """ + + _validation = { + 'mask_security_info': {'required': True}, + 'convert_implied_decimal': {'required': True}, + 'preserve_interchange': {'required': True}, + 'suspend_interchange_on_error': {'required': True}, + 'create_empty_xml_tags_for_trailing_separators': {'required': True}, + 'use_dot_as_decimal_separator': {'required': True}, + } + + _attribute_map = { + 'mask_security_info': {'key': 'maskSecurityInfo', 'type': 'bool'}, + 'convert_implied_decimal': {'key': 'convertImpliedDecimal', 'type': 'bool'}, + 'preserve_interchange': {'key': 'preserveInterchange', 'type': 'bool'}, + 'suspend_interchange_on_error': {'key': 'suspendInterchangeOnError', 'type': 'bool'}, + 'create_empty_xml_tags_for_trailing_separators': {'key': 'createEmptyXmlTagsForTrailingSeparators', 'type': 'bool'}, + 'use_dot_as_decimal_separator': {'key': 'useDotAsDecimalSeparator', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(X12ProcessingSettings, self).__init__(**kwargs) + self.mask_security_info = kwargs['mask_security_info'] + self.convert_implied_decimal = kwargs['convert_implied_decimal'] + self.preserve_interchange = kwargs['preserve_interchange'] + self.suspend_interchange_on_error = kwargs['suspend_interchange_on_error'] + self.create_empty_xml_tags_for_trailing_separators = kwargs['create_empty_xml_tags_for_trailing_separators'] + self.use_dot_as_decimal_separator = kwargs['use_dot_as_decimal_separator'] + + +class X12ProtocolSettings(msrest.serialization.Model): + """The X12 agreement protocol settings. + + All required parameters must be populated in order to send to Azure. + + :param validation_settings: Required. The X12 validation settings. + :type validation_settings: ~azure.mgmt.logic.models.X12ValidationSettings + :param framing_settings: Required. The X12 framing settings. + :type framing_settings: ~azure.mgmt.logic.models.X12FramingSettings + :param envelope_settings: Required. The X12 envelope settings. + :type envelope_settings: ~azure.mgmt.logic.models.X12EnvelopeSettings + :param acknowledgement_settings: Required. The X12 acknowledgment settings. + :type acknowledgement_settings: ~azure.mgmt.logic.models.X12AcknowledgementSettings + :param message_filter: Required. The X12 message filter. + :type message_filter: ~azure.mgmt.logic.models.X12MessageFilter + :param security_settings: Required. The X12 security settings. + :type security_settings: ~azure.mgmt.logic.models.X12SecuritySettings + :param processing_settings: Required. The X12 processing settings. + :type processing_settings: ~azure.mgmt.logic.models.X12ProcessingSettings + :param envelope_overrides: The X12 envelope override settings. + :type envelope_overrides: list[~azure.mgmt.logic.models.X12EnvelopeOverride] + :param validation_overrides: The X12 validation override settings. + :type validation_overrides: list[~azure.mgmt.logic.models.X12ValidationOverride] + :param message_filter_list: The X12 message filter list. + :type message_filter_list: list[~azure.mgmt.logic.models.X12MessageIdentifier] + :param schema_references: Required. The X12 schema references. + :type schema_references: list[~azure.mgmt.logic.models.X12SchemaReference] + :param x12_delimiter_overrides: The X12 delimiter override settings. + :type x12_delimiter_overrides: list[~azure.mgmt.logic.models.X12DelimiterOverrides] + """ + + _validation = { + 'validation_settings': {'required': True}, + 'framing_settings': {'required': True}, + 'envelope_settings': {'required': True}, + 'acknowledgement_settings': {'required': True}, + 'message_filter': {'required': True}, + 'security_settings': {'required': True}, + 'processing_settings': {'required': True}, + 'schema_references': {'required': True}, + } + + _attribute_map = { + 'validation_settings': {'key': 'validationSettings', 'type': 'X12ValidationSettings'}, + 'framing_settings': {'key': 'framingSettings', 'type': 'X12FramingSettings'}, + 'envelope_settings': {'key': 'envelopeSettings', 'type': 'X12EnvelopeSettings'}, + 'acknowledgement_settings': {'key': 'acknowledgementSettings', 'type': 'X12AcknowledgementSettings'}, + 'message_filter': {'key': 'messageFilter', 'type': 'X12MessageFilter'}, + 'security_settings': {'key': 'securitySettings', 'type': 'X12SecuritySettings'}, + 'processing_settings': {'key': 'processingSettings', 'type': 'X12ProcessingSettings'}, + 'envelope_overrides': {'key': 'envelopeOverrides', 'type': '[X12EnvelopeOverride]'}, + 'validation_overrides': {'key': 'validationOverrides', 'type': '[X12ValidationOverride]'}, + 'message_filter_list': {'key': 'messageFilterList', 'type': '[X12MessageIdentifier]'}, + 'schema_references': {'key': 'schemaReferences', 'type': '[X12SchemaReference]'}, + 'x12_delimiter_overrides': {'key': 'x12DelimiterOverrides', 'type': '[X12DelimiterOverrides]'}, + } + + def __init__( + self, + **kwargs + ): + super(X12ProtocolSettings, self).__init__(**kwargs) + self.validation_settings = kwargs['validation_settings'] + self.framing_settings = kwargs['framing_settings'] + self.envelope_settings = kwargs['envelope_settings'] + self.acknowledgement_settings = kwargs['acknowledgement_settings'] + self.message_filter = kwargs['message_filter'] + self.security_settings = kwargs['security_settings'] + self.processing_settings = kwargs['processing_settings'] + self.envelope_overrides = kwargs.get('envelope_overrides', None) + self.validation_overrides = kwargs.get('validation_overrides', None) + self.message_filter_list = kwargs.get('message_filter_list', None) + self.schema_references = kwargs['schema_references'] + self.x12_delimiter_overrides = kwargs.get('x12_delimiter_overrides', None) + + +class X12SchemaReference(msrest.serialization.Model): + """The X12 schema reference. + + All required parameters must be populated in order to send to Azure. + + :param message_id: Required. The message id. + :type message_id: str + :param sender_application_id: The sender application id. + :type sender_application_id: str + :param schema_version: Required. The schema version. + :type schema_version: str + :param schema_name: Required. The schema name. + :type schema_name: str + """ + + _validation = { + 'message_id': {'required': True}, + 'schema_version': {'required': True}, + 'schema_name': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'sender_application_id': {'key': 'senderApplicationId', 'type': 'str'}, + 'schema_version': {'key': 'schemaVersion', 'type': 'str'}, + 'schema_name': {'key': 'schemaName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(X12SchemaReference, self).__init__(**kwargs) + self.message_id = kwargs['message_id'] + self.sender_application_id = kwargs.get('sender_application_id', None) + self.schema_version = kwargs['schema_version'] + self.schema_name = kwargs['schema_name'] + + +class X12SecuritySettings(msrest.serialization.Model): + """The X12 agreement security settings. + + All required parameters must be populated in order to send to Azure. + + :param authorization_qualifier: Required. The authorization qualifier. + :type authorization_qualifier: str + :param authorization_value: The authorization value. + :type authorization_value: str + :param security_qualifier: Required. The security qualifier. + :type security_qualifier: str + :param password_value: The password value. + :type password_value: str + """ + + _validation = { + 'authorization_qualifier': {'required': True}, + 'security_qualifier': {'required': True}, + } + + _attribute_map = { + 'authorization_qualifier': {'key': 'authorizationQualifier', 'type': 'str'}, + 'authorization_value': {'key': 'authorizationValue', 'type': 'str'}, + 'security_qualifier': {'key': 'securityQualifier', 'type': 'str'}, + 'password_value': {'key': 'passwordValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(X12SecuritySettings, self).__init__(**kwargs) + self.authorization_qualifier = kwargs['authorization_qualifier'] + self.authorization_value = kwargs.get('authorization_value', None) + self.security_qualifier = kwargs['security_qualifier'] + self.password_value = kwargs.get('password_value', None) + + +class X12ValidationOverride(msrest.serialization.Model): + """The X12 validation override settings. + + All required parameters must be populated in order to send to Azure. + + :param message_id: Required. The message id on which the validation settings has to be applied. + :type message_id: str + :param validate_edi_types: Required. The value indicating whether to validate EDI types. + :type validate_edi_types: bool + :param validate_xsd_types: Required. The value indicating whether to validate XSD types. + :type validate_xsd_types: bool + :param allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + allow leading and trailing spaces and zeroes. + :type allow_leading_and_trailing_spaces_and_zeroes: bool + :param validate_character_set: Required. The value indicating whether to validate character + Set. + :type validate_character_set: bool + :param trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + trim leading and trailing spaces and zeroes. + :type trim_leading_and_trailing_spaces_and_zeroes: bool + :param trailing_separator_policy: Required. The trailing separator policy. Possible values + include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :type trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy + """ + + _validation = { + 'message_id': {'required': True}, + 'validate_edi_types': {'required': True}, + 'validate_xsd_types': {'required': True}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'required': True}, + 'validate_character_set': {'required': True}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'required': True}, + 'trailing_separator_policy': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'validate_edi_types': {'key': 'validateEDITypes', 'type': 'bool'}, + 'validate_xsd_types': {'key': 'validateXSDTypes', 'type': 'bool'}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'key': 'allowLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + 'validate_character_set': {'key': 'validateCharacterSet', 'type': 'bool'}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'key': 'trimLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + 'trailing_separator_policy': {'key': 'trailingSeparatorPolicy', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(X12ValidationOverride, self).__init__(**kwargs) + self.message_id = kwargs['message_id'] + self.validate_edi_types = kwargs['validate_edi_types'] + self.validate_xsd_types = kwargs['validate_xsd_types'] + self.allow_leading_and_trailing_spaces_and_zeroes = kwargs['allow_leading_and_trailing_spaces_and_zeroes'] + self.validate_character_set = kwargs['validate_character_set'] + self.trim_leading_and_trailing_spaces_and_zeroes = kwargs['trim_leading_and_trailing_spaces_and_zeroes'] + self.trailing_separator_policy = kwargs['trailing_separator_policy'] + + +class X12ValidationSettings(msrest.serialization.Model): + """The X12 agreement validation settings. + + All required parameters must be populated in order to send to Azure. + + :param validate_character_set: Required. The value indicating whether to validate character set + in the message. + :type validate_character_set: bool + :param check_duplicate_interchange_control_number: Required. The value indicating whether to + check for duplicate interchange control number. + :type check_duplicate_interchange_control_number: bool + :param interchange_control_number_validity_days: Required. The validity period of interchange + control number. + :type interchange_control_number_validity_days: int + :param check_duplicate_group_control_number: Required. The value indicating whether to check + for duplicate group control number. + :type check_duplicate_group_control_number: bool + :param check_duplicate_transaction_set_control_number: Required. The value indicating whether + to check for duplicate transaction set control number. + :type check_duplicate_transaction_set_control_number: bool + :param validate_edi_types: Required. The value indicating whether to Whether to validate EDI + types. + :type validate_edi_types: bool + :param validate_xsd_types: Required. The value indicating whether to Whether to validate XSD + types. + :type validate_xsd_types: bool + :param allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + allow leading and trailing spaces and zeroes. + :type allow_leading_and_trailing_spaces_and_zeroes: bool + :param trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + trim leading and trailing spaces and zeroes. + :type trim_leading_and_trailing_spaces_and_zeroes: bool + :param trailing_separator_policy: Required. The trailing separator policy. Possible values + include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :type trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy + """ + + _validation = { + 'validate_character_set': {'required': True}, + 'check_duplicate_interchange_control_number': {'required': True}, + 'interchange_control_number_validity_days': {'required': True}, + 'check_duplicate_group_control_number': {'required': True}, + 'check_duplicate_transaction_set_control_number': {'required': True}, + 'validate_edi_types': {'required': True}, + 'validate_xsd_types': {'required': True}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'required': True}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'required': True}, + 'trailing_separator_policy': {'required': True}, + } + + _attribute_map = { + 'validate_character_set': {'key': 'validateCharacterSet', 'type': 'bool'}, + 'check_duplicate_interchange_control_number': {'key': 'checkDuplicateInterchangeControlNumber', 'type': 'bool'}, + 'interchange_control_number_validity_days': {'key': 'interchangeControlNumberValidityDays', 'type': 'int'}, + 'check_duplicate_group_control_number': {'key': 'checkDuplicateGroupControlNumber', 'type': 'bool'}, + 'check_duplicate_transaction_set_control_number': {'key': 'checkDuplicateTransactionSetControlNumber', 'type': 'bool'}, + 'validate_edi_types': {'key': 'validateEDITypes', 'type': 'bool'}, + 'validate_xsd_types': {'key': 'validateXSDTypes', 'type': 'bool'}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'key': 'allowLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'key': 'trimLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + 'trailing_separator_policy': {'key': 'trailingSeparatorPolicy', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(X12ValidationSettings, self).__init__(**kwargs) + self.validate_character_set = kwargs['validate_character_set'] + self.check_duplicate_interchange_control_number = kwargs['check_duplicate_interchange_control_number'] + self.interchange_control_number_validity_days = kwargs['interchange_control_number_validity_days'] + self.check_duplicate_group_control_number = kwargs['check_duplicate_group_control_number'] + self.check_duplicate_transaction_set_control_number = kwargs['check_duplicate_transaction_set_control_number'] + self.validate_edi_types = kwargs['validate_edi_types'] + self.validate_xsd_types = kwargs['validate_xsd_types'] + self.allow_leading_and_trailing_spaces_and_zeroes = kwargs['allow_leading_and_trailing_spaces_and_zeroes'] + self.trim_leading_and_trailing_spaces_and_zeroes = kwargs['trim_leading_and_trailing_spaces_and_zeroes'] + self.trailing_separator_policy = kwargs['trailing_separator_policy'] diff --git a/src/logic/azext_logic/vendored_sdks/logic/models/_models_py3.py b/src/logic/azext_logic/vendored_sdks/logic/models/_models_py3.py new file mode 100644 index 00000000000..7ccdd61abf5 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/models/_models_py3.py @@ -0,0 +1,8966 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AgreementContent(msrest.serialization.Model): + """The integration account agreement content. + + :param a_s2: The AS2 agreement content. + :type a_s2: ~azure.mgmt.logic.models.As2AgreementContent + :param x12: The X12 agreement content. + :type x12: ~azure.mgmt.logic.models.X12AgreementContent + :param edifact: The EDIFACT agreement content. + :type edifact: ~azure.mgmt.logic.models.EdifactAgreementContent + """ + + _attribute_map = { + 'a_s2': {'key': 'aS2', 'type': 'As2AgreementContent'}, + 'x12': {'key': 'x12', 'type': 'X12AgreementContent'}, + 'edifact': {'key': 'edifact', 'type': 'EdifactAgreementContent'}, + } + + def __init__( + self, + *, + a_s2: Optional["As2AgreementContent"] = None, + x12: Optional["X12AgreementContent"] = None, + edifact: Optional["EdifactAgreementContent"] = None, + **kwargs + ): + super(AgreementContent, self).__init__(**kwargs) + self.a_s2 = a_s2 + self.x12 = x12 + self.edifact = edifact + + +class ApiDeploymentParameterMetadata(msrest.serialization.Model): + """The API deployment parameter metadata. + + :param type: The type. + :type type: str + :param is_required: Indicates whether its required. + :type is_required: bool + :param display_name: The display name. + :type display_name: str + :param description: The description. + :type description: str + :param visibility: The visibility. Possible values include: "NotSpecified", "Default", + "Internal". + :type visibility: str or ~azure.mgmt.logic.models.ApiDeploymentParameterVisibility + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'is_required': {'key': 'isRequired', 'type': 'bool'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'visibility': {'key': 'visibility', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[str] = None, + is_required: Optional[bool] = None, + display_name: Optional[str] = None, + description: Optional[str] = None, + visibility: Optional[Union[str, "ApiDeploymentParameterVisibility"]] = None, + **kwargs + ): + super(ApiDeploymentParameterMetadata, self).__init__(**kwargs) + self.type = type + self.is_required = is_required + self.display_name = display_name + self.description = description + self.visibility = visibility + + +class ApiDeploymentParameterMetadataSet(msrest.serialization.Model): + """The API deployment parameters metadata. + + :param package_content_link: The package content link parameter. + :type package_content_link: ~azure.mgmt.logic.models.ApiDeploymentParameterMetadata + :param redis_cache_connection_string: The package content link parameter. + :type redis_cache_connection_string: ~azure.mgmt.logic.models.ApiDeploymentParameterMetadata + """ + + _attribute_map = { + 'package_content_link': {'key': 'packageContentLink', 'type': 'ApiDeploymentParameterMetadata'}, + 'redis_cache_connection_string': {'key': 'redisCacheConnectionString', 'type': 'ApiDeploymentParameterMetadata'}, + } + + def __init__( + self, + *, + package_content_link: Optional["ApiDeploymentParameterMetadata"] = None, + redis_cache_connection_string: Optional["ApiDeploymentParameterMetadata"] = None, + **kwargs + ): + super(ApiDeploymentParameterMetadataSet, self).__init__(**kwargs) + self.package_content_link = package_content_link + self.redis_cache_connection_string = redis_cache_connection_string + + +class Resource(msrest.serialization.Model): + """The base resource type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + """ + + _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}'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class ApiOperation(Resource): + """The api operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param properties: The api operations properties. + :type properties: ~azure.mgmt.logic.models.ApiOperationPropertiesDefinition + """ + + _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}'}, + 'properties': {'key': 'properties', 'type': 'ApiOperationPropertiesDefinition'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["ApiOperationPropertiesDefinition"] = None, + **kwargs + ): + super(ApiOperation, self).__init__(location=location, tags=tags, **kwargs) + self.properties = properties + + +class ApiOperationAnnotation(msrest.serialization.Model): + """The Api Operation Annotation. + + :param status: The status annotation. Possible values include: "NotSpecified", "Preview", + "Production". + :type status: str or ~azure.mgmt.logic.models.StatusAnnotation + :param family: The family. + :type family: str + :param revision: The revision. + :type revision: int + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'revision': {'key': 'revision', 'type': 'int'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "StatusAnnotation"]] = None, + family: Optional[str] = None, + revision: Optional[int] = None, + **kwargs + ): + super(ApiOperationAnnotation, self).__init__(**kwargs) + self.status = status + self.family = family + self.revision = revision + + +class ApiOperationListResult(msrest.serialization.Model): + """The list of managed API operations. + + :param value: The api operation definitions for an API. + :type value: list[~azure.mgmt.logic.models.ApiOperation] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApiOperation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ApiOperation"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ApiOperationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ApiOperationPropertiesDefinition(msrest.serialization.Model): + """The api operations properties. + + :param summary: The summary of the api operation. + :type summary: str + :param description: The description of the api operation. + :type description: str + :param visibility: The visibility of the api operation. + :type visibility: str + :param trigger: The trigger type of api operation. + :type trigger: str + :param trigger_hint: The trigger hint for the api operation. + :type trigger_hint: str + :param pageable: Indicates whether the api operation is pageable. + :type pageable: bool + :param annotation: The annotation of api operation. + :type annotation: ~azure.mgmt.logic.models.ApiOperationAnnotation + :param api: The api reference. + :type api: ~azure.mgmt.logic.models.ApiReference + :param inputs_definition: The operation inputs definition schema. + :type inputs_definition: ~azure.mgmt.logic.models.SwaggerSchema + :param responses_definition: The operation responses definition schemas. + :type responses_definition: dict[str, ~azure.mgmt.logic.models.SwaggerSchema] + :param is_webhook: Indicates whether the API operation is webhook or not. + :type is_webhook: bool + :param is_notification: Indicates whether the API operation is notification or not. + :type is_notification: bool + """ + + _attribute_map = { + 'summary': {'key': 'summary', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'visibility': {'key': 'visibility', 'type': 'str'}, + 'trigger': {'key': 'trigger', 'type': 'str'}, + 'trigger_hint': {'key': 'triggerHint', 'type': 'str'}, + 'pageable': {'key': 'pageable', 'type': 'bool'}, + 'annotation': {'key': 'annotation', 'type': 'ApiOperationAnnotation'}, + 'api': {'key': 'api', 'type': 'ApiReference'}, + 'inputs_definition': {'key': 'inputsDefinition', 'type': 'SwaggerSchema'}, + 'responses_definition': {'key': 'responsesDefinition', 'type': '{SwaggerSchema}'}, + 'is_webhook': {'key': 'isWebhook', 'type': 'bool'}, + 'is_notification': {'key': 'isNotification', 'type': 'bool'}, + } + + def __init__( + self, + *, + summary: Optional[str] = None, + description: Optional[str] = None, + visibility: Optional[str] = None, + trigger: Optional[str] = None, + trigger_hint: Optional[str] = None, + pageable: Optional[bool] = None, + annotation: Optional["ApiOperationAnnotation"] = None, + api: Optional["ApiReference"] = None, + inputs_definition: Optional["SwaggerSchema"] = None, + responses_definition: Optional[Dict[str, "SwaggerSchema"]] = None, + is_webhook: Optional[bool] = None, + is_notification: Optional[bool] = None, + **kwargs + ): + super(ApiOperationPropertiesDefinition, self).__init__(**kwargs) + self.summary = summary + self.description = description + self.visibility = visibility + self.trigger = trigger + self.trigger_hint = trigger_hint + self.pageable = pageable + self.annotation = annotation + self.api = api + self.inputs_definition = inputs_definition + self.responses_definition = responses_definition + self.is_webhook = is_webhook + self.is_notification = is_notification + + +class ResourceReference(msrest.serialization.Model): + """The resource reference. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The resource id. + :type id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(ResourceReference, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + + +class ApiReference(ResourceReference): + """The Api reference. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The resource id. + :type id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param display_name: The display name of the api. + :type display_name: str + :param description: The description of the api. + :type description: str + :param icon_uri: The icon uri of the api. + :type icon_uri: str + :param swagger: The swagger of the api. + :type swagger: object + :param brand_color: The brand color of the api. + :type brand_color: str + :param category: The tier. Possible values include: "NotSpecified", "Enterprise", "Standard", + "Premium". + :type category: str or ~azure.mgmt.logic.models.ApiTier + :param integration_service_environment: The integration service environment reference. + :type integration_service_environment: ~azure.mgmt.logic.models.ResourceReference + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'icon_uri': {'key': 'iconUri', 'type': 'str'}, + 'swagger': {'key': 'swagger', 'type': 'object'}, + 'brand_color': {'key': 'brandColor', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'integration_service_environment': {'key': 'integrationServiceEnvironment', 'type': 'ResourceReference'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + display_name: Optional[str] = None, + description: Optional[str] = None, + icon_uri: Optional[str] = None, + swagger: Optional[object] = None, + brand_color: Optional[str] = None, + category: Optional[Union[str, "ApiTier"]] = None, + integration_service_environment: Optional["ResourceReference"] = None, + **kwargs + ): + super(ApiReference, self).__init__(id=id, **kwargs) + self.display_name = display_name + self.description = description + self.icon_uri = icon_uri + self.swagger = swagger + self.brand_color = brand_color + self.category = category + self.integration_service_environment = integration_service_environment + + +class ApiResourceBackendService(msrest.serialization.Model): + """The API backend service. + + :param service_url: The service URL. + :type service_url: str + """ + + _attribute_map = { + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + service_url: Optional[str] = None, + **kwargs + ): + super(ApiResourceBackendService, self).__init__(**kwargs) + self.service_url = service_url + + +class ApiResourceDefinitions(msrest.serialization.Model): + """The Api resource definition. + + :param original_swagger_url: The original swagger url. + :type original_swagger_url: str + :param modified_swagger_url: The modified swagger url. + :type modified_swagger_url: str + """ + + _attribute_map = { + 'original_swagger_url': {'key': 'originalSwaggerUrl', 'type': 'str'}, + 'modified_swagger_url': {'key': 'modifiedSwaggerUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + original_swagger_url: Optional[str] = None, + modified_swagger_url: Optional[str] = None, + **kwargs + ): + super(ApiResourceDefinitions, self).__init__(**kwargs) + self.original_swagger_url = original_swagger_url + self.modified_swagger_url = modified_swagger_url + + +class ApiResourceGeneralInformation(msrest.serialization.Model): + """The API general information. + + :param icon_url: The icon url. + :type icon_url: str + :param display_name: The display name. + :type display_name: str + :param description: The description. + :type description: str + :param terms_of_use_url: The terms of use url. + :type terms_of_use_url: str + :param release_tag: The release tag. + :type release_tag: str + :param tier: The tier. Possible values include: "NotSpecified", "Enterprise", "Standard", + "Premium". + :type tier: str or ~azure.mgmt.logic.models.ApiTier + """ + + _attribute_map = { + 'icon_url': {'key': 'iconUrl', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'terms_of_use_url': {'key': 'termsOfUseUrl', 'type': 'str'}, + 'release_tag': {'key': 'releaseTag', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + icon_url: Optional[str] = None, + display_name: Optional[str] = None, + description: Optional[str] = None, + terms_of_use_url: Optional[str] = None, + release_tag: Optional[str] = None, + tier: Optional[Union[str, "ApiTier"]] = None, + **kwargs + ): + super(ApiResourceGeneralInformation, self).__init__(**kwargs) + self.icon_url = icon_url + self.display_name = display_name + self.description = description + self.terms_of_use_url = terms_of_use_url + self.release_tag = release_tag + self.tier = tier + + +class ApiResourceMetadata(msrest.serialization.Model): + """The api resource metadata. + + :param source: The source. + :type source: str + :param brand_color: The brand color. + :type brand_color: str + :param hide_key: The hide key. + :type hide_key: str + :param tags: A set of tags. The tags. + :type tags: dict[str, str] + :param api_type: The api type. Possible values include: "NotSpecified", "Rest", "Soap". + :type api_type: str or ~azure.mgmt.logic.models.ApiType + :param wsdl_service: The WSDL service. + :type wsdl_service: ~azure.mgmt.logic.models.WsdlService + :param wsdl_import_method: The WSDL import method. Possible values include: "NotSpecified", + "SoapToRest", "SoapPassThrough". + :type wsdl_import_method: str or ~azure.mgmt.logic.models.WsdlImportMethod + :param connection_type: The connection type. + :type connection_type: str + :param provisioning_state: The provisioning state. Possible values include: "NotSpecified", + "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", + "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :type provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState + :param deployment_parameters: The connector deployment parameters metadata. + :type deployment_parameters: ~azure.mgmt.logic.models.ApiDeploymentParameterMetadataSet + """ + + _attribute_map = { + 'source': {'key': 'source', 'type': 'str'}, + 'brand_color': {'key': 'brandColor', 'type': 'str'}, + 'hide_key': {'key': 'hideKey', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'api_type': {'key': 'ApiType', 'type': 'str'}, + 'wsdl_service': {'key': 'wsdlService', 'type': 'WsdlService'}, + 'wsdl_import_method': {'key': 'wsdlImportMethod', 'type': 'str'}, + 'connection_type': {'key': 'connectionType', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'deployment_parameters': {'key': 'deploymentParameters', 'type': 'ApiDeploymentParameterMetadataSet'}, + } + + def __init__( + self, + *, + source: Optional[str] = None, + brand_color: Optional[str] = None, + hide_key: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + api_type: Optional[Union[str, "ApiType"]] = None, + wsdl_service: Optional["WsdlService"] = None, + wsdl_import_method: Optional[Union[str, "WsdlImportMethod"]] = None, + connection_type: Optional[str] = None, + provisioning_state: Optional[Union[str, "WorkflowProvisioningState"]] = None, + deployment_parameters: Optional["ApiDeploymentParameterMetadataSet"] = None, + **kwargs + ): + super(ApiResourceMetadata, self).__init__(**kwargs) + self.source = source + self.brand_color = brand_color + self.hide_key = hide_key + self.tags = tags + self.api_type = api_type + self.wsdl_service = wsdl_service + self.wsdl_import_method = wsdl_import_method + self.connection_type = connection_type + self.provisioning_state = provisioning_state + self.deployment_parameters = deployment_parameters + + +class ApiResourcePolicies(msrest.serialization.Model): + """The API resource policies. + + :param content: The API level only policies XML as embedded content. + :type content: str + :param content_link: The content link to the policies. + :type content_link: str + """ + + _attribute_map = { + 'content': {'key': 'content', 'type': 'str'}, + 'content_link': {'key': 'contentLink', 'type': 'str'}, + } + + def __init__( + self, + *, + content: Optional[str] = None, + content_link: Optional[str] = None, + **kwargs + ): + super(ApiResourcePolicies, self).__init__(**kwargs) + self.content = content + self.content_link = content_link + + +class ApiResourceProperties(msrest.serialization.Model): + """The API resource properties. + + :param name: The name. + :type name: str + :param connection_parameters: The connection parameters. + :type connection_parameters: dict[str, object] + :param metadata: The metadata. + :type metadata: ~azure.mgmt.logic.models.ApiResourceMetadata + :param runtime_urls: The runtime urls. + :type runtime_urls: list[str] + :param general_information: The api general information. + :type general_information: ~azure.mgmt.logic.models.ApiResourceGeneralInformation + :param capabilities: The capabilities. + :type capabilities: list[str] + :param backend_service: The backend service. + :type backend_service: ~azure.mgmt.logic.models.ApiResourceBackendService + :param policies: The policies for the API. + :type policies: ~azure.mgmt.logic.models.ApiResourcePolicies + :param api_definition_url: The API definition. + :type api_definition_url: str + :param api_definitions: The api definitions. + :type api_definitions: ~azure.mgmt.logic.models.ApiResourceDefinitions + :param integration_service_environment: The integration service environment reference. + :type integration_service_environment: ~azure.mgmt.logic.models.ResourceReference + :param provisioning_state: The provisioning state. Possible values include: "NotSpecified", + "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", + "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :type provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState + :param category: The category. Possible values include: "NotSpecified", "Enterprise", + "Standard", "Premium". + :type category: str or ~azure.mgmt.logic.models.ApiTier + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'connection_parameters': {'key': 'connectionParameters', 'type': '{object}'}, + 'metadata': {'key': 'metadata', 'type': 'ApiResourceMetadata'}, + 'runtime_urls': {'key': 'runtimeUrls', 'type': '[str]'}, + 'general_information': {'key': 'generalInformation', 'type': 'ApiResourceGeneralInformation'}, + 'capabilities': {'key': 'capabilities', 'type': '[str]'}, + 'backend_service': {'key': 'backendService', 'type': 'ApiResourceBackendService'}, + 'policies': {'key': 'policies', 'type': 'ApiResourcePolicies'}, + 'api_definition_url': {'key': 'apiDefinitionUrl', 'type': 'str'}, + 'api_definitions': {'key': 'apiDefinitions', 'type': 'ApiResourceDefinitions'}, + 'integration_service_environment': {'key': 'integrationServiceEnvironment', 'type': 'ResourceReference'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + connection_parameters: Optional[Dict[str, object]] = None, + metadata: Optional["ApiResourceMetadata"] = None, + runtime_urls: Optional[List[str]] = None, + general_information: Optional["ApiResourceGeneralInformation"] = None, + capabilities: Optional[List[str]] = None, + backend_service: Optional["ApiResourceBackendService"] = None, + policies: Optional["ApiResourcePolicies"] = None, + api_definition_url: Optional[str] = None, + api_definitions: Optional["ApiResourceDefinitions"] = None, + integration_service_environment: Optional["ResourceReference"] = None, + provisioning_state: Optional[Union[str, "WorkflowProvisioningState"]] = None, + category: Optional[Union[str, "ApiTier"]] = None, + **kwargs + ): + super(ApiResourceProperties, self).__init__(**kwargs) + self.name = name + self.connection_parameters = connection_parameters + self.metadata = metadata + self.runtime_urls = runtime_urls + self.general_information = general_information + self.capabilities = capabilities + self.backend_service = backend_service + self.policies = policies + self.api_definition_url = api_definition_url + self.api_definitions = api_definitions + self.integration_service_environment = integration_service_environment + self.provisioning_state = provisioning_state + self.category = category + + +class ArtifactProperties(msrest.serialization.Model): + """The artifact properties definition. + + :param created_time: The artifact creation time. + :type created_time: ~datetime.datetime + :param changed_time: The artifact changed time. + :type changed_time: ~datetime.datetime + :param metadata: Any object. + :type metadata: object + """ + + _attribute_map = { + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + } + + def __init__( + self, + *, + created_time: Optional[datetime.datetime] = None, + changed_time: Optional[datetime.datetime] = None, + metadata: Optional[object] = None, + **kwargs + ): + super(ArtifactProperties, self).__init__(**kwargs) + self.created_time = created_time + self.changed_time = changed_time + self.metadata = metadata + + +class ArtifactContentPropertiesDefinition(ArtifactProperties): + """The artifact content properties definition. + + :param created_time: The artifact creation time. + :type created_time: ~datetime.datetime + :param changed_time: The artifact changed time. + :type changed_time: ~datetime.datetime + :param metadata: Any object. + :type metadata: object + :param content: Any object. + :type content: object + :param content_type: The content type. + :type content_type: str + :param content_link: The content link. + :type content_link: ~azure.mgmt.logic.models.ContentLink + """ + + _attribute_map = { + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + 'content': {'key': 'content', 'type': 'object'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'content_link': {'key': 'contentLink', 'type': 'ContentLink'}, + } + + def __init__( + self, + *, + created_time: Optional[datetime.datetime] = None, + changed_time: Optional[datetime.datetime] = None, + metadata: Optional[object] = None, + content: Optional[object] = None, + content_type: Optional[str] = None, + content_link: Optional["ContentLink"] = None, + **kwargs + ): + super(ArtifactContentPropertiesDefinition, self).__init__(created_time=created_time, changed_time=changed_time, metadata=metadata, **kwargs) + self.content = content + self.content_type = content_type + self.content_link = content_link + + +class As2AcknowledgementConnectionSettings(msrest.serialization.Model): + """The AS2 agreement acknowledgement connection settings. + + All required parameters must be populated in order to send to Azure. + + :param ignore_certificate_name_mismatch: Required. Indicates whether to ignore mismatch in + certificate name. + :type ignore_certificate_name_mismatch: bool + :param support_http_status_code_continue: Required. Indicates whether to support HTTP status + code 'CONTINUE'. + :type support_http_status_code_continue: bool + :param keep_http_connection_alive: Required. Indicates whether to keep the connection alive. + :type keep_http_connection_alive: bool + :param unfold_http_headers: Required. Indicates whether to unfold the HTTP headers. + :type unfold_http_headers: bool + """ + + _validation = { + 'ignore_certificate_name_mismatch': {'required': True}, + 'support_http_status_code_continue': {'required': True}, + 'keep_http_connection_alive': {'required': True}, + 'unfold_http_headers': {'required': True}, + } + + _attribute_map = { + 'ignore_certificate_name_mismatch': {'key': 'ignoreCertificateNameMismatch', 'type': 'bool'}, + 'support_http_status_code_continue': {'key': 'supportHttpStatusCodeContinue', 'type': 'bool'}, + 'keep_http_connection_alive': {'key': 'keepHttpConnectionAlive', 'type': 'bool'}, + 'unfold_http_headers': {'key': 'unfoldHttpHeaders', 'type': 'bool'}, + } + + def __init__( + self, + *, + ignore_certificate_name_mismatch: bool, + support_http_status_code_continue: bool, + keep_http_connection_alive: bool, + unfold_http_headers: bool, + **kwargs + ): + super(As2AcknowledgementConnectionSettings, self).__init__(**kwargs) + self.ignore_certificate_name_mismatch = ignore_certificate_name_mismatch + self.support_http_status_code_continue = support_http_status_code_continue + self.keep_http_connection_alive = keep_http_connection_alive + self.unfold_http_headers = unfold_http_headers + + +class As2AgreementContent(msrest.serialization.Model): + """The integration account AS2 agreement content. + + All required parameters must be populated in order to send to Azure. + + :param receive_agreement: Required. The AS2 one-way receive agreement. + :type receive_agreement: ~azure.mgmt.logic.models.As2OneWayAgreement + :param send_agreement: Required. The AS2 one-way send agreement. + :type send_agreement: ~azure.mgmt.logic.models.As2OneWayAgreement + """ + + _validation = { + 'receive_agreement': {'required': True}, + 'send_agreement': {'required': True}, + } + + _attribute_map = { + 'receive_agreement': {'key': 'receiveAgreement', 'type': 'As2OneWayAgreement'}, + 'send_agreement': {'key': 'sendAgreement', 'type': 'As2OneWayAgreement'}, + } + + def __init__( + self, + *, + receive_agreement: "As2OneWayAgreement", + send_agreement: "As2OneWayAgreement", + **kwargs + ): + super(As2AgreementContent, self).__init__(**kwargs) + self.receive_agreement = receive_agreement + self.send_agreement = send_agreement + + +class As2EnvelopeSettings(msrest.serialization.Model): + """The AS2 agreement envelope settings. + + All required parameters must be populated in order to send to Azure. + + :param message_content_type: Required. The message content type. + :type message_content_type: str + :param transmit_file_name_in_mime_header: Required. The value indicating whether to transmit + file name in mime header. + :type transmit_file_name_in_mime_header: bool + :param file_name_template: Required. The template for file name. + :type file_name_template: str + :param suspend_message_on_file_name_generation_error: Required. The value indicating whether to + suspend message on file name generation error. + :type suspend_message_on_file_name_generation_error: bool + :param autogenerate_file_name: Required. The value indicating whether to auto generate file + name. + :type autogenerate_file_name: bool + """ + + _validation = { + 'message_content_type': {'required': True}, + 'transmit_file_name_in_mime_header': {'required': True}, + 'file_name_template': {'required': True}, + 'suspend_message_on_file_name_generation_error': {'required': True}, + 'autogenerate_file_name': {'required': True}, + } + + _attribute_map = { + 'message_content_type': {'key': 'messageContentType', 'type': 'str'}, + 'transmit_file_name_in_mime_header': {'key': 'transmitFileNameInMimeHeader', 'type': 'bool'}, + 'file_name_template': {'key': 'fileNameTemplate', 'type': 'str'}, + 'suspend_message_on_file_name_generation_error': {'key': 'suspendMessageOnFileNameGenerationError', 'type': 'bool'}, + 'autogenerate_file_name': {'key': 'autogenerateFileName', 'type': 'bool'}, + } + + def __init__( + self, + *, + message_content_type: str, + transmit_file_name_in_mime_header: bool, + file_name_template: str, + suspend_message_on_file_name_generation_error: bool, + autogenerate_file_name: bool, + **kwargs + ): + super(As2EnvelopeSettings, self).__init__(**kwargs) + self.message_content_type = message_content_type + self.transmit_file_name_in_mime_header = transmit_file_name_in_mime_header + self.file_name_template = file_name_template + self.suspend_message_on_file_name_generation_error = suspend_message_on_file_name_generation_error + self.autogenerate_file_name = autogenerate_file_name + + +class As2ErrorSettings(msrest.serialization.Model): + """The AS2 agreement error settings. + + All required parameters must be populated in order to send to Azure. + + :param suspend_duplicate_message: Required. The value indicating whether to suspend duplicate + message. + :type suspend_duplicate_message: bool + :param resend_if_mdn_not_received: Required. The value indicating whether to resend message If + MDN is not received. + :type resend_if_mdn_not_received: bool + """ + + _validation = { + 'suspend_duplicate_message': {'required': True}, + 'resend_if_mdn_not_received': {'required': True}, + } + + _attribute_map = { + 'suspend_duplicate_message': {'key': 'suspendDuplicateMessage', 'type': 'bool'}, + 'resend_if_mdn_not_received': {'key': 'resendIfMDNNotReceived', 'type': 'bool'}, + } + + def __init__( + self, + *, + suspend_duplicate_message: bool, + resend_if_mdn_not_received: bool, + **kwargs + ): + super(As2ErrorSettings, self).__init__(**kwargs) + self.suspend_duplicate_message = suspend_duplicate_message + self.resend_if_mdn_not_received = resend_if_mdn_not_received + + +class As2MdnSettings(msrest.serialization.Model): + """The AS2 agreement mdn settings. + + All required parameters must be populated in order to send to Azure. + + :param need_mdn: Required. The value indicating whether to send or request a MDN. + :type need_mdn: bool + :param sign_mdn: Required. The value indicating whether the MDN needs to be signed or not. + :type sign_mdn: bool + :param send_mdn_asynchronously: Required. The value indicating whether to send the asynchronous + MDN. + :type send_mdn_asynchronously: bool + :param receipt_delivery_url: The receipt delivery URL. + :type receipt_delivery_url: str + :param disposition_notification_to: The disposition notification to header value. + :type disposition_notification_to: str + :param sign_outbound_mdn_if_optional: Required. The value indicating whether to sign the + outbound MDN if optional. + :type sign_outbound_mdn_if_optional: bool + :param mdn_text: The MDN text. + :type mdn_text: str + :param send_inbound_mdn_to_message_box: Required. The value indicating whether to send inbound + MDN to message box. + :type send_inbound_mdn_to_message_box: bool + :param mic_hashing_algorithm: Required. The signing or hashing algorithm. Possible values + include: "NotSpecified", "None", "MD5", "SHA1", "SHA2256", "SHA2384", "SHA2512". + :type mic_hashing_algorithm: str or ~azure.mgmt.logic.models.HashingAlgorithm + """ + + _validation = { + 'need_mdn': {'required': True}, + 'sign_mdn': {'required': True}, + 'send_mdn_asynchronously': {'required': True}, + 'sign_outbound_mdn_if_optional': {'required': True}, + 'send_inbound_mdn_to_message_box': {'required': True}, + 'mic_hashing_algorithm': {'required': True}, + } + + _attribute_map = { + 'need_mdn': {'key': 'needMDN', 'type': 'bool'}, + 'sign_mdn': {'key': 'signMDN', 'type': 'bool'}, + 'send_mdn_asynchronously': {'key': 'sendMDNAsynchronously', 'type': 'bool'}, + 'receipt_delivery_url': {'key': 'receiptDeliveryUrl', 'type': 'str'}, + 'disposition_notification_to': {'key': 'dispositionNotificationTo', 'type': 'str'}, + 'sign_outbound_mdn_if_optional': {'key': 'signOutboundMDNIfOptional', 'type': 'bool'}, + 'mdn_text': {'key': 'mdnText', 'type': 'str'}, + 'send_inbound_mdn_to_message_box': {'key': 'sendInboundMDNToMessageBox', 'type': 'bool'}, + 'mic_hashing_algorithm': {'key': 'micHashingAlgorithm', 'type': 'str'}, + } + + def __init__( + self, + *, + need_mdn: bool, + sign_mdn: bool, + send_mdn_asynchronously: bool, + sign_outbound_mdn_if_optional: bool, + send_inbound_mdn_to_message_box: bool, + mic_hashing_algorithm: Union[str, "HashingAlgorithm"], + receipt_delivery_url: Optional[str] = None, + disposition_notification_to: Optional[str] = None, + mdn_text: Optional[str] = None, + **kwargs + ): + super(As2MdnSettings, self).__init__(**kwargs) + self.need_mdn = need_mdn + self.sign_mdn = sign_mdn + self.send_mdn_asynchronously = send_mdn_asynchronously + self.receipt_delivery_url = receipt_delivery_url + self.disposition_notification_to = disposition_notification_to + self.sign_outbound_mdn_if_optional = sign_outbound_mdn_if_optional + self.mdn_text = mdn_text + self.send_inbound_mdn_to_message_box = send_inbound_mdn_to_message_box + self.mic_hashing_algorithm = mic_hashing_algorithm + + +class As2MessageConnectionSettings(msrest.serialization.Model): + """The AS2 agreement message connection settings. + + All required parameters must be populated in order to send to Azure. + + :param ignore_certificate_name_mismatch: Required. The value indicating whether to ignore + mismatch in certificate name. + :type ignore_certificate_name_mismatch: bool + :param support_http_status_code_continue: Required. The value indicating whether to support + HTTP status code 'CONTINUE'. + :type support_http_status_code_continue: bool + :param keep_http_connection_alive: Required. The value indicating whether to keep the + connection alive. + :type keep_http_connection_alive: bool + :param unfold_http_headers: Required. The value indicating whether to unfold the HTTP headers. + :type unfold_http_headers: bool + """ + + _validation = { + 'ignore_certificate_name_mismatch': {'required': True}, + 'support_http_status_code_continue': {'required': True}, + 'keep_http_connection_alive': {'required': True}, + 'unfold_http_headers': {'required': True}, + } + + _attribute_map = { + 'ignore_certificate_name_mismatch': {'key': 'ignoreCertificateNameMismatch', 'type': 'bool'}, + 'support_http_status_code_continue': {'key': 'supportHttpStatusCodeContinue', 'type': 'bool'}, + 'keep_http_connection_alive': {'key': 'keepHttpConnectionAlive', 'type': 'bool'}, + 'unfold_http_headers': {'key': 'unfoldHttpHeaders', 'type': 'bool'}, + } + + def __init__( + self, + *, + ignore_certificate_name_mismatch: bool, + support_http_status_code_continue: bool, + keep_http_connection_alive: bool, + unfold_http_headers: bool, + **kwargs + ): + super(As2MessageConnectionSettings, self).__init__(**kwargs) + self.ignore_certificate_name_mismatch = ignore_certificate_name_mismatch + self.support_http_status_code_continue = support_http_status_code_continue + self.keep_http_connection_alive = keep_http_connection_alive + self.unfold_http_headers = unfold_http_headers + + +class As2OneWayAgreement(msrest.serialization.Model): + """The integration account AS2 one-way agreement. + + All required parameters must be populated in order to send to Azure. + + :param sender_business_identity: Required. The sender business identity. + :type sender_business_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param receiver_business_identity: Required. The receiver business identity. + :type receiver_business_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param protocol_settings: Required. The AS2 protocol settings. + :type protocol_settings: ~azure.mgmt.logic.models.As2ProtocolSettings + """ + + _validation = { + 'sender_business_identity': {'required': True}, + 'receiver_business_identity': {'required': True}, + 'protocol_settings': {'required': True}, + } + + _attribute_map = { + 'sender_business_identity': {'key': 'senderBusinessIdentity', 'type': 'BusinessIdentity'}, + 'receiver_business_identity': {'key': 'receiverBusinessIdentity', 'type': 'BusinessIdentity'}, + 'protocol_settings': {'key': 'protocolSettings', 'type': 'As2ProtocolSettings'}, + } + + def __init__( + self, + *, + sender_business_identity: "BusinessIdentity", + receiver_business_identity: "BusinessIdentity", + protocol_settings: "As2ProtocolSettings", + **kwargs + ): + super(As2OneWayAgreement, self).__init__(**kwargs) + self.sender_business_identity = sender_business_identity + self.receiver_business_identity = receiver_business_identity + self.protocol_settings = protocol_settings + + +class As2ProtocolSettings(msrest.serialization.Model): + """The AS2 agreement protocol settings. + + All required parameters must be populated in order to send to Azure. + + :param message_connection_settings: Required. The message connection settings. + :type message_connection_settings: ~azure.mgmt.logic.models.As2MessageConnectionSettings + :param acknowledgement_connection_settings: Required. The acknowledgement connection settings. + :type acknowledgement_connection_settings: + ~azure.mgmt.logic.models.As2AcknowledgementConnectionSettings + :param mdn_settings: Required. The MDN settings. + :type mdn_settings: ~azure.mgmt.logic.models.As2MdnSettings + :param security_settings: Required. The security settings. + :type security_settings: ~azure.mgmt.logic.models.As2SecuritySettings + :param validation_settings: Required. The validation settings. + :type validation_settings: ~azure.mgmt.logic.models.As2ValidationSettings + :param envelope_settings: Required. The envelope settings. + :type envelope_settings: ~azure.mgmt.logic.models.As2EnvelopeSettings + :param error_settings: Required. The error settings. + :type error_settings: ~azure.mgmt.logic.models.As2ErrorSettings + """ + + _validation = { + 'message_connection_settings': {'required': True}, + 'acknowledgement_connection_settings': {'required': True}, + 'mdn_settings': {'required': True}, + 'security_settings': {'required': True}, + 'validation_settings': {'required': True}, + 'envelope_settings': {'required': True}, + 'error_settings': {'required': True}, + } + + _attribute_map = { + 'message_connection_settings': {'key': 'messageConnectionSettings', 'type': 'As2MessageConnectionSettings'}, + 'acknowledgement_connection_settings': {'key': 'acknowledgementConnectionSettings', 'type': 'As2AcknowledgementConnectionSettings'}, + 'mdn_settings': {'key': 'mdnSettings', 'type': 'As2MdnSettings'}, + 'security_settings': {'key': 'securitySettings', 'type': 'As2SecuritySettings'}, + 'validation_settings': {'key': 'validationSettings', 'type': 'As2ValidationSettings'}, + 'envelope_settings': {'key': 'envelopeSettings', 'type': 'As2EnvelopeSettings'}, + 'error_settings': {'key': 'errorSettings', 'type': 'As2ErrorSettings'}, + } + + def __init__( + self, + *, + message_connection_settings: "As2MessageConnectionSettings", + acknowledgement_connection_settings: "As2AcknowledgementConnectionSettings", + mdn_settings: "As2MdnSettings", + security_settings: "As2SecuritySettings", + validation_settings: "As2ValidationSettings", + envelope_settings: "As2EnvelopeSettings", + error_settings: "As2ErrorSettings", + **kwargs + ): + super(As2ProtocolSettings, self).__init__(**kwargs) + self.message_connection_settings = message_connection_settings + self.acknowledgement_connection_settings = acknowledgement_connection_settings + self.mdn_settings = mdn_settings + self.security_settings = security_settings + self.validation_settings = validation_settings + self.envelope_settings = envelope_settings + self.error_settings = error_settings + + +class As2SecuritySettings(msrest.serialization.Model): + """The AS2 agreement security settings. + + All required parameters must be populated in order to send to Azure. + + :param override_group_signing_certificate: Required. The value indicating whether to send or + request a MDN. + :type override_group_signing_certificate: bool + :param signing_certificate_name: The name of the signing certificate. + :type signing_certificate_name: str + :param encryption_certificate_name: The name of the encryption certificate. + :type encryption_certificate_name: str + :param enable_nrr_for_inbound_encoded_messages: Required. The value indicating whether to + enable NRR for inbound encoded messages. + :type enable_nrr_for_inbound_encoded_messages: bool + :param enable_nrr_for_inbound_decoded_messages: Required. The value indicating whether to + enable NRR for inbound decoded messages. + :type enable_nrr_for_inbound_decoded_messages: bool + :param enable_nrr_for_outbound_mdn: Required. The value indicating whether to enable NRR for + outbound MDN. + :type enable_nrr_for_outbound_mdn: bool + :param enable_nrr_for_outbound_encoded_messages: Required. The value indicating whether to + enable NRR for outbound encoded messages. + :type enable_nrr_for_outbound_encoded_messages: bool + :param enable_nrr_for_outbound_decoded_messages: Required. The value indicating whether to + enable NRR for outbound decoded messages. + :type enable_nrr_for_outbound_decoded_messages: bool + :param enable_nrr_for_inbound_mdn: Required. The value indicating whether to enable NRR for + inbound MDN. + :type enable_nrr_for_inbound_mdn: bool + :param sha2_algorithm_format: The Sha2 algorithm format. Valid values are Sha2, ShaHashSize, + ShaHyphenHashSize, Sha2UnderscoreHashSize. + :type sha2_algorithm_format: str + """ + + _validation = { + 'override_group_signing_certificate': {'required': True}, + 'enable_nrr_for_inbound_encoded_messages': {'required': True}, + 'enable_nrr_for_inbound_decoded_messages': {'required': True}, + 'enable_nrr_for_outbound_mdn': {'required': True}, + 'enable_nrr_for_outbound_encoded_messages': {'required': True}, + 'enable_nrr_for_outbound_decoded_messages': {'required': True}, + 'enable_nrr_for_inbound_mdn': {'required': True}, + } + + _attribute_map = { + 'override_group_signing_certificate': {'key': 'overrideGroupSigningCertificate', 'type': 'bool'}, + 'signing_certificate_name': {'key': 'signingCertificateName', 'type': 'str'}, + 'encryption_certificate_name': {'key': 'encryptionCertificateName', 'type': 'str'}, + 'enable_nrr_for_inbound_encoded_messages': {'key': 'enableNRRForInboundEncodedMessages', 'type': 'bool'}, + 'enable_nrr_for_inbound_decoded_messages': {'key': 'enableNRRForInboundDecodedMessages', 'type': 'bool'}, + 'enable_nrr_for_outbound_mdn': {'key': 'enableNRRForOutboundMDN', 'type': 'bool'}, + 'enable_nrr_for_outbound_encoded_messages': {'key': 'enableNRRForOutboundEncodedMessages', 'type': 'bool'}, + 'enable_nrr_for_outbound_decoded_messages': {'key': 'enableNRRForOutboundDecodedMessages', 'type': 'bool'}, + 'enable_nrr_for_inbound_mdn': {'key': 'enableNRRForInboundMDN', 'type': 'bool'}, + 'sha2_algorithm_format': {'key': 'sha2AlgorithmFormat', 'type': 'str'}, + } + + def __init__( + self, + *, + override_group_signing_certificate: bool, + enable_nrr_for_inbound_encoded_messages: bool, + enable_nrr_for_inbound_decoded_messages: bool, + enable_nrr_for_outbound_mdn: bool, + enable_nrr_for_outbound_encoded_messages: bool, + enable_nrr_for_outbound_decoded_messages: bool, + enable_nrr_for_inbound_mdn: bool, + signing_certificate_name: Optional[str] = None, + encryption_certificate_name: Optional[str] = None, + sha2_algorithm_format: Optional[str] = None, + **kwargs + ): + super(As2SecuritySettings, self).__init__(**kwargs) + self.override_group_signing_certificate = override_group_signing_certificate + self.signing_certificate_name = signing_certificate_name + self.encryption_certificate_name = encryption_certificate_name + self.enable_nrr_for_inbound_encoded_messages = enable_nrr_for_inbound_encoded_messages + self.enable_nrr_for_inbound_decoded_messages = enable_nrr_for_inbound_decoded_messages + self.enable_nrr_for_outbound_mdn = enable_nrr_for_outbound_mdn + self.enable_nrr_for_outbound_encoded_messages = enable_nrr_for_outbound_encoded_messages + self.enable_nrr_for_outbound_decoded_messages = enable_nrr_for_outbound_decoded_messages + self.enable_nrr_for_inbound_mdn = enable_nrr_for_inbound_mdn + self.sha2_algorithm_format = sha2_algorithm_format + + +class As2ValidationSettings(msrest.serialization.Model): + """The AS2 agreement validation settings. + + All required parameters must be populated in order to send to Azure. + + :param override_message_properties: Required. The value indicating whether to override incoming + message properties with those in agreement. + :type override_message_properties: bool + :param encrypt_message: Required. The value indicating whether the message has to be encrypted. + :type encrypt_message: bool + :param sign_message: Required. The value indicating whether the message has to be signed. + :type sign_message: bool + :param compress_message: Required. The value indicating whether the message has to be + compressed. + :type compress_message: bool + :param check_duplicate_message: Required. The value indicating whether to check for duplicate + message. + :type check_duplicate_message: bool + :param interchange_duplicates_validity_days: Required. The number of days to look back for + duplicate interchange. + :type interchange_duplicates_validity_days: int + :param check_certificate_revocation_list_on_send: Required. The value indicating whether to + check for certificate revocation list on send. + :type check_certificate_revocation_list_on_send: bool + :param check_certificate_revocation_list_on_receive: Required. The value indicating whether to + check for certificate revocation list on receive. + :type check_certificate_revocation_list_on_receive: bool + :param encryption_algorithm: Required. The encryption algorithm. Possible values include: + "NotSpecified", "None", "DES3", "RC2", "AES128", "AES192", "AES256". + :type encryption_algorithm: str or ~azure.mgmt.logic.models.EncryptionAlgorithm + :param signing_algorithm: The signing algorithm. Possible values include: "NotSpecified", + "Default", "SHA1", "SHA2256", "SHA2384", "SHA2512". + :type signing_algorithm: str or ~azure.mgmt.logic.models.SigningAlgorithm + """ + + _validation = { + 'override_message_properties': {'required': True}, + 'encrypt_message': {'required': True}, + 'sign_message': {'required': True}, + 'compress_message': {'required': True}, + 'check_duplicate_message': {'required': True}, + 'interchange_duplicates_validity_days': {'required': True}, + 'check_certificate_revocation_list_on_send': {'required': True}, + 'check_certificate_revocation_list_on_receive': {'required': True}, + 'encryption_algorithm': {'required': True}, + } + + _attribute_map = { + 'override_message_properties': {'key': 'overrideMessageProperties', 'type': 'bool'}, + 'encrypt_message': {'key': 'encryptMessage', 'type': 'bool'}, + 'sign_message': {'key': 'signMessage', 'type': 'bool'}, + 'compress_message': {'key': 'compressMessage', 'type': 'bool'}, + 'check_duplicate_message': {'key': 'checkDuplicateMessage', 'type': 'bool'}, + 'interchange_duplicates_validity_days': {'key': 'interchangeDuplicatesValidityDays', 'type': 'int'}, + 'check_certificate_revocation_list_on_send': {'key': 'checkCertificateRevocationListOnSend', 'type': 'bool'}, + 'check_certificate_revocation_list_on_receive': {'key': 'checkCertificateRevocationListOnReceive', 'type': 'bool'}, + 'encryption_algorithm': {'key': 'encryptionAlgorithm', 'type': 'str'}, + 'signing_algorithm': {'key': 'signingAlgorithm', 'type': 'str'}, + } + + def __init__( + self, + *, + override_message_properties: bool, + encrypt_message: bool, + sign_message: bool, + compress_message: bool, + check_duplicate_message: bool, + interchange_duplicates_validity_days: int, + check_certificate_revocation_list_on_send: bool, + check_certificate_revocation_list_on_receive: bool, + encryption_algorithm: Union[str, "EncryptionAlgorithm"], + signing_algorithm: Optional[Union[str, "SigningAlgorithm"]] = None, + **kwargs + ): + super(As2ValidationSettings, self).__init__(**kwargs) + self.override_message_properties = override_message_properties + self.encrypt_message = encrypt_message + self.sign_message = sign_message + self.compress_message = compress_message + self.check_duplicate_message = check_duplicate_message + self.interchange_duplicates_validity_days = interchange_duplicates_validity_days + self.check_certificate_revocation_list_on_send = check_certificate_revocation_list_on_send + self.check_certificate_revocation_list_on_receive = check_certificate_revocation_list_on_receive + self.encryption_algorithm = encryption_algorithm + self.signing_algorithm = signing_algorithm + + +class AssemblyCollection(msrest.serialization.Model): + """A collection of assembly definitions. + + :param value: + :type value: list[~azure.mgmt.logic.models.AssemblyDefinition] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AssemblyDefinition]'}, + } + + def __init__( + self, + *, + value: Optional[List["AssemblyDefinition"]] = None, + **kwargs + ): + super(AssemblyCollection, self).__init__(**kwargs) + self.value = value + + +class AssemblyDefinition(Resource): + """The assembly definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param properties: Required. The assembly properties. + :type properties: ~azure.mgmt.logic.models.AssemblyProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'required': 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}'}, + 'properties': {'key': 'properties', 'type': 'AssemblyProperties'}, + } + + def __init__( + self, + *, + properties: "AssemblyProperties", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(AssemblyDefinition, self).__init__(location=location, tags=tags, **kwargs) + self.properties = properties + + +class AssemblyProperties(ArtifactContentPropertiesDefinition): + """The assembly properties definition. + + All required parameters must be populated in order to send to Azure. + + :param created_time: The artifact creation time. + :type created_time: ~datetime.datetime + :param changed_time: The artifact changed time. + :type changed_time: ~datetime.datetime + :param metadata: Any object. + :type metadata: object + :param content: Any object. + :type content: object + :param content_type: The content type. + :type content_type: str + :param content_link: The content link. + :type content_link: ~azure.mgmt.logic.models.ContentLink + :param assembly_name: Required. The assembly name. + :type assembly_name: str + :param assembly_version: The assembly version. + :type assembly_version: str + :param assembly_culture: The assembly culture. + :type assembly_culture: str + :param assembly_public_key_token: The assembly public key token. + :type assembly_public_key_token: str + """ + + _validation = { + 'assembly_name': {'required': True}, + } + + _attribute_map = { + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + 'content': {'key': 'content', 'type': 'object'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'content_link': {'key': 'contentLink', 'type': 'ContentLink'}, + 'assembly_name': {'key': 'assemblyName', 'type': 'str'}, + 'assembly_version': {'key': 'assemblyVersion', 'type': 'str'}, + 'assembly_culture': {'key': 'assemblyCulture', 'type': 'str'}, + 'assembly_public_key_token': {'key': 'assemblyPublicKeyToken', 'type': 'str'}, + } + + def __init__( + self, + *, + assembly_name: str, + created_time: Optional[datetime.datetime] = None, + changed_time: Optional[datetime.datetime] = None, + metadata: Optional[object] = None, + content: Optional[object] = None, + content_type: Optional[str] = None, + content_link: Optional["ContentLink"] = None, + assembly_version: Optional[str] = None, + assembly_culture: Optional[str] = None, + assembly_public_key_token: Optional[str] = None, + **kwargs + ): + super(AssemblyProperties, self).__init__(created_time=created_time, changed_time=changed_time, metadata=metadata, content=content, content_type=content_type, content_link=content_link, **kwargs) + self.assembly_name = assembly_name + self.assembly_version = assembly_version + self.assembly_culture = assembly_culture + self.assembly_public_key_token = assembly_public_key_token + + +class ErrorInfo(msrest.serialization.Model): + """The error info. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code. + :type code: str + """ + + _validation = { + 'code': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__( + self, + *, + code: str, + **kwargs + ): + super(ErrorInfo, self).__init__(**kwargs) + self.code = code + + +class AzureResourceErrorInfo(ErrorInfo): + """The azure resource error info. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code. + :type code: str + :param message: Required. The error message. + :type message: str + :param details: The error details. + :type details: list[~azure.mgmt.logic.models.AzureResourceErrorInfo] + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[AzureResourceErrorInfo]'}, + } + + def __init__( + self, + *, + code: str, + message: str, + details: Optional[List["AzureResourceErrorInfo"]] = None, + **kwargs + ): + super(AzureResourceErrorInfo, self).__init__(code=code, **kwargs) + self.message = message + self.details = details + + +class B2BPartnerContent(msrest.serialization.Model): + """The B2B partner content. + + :param business_identities: The list of partner business identities. + :type business_identities: list[~azure.mgmt.logic.models.BusinessIdentity] + """ + + _attribute_map = { + 'business_identities': {'key': 'businessIdentities', 'type': '[BusinessIdentity]'}, + } + + def __init__( + self, + *, + business_identities: Optional[List["BusinessIdentity"]] = None, + **kwargs + ): + super(B2BPartnerContent, self).__init__(**kwargs) + self.business_identities = business_identities + + +class BatchConfiguration(Resource): + """The batch configuration resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param properties: Required. The batch configuration properties. + :type properties: ~azure.mgmt.logic.models.BatchConfigurationProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'required': 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}'}, + 'properties': {'key': 'properties', 'type': 'BatchConfigurationProperties'}, + } + + def __init__( + self, + *, + properties: "BatchConfigurationProperties", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(BatchConfiguration, self).__init__(location=location, tags=tags, **kwargs) + self.properties = properties + + +class BatchConfigurationCollection(msrest.serialization.Model): + """A collection of batch configurations. + + :param value: + :type value: list[~azure.mgmt.logic.models.BatchConfiguration] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[BatchConfiguration]'}, + } + + def __init__( + self, + *, + value: Optional[List["BatchConfiguration"]] = None, + **kwargs + ): + super(BatchConfigurationCollection, self).__init__(**kwargs) + self.value = value + + +class BatchConfigurationProperties(ArtifactProperties): + """The batch configuration properties definition. + + All required parameters must be populated in order to send to Azure. + + :param metadata: Any object. + :type metadata: object + :param batch_group_name: Required. The name of the batch group. + :type batch_group_name: str + :param release_criteria: Required. The batch release criteria. + :type release_criteria: ~azure.mgmt.logic.models.BatchReleaseCriteria + :param created_time: The created time. + :type created_time: ~datetime.datetime + :param changed_time: The changed time. + :type changed_time: ~datetime.datetime + """ + + _validation = { + 'batch_group_name': {'required': True}, + 'release_criteria': {'required': True}, + } + + _attribute_map = { + 'metadata': {'key': 'metadata', 'type': 'object'}, + 'batch_group_name': {'key': 'batchGroupName', 'type': 'str'}, + 'release_criteria': {'key': 'releaseCriteria', 'type': 'BatchReleaseCriteria'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + batch_group_name: str, + release_criteria: "BatchReleaseCriteria", + metadata: Optional[object] = None, + created_time: Optional[datetime.datetime] = None, + changed_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(BatchConfigurationProperties, self).__init__(metadata=metadata, **kwargs) + self.batch_group_name = batch_group_name + self.release_criteria = release_criteria + self.created_time = created_time + self.changed_time = changed_time + + +class BatchReleaseCriteria(msrest.serialization.Model): + """The batch release criteria. + + :param message_count: The message count. + :type message_count: int + :param batch_size: The batch size in bytes. + :type batch_size: int + :param recurrence: The recurrence. + :type recurrence: ~azure.mgmt.logic.models.WorkflowTriggerRecurrence + """ + + _attribute_map = { + 'message_count': {'key': 'messageCount', 'type': 'int'}, + 'batch_size': {'key': 'batchSize', 'type': 'int'}, + 'recurrence': {'key': 'recurrence', 'type': 'WorkflowTriggerRecurrence'}, + } + + def __init__( + self, + *, + message_count: Optional[int] = None, + batch_size: Optional[int] = None, + recurrence: Optional["WorkflowTriggerRecurrence"] = None, + **kwargs + ): + super(BatchReleaseCriteria, self).__init__(**kwargs) + self.message_count = message_count + self.batch_size = batch_size + self.recurrence = recurrence + + +class BusinessIdentity(msrest.serialization.Model): + """The integration account partner's business identity. + + All required parameters must be populated in order to send to Azure. + + :param qualifier: Required. The business identity qualifier e.g. as2identity, ZZ, ZZZ, 31, 32. + :type qualifier: str + :param value: Required. The user defined business identity value. + :type value: str + """ + + _validation = { + 'qualifier': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'qualifier': {'key': 'qualifier', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + qualifier: str, + value: str, + **kwargs + ): + super(BusinessIdentity, self).__init__(**kwargs) + self.qualifier = qualifier + self.value = value + + +class CallbackUrl(msrest.serialization.Model): + """The callback url. + + :param value: The URL value. + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[str] = None, + **kwargs + ): + super(CallbackUrl, self).__init__(**kwargs) + self.value = value + + +class ContentHash(msrest.serialization.Model): + """The content hash. + + :param algorithm: The algorithm of the content hash. + :type algorithm: str + :param value: The value of the content hash. + :type value: str + """ + + _attribute_map = { + 'algorithm': {'key': 'algorithm', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + algorithm: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(ContentHash, self).__init__(**kwargs) + self.algorithm = algorithm + self.value = value + + +class ContentLink(msrest.serialization.Model): + """The content link. + + :param uri: The content link URI. + :type uri: str + :param content_version: The content version. + :type content_version: str + :param content_size: The content size. + :type content_size: long + :param content_hash: The content hash. + :type content_hash: ~azure.mgmt.logic.models.ContentHash + :param metadata: The metadata. + :type metadata: object + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + 'content_version': {'key': 'contentVersion', 'type': 'str'}, + 'content_size': {'key': 'contentSize', 'type': 'long'}, + 'content_hash': {'key': 'contentHash', 'type': 'ContentHash'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + } + + def __init__( + self, + *, + uri: Optional[str] = None, + content_version: Optional[str] = None, + content_size: Optional[int] = None, + content_hash: Optional["ContentHash"] = None, + metadata: Optional[object] = None, + **kwargs + ): + super(ContentLink, self).__init__(**kwargs) + self.uri = uri + self.content_version = content_version + self.content_size = content_size + self.content_hash = content_hash + self.metadata = metadata + + +class Correlation(msrest.serialization.Model): + """The correlation property. + + :param client_tracking_id: The client tracking id. + :type client_tracking_id: str + """ + + _attribute_map = { + 'client_tracking_id': {'key': 'clientTrackingId', 'type': 'str'}, + } + + def __init__( + self, + *, + client_tracking_id: Optional[str] = None, + **kwargs + ): + super(Correlation, self).__init__(**kwargs) + self.client_tracking_id = client_tracking_id + + +class EdifactAcknowledgementSettings(msrest.serialization.Model): + """The Edifact agreement acknowledgement settings. + + All required parameters must be populated in order to send to Azure. + + :param need_technical_acknowledgement: Required. The value indicating whether technical + acknowledgement is needed. + :type need_technical_acknowledgement: bool + :param batch_technical_acknowledgements: Required. The value indicating whether to batch the + technical acknowledgements. + :type batch_technical_acknowledgements: bool + :param need_functional_acknowledgement: Required. The value indicating whether functional + acknowledgement is needed. + :type need_functional_acknowledgement: bool + :param batch_functional_acknowledgements: Required. The value indicating whether to batch + functional acknowledgements. + :type batch_functional_acknowledgements: bool + :param need_loop_for_valid_messages: Required. The value indicating whether a loop is needed + for valid messages. + :type need_loop_for_valid_messages: bool + :param send_synchronous_acknowledgement: Required. The value indicating whether to send + synchronous acknowledgement. + :type send_synchronous_acknowledgement: bool + :param acknowledgement_control_number_prefix: The acknowledgement control number prefix. + :type acknowledgement_control_number_prefix: str + :param acknowledgement_control_number_suffix: The acknowledgement control number suffix. + :type acknowledgement_control_number_suffix: str + :param acknowledgement_control_number_lower_bound: Required. The acknowledgement control number + lower bound. + :type acknowledgement_control_number_lower_bound: int + :param acknowledgement_control_number_upper_bound: Required. The acknowledgement control number + upper bound. + :type acknowledgement_control_number_upper_bound: int + :param rollover_acknowledgement_control_number: Required. The value indicating whether to + rollover acknowledgement control number. + :type rollover_acknowledgement_control_number: bool + """ + + _validation = { + 'need_technical_acknowledgement': {'required': True}, + 'batch_technical_acknowledgements': {'required': True}, + 'need_functional_acknowledgement': {'required': True}, + 'batch_functional_acknowledgements': {'required': True}, + 'need_loop_for_valid_messages': {'required': True}, + 'send_synchronous_acknowledgement': {'required': True}, + 'acknowledgement_control_number_lower_bound': {'required': True}, + 'acknowledgement_control_number_upper_bound': {'required': True}, + 'rollover_acknowledgement_control_number': {'required': True}, + } + + _attribute_map = { + 'need_technical_acknowledgement': {'key': 'needTechnicalAcknowledgement', 'type': 'bool'}, + 'batch_technical_acknowledgements': {'key': 'batchTechnicalAcknowledgements', 'type': 'bool'}, + 'need_functional_acknowledgement': {'key': 'needFunctionalAcknowledgement', 'type': 'bool'}, + 'batch_functional_acknowledgements': {'key': 'batchFunctionalAcknowledgements', 'type': 'bool'}, + 'need_loop_for_valid_messages': {'key': 'needLoopForValidMessages', 'type': 'bool'}, + 'send_synchronous_acknowledgement': {'key': 'sendSynchronousAcknowledgement', 'type': 'bool'}, + 'acknowledgement_control_number_prefix': {'key': 'acknowledgementControlNumberPrefix', 'type': 'str'}, + 'acknowledgement_control_number_suffix': {'key': 'acknowledgementControlNumberSuffix', 'type': 'str'}, + 'acknowledgement_control_number_lower_bound': {'key': 'acknowledgementControlNumberLowerBound', 'type': 'int'}, + 'acknowledgement_control_number_upper_bound': {'key': 'acknowledgementControlNumberUpperBound', 'type': 'int'}, + 'rollover_acknowledgement_control_number': {'key': 'rolloverAcknowledgementControlNumber', 'type': 'bool'}, + } + + def __init__( + self, + *, + need_technical_acknowledgement: bool, + batch_technical_acknowledgements: bool, + need_functional_acknowledgement: bool, + batch_functional_acknowledgements: bool, + need_loop_for_valid_messages: bool, + send_synchronous_acknowledgement: bool, + acknowledgement_control_number_lower_bound: int, + acknowledgement_control_number_upper_bound: int, + rollover_acknowledgement_control_number: bool, + acknowledgement_control_number_prefix: Optional[str] = None, + acknowledgement_control_number_suffix: Optional[str] = None, + **kwargs + ): + super(EdifactAcknowledgementSettings, self).__init__(**kwargs) + self.need_technical_acknowledgement = need_technical_acknowledgement + self.batch_technical_acknowledgements = batch_technical_acknowledgements + self.need_functional_acknowledgement = need_functional_acknowledgement + self.batch_functional_acknowledgements = batch_functional_acknowledgements + self.need_loop_for_valid_messages = need_loop_for_valid_messages + self.send_synchronous_acknowledgement = send_synchronous_acknowledgement + self.acknowledgement_control_number_prefix = acknowledgement_control_number_prefix + self.acknowledgement_control_number_suffix = acknowledgement_control_number_suffix + self.acknowledgement_control_number_lower_bound = acknowledgement_control_number_lower_bound + self.acknowledgement_control_number_upper_bound = acknowledgement_control_number_upper_bound + self.rollover_acknowledgement_control_number = rollover_acknowledgement_control_number + + +class EdifactAgreementContent(msrest.serialization.Model): + """The Edifact agreement content. + + All required parameters must be populated in order to send to Azure. + + :param receive_agreement: Required. The EDIFACT one-way receive agreement. + :type receive_agreement: ~azure.mgmt.logic.models.EdifactOneWayAgreement + :param send_agreement: Required. The EDIFACT one-way send agreement. + :type send_agreement: ~azure.mgmt.logic.models.EdifactOneWayAgreement + """ + + _validation = { + 'receive_agreement': {'required': True}, + 'send_agreement': {'required': True}, + } + + _attribute_map = { + 'receive_agreement': {'key': 'receiveAgreement', 'type': 'EdifactOneWayAgreement'}, + 'send_agreement': {'key': 'sendAgreement', 'type': 'EdifactOneWayAgreement'}, + } + + def __init__( + self, + *, + receive_agreement: "EdifactOneWayAgreement", + send_agreement: "EdifactOneWayAgreement", + **kwargs + ): + super(EdifactAgreementContent, self).__init__(**kwargs) + self.receive_agreement = receive_agreement + self.send_agreement = send_agreement + + +class EdifactDelimiterOverride(msrest.serialization.Model): + """The Edifact delimiter override settings. + + All required parameters must be populated in order to send to Azure. + + :param message_id: The message id. + :type message_id: str + :param message_version: The message version. + :type message_version: str + :param message_release: The message release. + :type message_release: str + :param data_element_separator: Required. The data element separator. + :type data_element_separator: int + :param component_separator: Required. The component separator. + :type component_separator: int + :param segment_terminator: Required. The segment terminator. + :type segment_terminator: int + :param repetition_separator: Required. The repetition separator. + :type repetition_separator: int + :param segment_terminator_suffix: Required. The segment terminator suffix. Possible values + include: "NotSpecified", "None", "CR", "LF", "CRLF". + :type segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix + :param decimal_point_indicator: Required. The decimal point indicator. Possible values include: + "NotSpecified", "Comma", "Decimal". + :type decimal_point_indicator: str or ~azure.mgmt.logic.models.EdifactDecimalIndicator + :param release_indicator: Required. The release indicator. + :type release_indicator: int + :param message_association_assigned_code: The message association assigned code. + :type message_association_assigned_code: str + :param target_namespace: The target namespace on which this delimiter settings has to be + applied. + :type target_namespace: str + """ + + _validation = { + 'data_element_separator': {'required': True}, + 'component_separator': {'required': True}, + 'segment_terminator': {'required': True}, + 'repetition_separator': {'required': True}, + 'segment_terminator_suffix': {'required': True}, + 'decimal_point_indicator': {'required': True}, + 'release_indicator': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'message_version': {'key': 'messageVersion', 'type': 'str'}, + 'message_release': {'key': 'messageRelease', 'type': 'str'}, + 'data_element_separator': {'key': 'dataElementSeparator', 'type': 'int'}, + 'component_separator': {'key': 'componentSeparator', 'type': 'int'}, + 'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'}, + 'repetition_separator': {'key': 'repetitionSeparator', 'type': 'int'}, + 'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'}, + 'decimal_point_indicator': {'key': 'decimalPointIndicator', 'type': 'str'}, + 'release_indicator': {'key': 'releaseIndicator', 'type': 'int'}, + 'message_association_assigned_code': {'key': 'messageAssociationAssignedCode', 'type': 'str'}, + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + } + + def __init__( + self, + *, + data_element_separator: int, + component_separator: int, + segment_terminator: int, + repetition_separator: int, + segment_terminator_suffix: Union[str, "SegmentTerminatorSuffix"], + decimal_point_indicator: Union[str, "EdifactDecimalIndicator"], + release_indicator: int, + message_id: Optional[str] = None, + message_version: Optional[str] = None, + message_release: Optional[str] = None, + message_association_assigned_code: Optional[str] = None, + target_namespace: Optional[str] = None, + **kwargs + ): + super(EdifactDelimiterOverride, self).__init__(**kwargs) + self.message_id = message_id + self.message_version = message_version + self.message_release = message_release + self.data_element_separator = data_element_separator + self.component_separator = component_separator + self.segment_terminator = segment_terminator + self.repetition_separator = repetition_separator + self.segment_terminator_suffix = segment_terminator_suffix + self.decimal_point_indicator = decimal_point_indicator + self.release_indicator = release_indicator + self.message_association_assigned_code = message_association_assigned_code + self.target_namespace = target_namespace + + +class EdifactEnvelopeOverride(msrest.serialization.Model): + """The Edifact envelope override settings. + + :param message_id: The message id on which this envelope settings has to be applied. + :type message_id: str + :param message_version: The message version on which this envelope settings has to be applied. + :type message_version: str + :param message_release: The message release version on which this envelope settings has to be + applied. + :type message_release: str + :param message_association_assigned_code: The message association assigned code. + :type message_association_assigned_code: str + :param target_namespace: The target namespace on which this envelope settings has to be + applied. + :type target_namespace: str + :param functional_group_id: The functional group id. + :type functional_group_id: str + :param sender_application_qualifier: The sender application qualifier. + :type sender_application_qualifier: str + :param sender_application_id: The sender application id. + :type sender_application_id: str + :param receiver_application_qualifier: The receiver application qualifier. + :type receiver_application_qualifier: str + :param receiver_application_id: The receiver application id. + :type receiver_application_id: str + :param controlling_agency_code: The controlling agency code. + :type controlling_agency_code: str + :param group_header_message_version: The group header message version. + :type group_header_message_version: str + :param group_header_message_release: The group header message release. + :type group_header_message_release: str + :param association_assigned_code: The association assigned code. + :type association_assigned_code: str + :param application_password: The application password. + :type application_password: str + """ + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'message_version': {'key': 'messageVersion', 'type': 'str'}, + 'message_release': {'key': 'messageRelease', 'type': 'str'}, + 'message_association_assigned_code': {'key': 'messageAssociationAssignedCode', 'type': 'str'}, + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + 'functional_group_id': {'key': 'functionalGroupId', 'type': 'str'}, + 'sender_application_qualifier': {'key': 'senderApplicationQualifier', 'type': 'str'}, + 'sender_application_id': {'key': 'senderApplicationId', 'type': 'str'}, + 'receiver_application_qualifier': {'key': 'receiverApplicationQualifier', 'type': 'str'}, + 'receiver_application_id': {'key': 'receiverApplicationId', 'type': 'str'}, + 'controlling_agency_code': {'key': 'controllingAgencyCode', 'type': 'str'}, + 'group_header_message_version': {'key': 'groupHeaderMessageVersion', 'type': 'str'}, + 'group_header_message_release': {'key': 'groupHeaderMessageRelease', 'type': 'str'}, + 'association_assigned_code': {'key': 'associationAssignedCode', 'type': 'str'}, + 'application_password': {'key': 'applicationPassword', 'type': 'str'}, + } + + def __init__( + self, + *, + message_id: Optional[str] = None, + message_version: Optional[str] = None, + message_release: Optional[str] = None, + message_association_assigned_code: Optional[str] = None, + target_namespace: Optional[str] = None, + functional_group_id: Optional[str] = None, + sender_application_qualifier: Optional[str] = None, + sender_application_id: Optional[str] = None, + receiver_application_qualifier: Optional[str] = None, + receiver_application_id: Optional[str] = None, + controlling_agency_code: Optional[str] = None, + group_header_message_version: Optional[str] = None, + group_header_message_release: Optional[str] = None, + association_assigned_code: Optional[str] = None, + application_password: Optional[str] = None, + **kwargs + ): + super(EdifactEnvelopeOverride, self).__init__(**kwargs) + self.message_id = message_id + self.message_version = message_version + self.message_release = message_release + self.message_association_assigned_code = message_association_assigned_code + self.target_namespace = target_namespace + self.functional_group_id = functional_group_id + self.sender_application_qualifier = sender_application_qualifier + self.sender_application_id = sender_application_id + self.receiver_application_qualifier = receiver_application_qualifier + self.receiver_application_id = receiver_application_id + self.controlling_agency_code = controlling_agency_code + self.group_header_message_version = group_header_message_version + self.group_header_message_release = group_header_message_release + self.association_assigned_code = association_assigned_code + self.application_password = application_password + + +class EdifactEnvelopeSettings(msrest.serialization.Model): + """The Edifact agreement envelope settings. + + All required parameters must be populated in order to send to Azure. + + :param group_association_assigned_code: The group association assigned code. + :type group_association_assigned_code: str + :param communication_agreement_id: The communication agreement id. + :type communication_agreement_id: str + :param apply_delimiter_string_advice: Required. The value indicating whether to apply delimiter + string advice. + :type apply_delimiter_string_advice: bool + :param create_grouping_segments: Required. The value indicating whether to create grouping + segments. + :type create_grouping_segments: bool + :param enable_default_group_headers: Required. The value indicating whether to enable default + group headers. + :type enable_default_group_headers: bool + :param recipient_reference_password_value: The recipient reference password value. + :type recipient_reference_password_value: str + :param recipient_reference_password_qualifier: The recipient reference password qualifier. + :type recipient_reference_password_qualifier: str + :param application_reference_id: The application reference id. + :type application_reference_id: str + :param processing_priority_code: The processing priority code. + :type processing_priority_code: str + :param interchange_control_number_lower_bound: Required. The interchange control number lower + bound. + :type interchange_control_number_lower_bound: long + :param interchange_control_number_upper_bound: Required. The interchange control number upper + bound. + :type interchange_control_number_upper_bound: long + :param rollover_interchange_control_number: Required. The value indicating whether to rollover + interchange control number. + :type rollover_interchange_control_number: bool + :param interchange_control_number_prefix: The interchange control number prefix. + :type interchange_control_number_prefix: str + :param interchange_control_number_suffix: The interchange control number suffix. + :type interchange_control_number_suffix: str + :param sender_reverse_routing_address: The sender reverse routing address. + :type sender_reverse_routing_address: str + :param receiver_reverse_routing_address: The receiver reverse routing address. + :type receiver_reverse_routing_address: str + :param functional_group_id: The functional group id. + :type functional_group_id: str + :param group_controlling_agency_code: The group controlling agency code. + :type group_controlling_agency_code: str + :param group_message_version: The group message version. + :type group_message_version: str + :param group_message_release: The group message release. + :type group_message_release: str + :param group_control_number_lower_bound: Required. The group control number lower bound. + :type group_control_number_lower_bound: long + :param group_control_number_upper_bound: Required. The group control number upper bound. + :type group_control_number_upper_bound: long + :param rollover_group_control_number: Required. The value indicating whether to rollover group + control number. + :type rollover_group_control_number: bool + :param group_control_number_prefix: The group control number prefix. + :type group_control_number_prefix: str + :param group_control_number_suffix: The group control number suffix. + :type group_control_number_suffix: str + :param group_application_receiver_qualifier: The group application receiver qualifier. + :type group_application_receiver_qualifier: str + :param group_application_receiver_id: The group application receiver id. + :type group_application_receiver_id: str + :param group_application_sender_qualifier: The group application sender qualifier. + :type group_application_sender_qualifier: str + :param group_application_sender_id: The group application sender id. + :type group_application_sender_id: str + :param group_application_password: The group application password. + :type group_application_password: str + :param overwrite_existing_transaction_set_control_number: Required. The value indicating + whether to overwrite existing transaction set control number. + :type overwrite_existing_transaction_set_control_number: bool + :param transaction_set_control_number_prefix: The transaction set control number prefix. + :type transaction_set_control_number_prefix: str + :param transaction_set_control_number_suffix: The transaction set control number suffix. + :type transaction_set_control_number_suffix: str + :param transaction_set_control_number_lower_bound: Required. The transaction set control number + lower bound. + :type transaction_set_control_number_lower_bound: long + :param transaction_set_control_number_upper_bound: Required. The transaction set control number + upper bound. + :type transaction_set_control_number_upper_bound: long + :param rollover_transaction_set_control_number: Required. The value indicating whether to + rollover transaction set control number. + :type rollover_transaction_set_control_number: bool + :param is_test_interchange: Required. The value indicating whether the message is a test + interchange. + :type is_test_interchange: bool + :param sender_internal_identification: The sender internal identification. + :type sender_internal_identification: str + :param sender_internal_sub_identification: The sender internal sub identification. + :type sender_internal_sub_identification: str + :param receiver_internal_identification: The receiver internal identification. + :type receiver_internal_identification: str + :param receiver_internal_sub_identification: The receiver internal sub identification. + :type receiver_internal_sub_identification: str + """ + + _validation = { + 'apply_delimiter_string_advice': {'required': True}, + 'create_grouping_segments': {'required': True}, + 'enable_default_group_headers': {'required': True}, + 'interchange_control_number_lower_bound': {'required': True}, + 'interchange_control_number_upper_bound': {'required': True}, + 'rollover_interchange_control_number': {'required': True}, + 'group_control_number_lower_bound': {'required': True}, + 'group_control_number_upper_bound': {'required': True}, + 'rollover_group_control_number': {'required': True}, + 'overwrite_existing_transaction_set_control_number': {'required': True}, + 'transaction_set_control_number_lower_bound': {'required': True}, + 'transaction_set_control_number_upper_bound': {'required': True}, + 'rollover_transaction_set_control_number': {'required': True}, + 'is_test_interchange': {'required': True}, + } + + _attribute_map = { + 'group_association_assigned_code': {'key': 'groupAssociationAssignedCode', 'type': 'str'}, + 'communication_agreement_id': {'key': 'communicationAgreementId', 'type': 'str'}, + 'apply_delimiter_string_advice': {'key': 'applyDelimiterStringAdvice', 'type': 'bool'}, + 'create_grouping_segments': {'key': 'createGroupingSegments', 'type': 'bool'}, + 'enable_default_group_headers': {'key': 'enableDefaultGroupHeaders', 'type': 'bool'}, + 'recipient_reference_password_value': {'key': 'recipientReferencePasswordValue', 'type': 'str'}, + 'recipient_reference_password_qualifier': {'key': 'recipientReferencePasswordQualifier', 'type': 'str'}, + 'application_reference_id': {'key': 'applicationReferenceId', 'type': 'str'}, + 'processing_priority_code': {'key': 'processingPriorityCode', 'type': 'str'}, + 'interchange_control_number_lower_bound': {'key': 'interchangeControlNumberLowerBound', 'type': 'long'}, + 'interchange_control_number_upper_bound': {'key': 'interchangeControlNumberUpperBound', 'type': 'long'}, + 'rollover_interchange_control_number': {'key': 'rolloverInterchangeControlNumber', 'type': 'bool'}, + 'interchange_control_number_prefix': {'key': 'interchangeControlNumberPrefix', 'type': 'str'}, + 'interchange_control_number_suffix': {'key': 'interchangeControlNumberSuffix', 'type': 'str'}, + 'sender_reverse_routing_address': {'key': 'senderReverseRoutingAddress', 'type': 'str'}, + 'receiver_reverse_routing_address': {'key': 'receiverReverseRoutingAddress', 'type': 'str'}, + 'functional_group_id': {'key': 'functionalGroupId', 'type': 'str'}, + 'group_controlling_agency_code': {'key': 'groupControllingAgencyCode', 'type': 'str'}, + 'group_message_version': {'key': 'groupMessageVersion', 'type': 'str'}, + 'group_message_release': {'key': 'groupMessageRelease', 'type': 'str'}, + 'group_control_number_lower_bound': {'key': 'groupControlNumberLowerBound', 'type': 'long'}, + 'group_control_number_upper_bound': {'key': 'groupControlNumberUpperBound', 'type': 'long'}, + 'rollover_group_control_number': {'key': 'rolloverGroupControlNumber', 'type': 'bool'}, + 'group_control_number_prefix': {'key': 'groupControlNumberPrefix', 'type': 'str'}, + 'group_control_number_suffix': {'key': 'groupControlNumberSuffix', 'type': 'str'}, + 'group_application_receiver_qualifier': {'key': 'groupApplicationReceiverQualifier', 'type': 'str'}, + 'group_application_receiver_id': {'key': 'groupApplicationReceiverId', 'type': 'str'}, + 'group_application_sender_qualifier': {'key': 'groupApplicationSenderQualifier', 'type': 'str'}, + 'group_application_sender_id': {'key': 'groupApplicationSenderId', 'type': 'str'}, + 'group_application_password': {'key': 'groupApplicationPassword', 'type': 'str'}, + 'overwrite_existing_transaction_set_control_number': {'key': 'overwriteExistingTransactionSetControlNumber', 'type': 'bool'}, + 'transaction_set_control_number_prefix': {'key': 'transactionSetControlNumberPrefix', 'type': 'str'}, + 'transaction_set_control_number_suffix': {'key': 'transactionSetControlNumberSuffix', 'type': 'str'}, + 'transaction_set_control_number_lower_bound': {'key': 'transactionSetControlNumberLowerBound', 'type': 'long'}, + 'transaction_set_control_number_upper_bound': {'key': 'transactionSetControlNumberUpperBound', 'type': 'long'}, + 'rollover_transaction_set_control_number': {'key': 'rolloverTransactionSetControlNumber', 'type': 'bool'}, + 'is_test_interchange': {'key': 'isTestInterchange', 'type': 'bool'}, + 'sender_internal_identification': {'key': 'senderInternalIdentification', 'type': 'str'}, + 'sender_internal_sub_identification': {'key': 'senderInternalSubIdentification', 'type': 'str'}, + 'receiver_internal_identification': {'key': 'receiverInternalIdentification', 'type': 'str'}, + 'receiver_internal_sub_identification': {'key': 'receiverInternalSubIdentification', 'type': 'str'}, + } + + def __init__( + self, + *, + apply_delimiter_string_advice: bool, + create_grouping_segments: bool, + enable_default_group_headers: bool, + interchange_control_number_lower_bound: int, + interchange_control_number_upper_bound: int, + rollover_interchange_control_number: bool, + group_control_number_lower_bound: int, + group_control_number_upper_bound: int, + rollover_group_control_number: bool, + overwrite_existing_transaction_set_control_number: bool, + transaction_set_control_number_lower_bound: int, + transaction_set_control_number_upper_bound: int, + rollover_transaction_set_control_number: bool, + is_test_interchange: bool, + group_association_assigned_code: Optional[str] = None, + communication_agreement_id: Optional[str] = None, + recipient_reference_password_value: Optional[str] = None, + recipient_reference_password_qualifier: Optional[str] = None, + application_reference_id: Optional[str] = None, + processing_priority_code: Optional[str] = None, + interchange_control_number_prefix: Optional[str] = None, + interchange_control_number_suffix: Optional[str] = None, + sender_reverse_routing_address: Optional[str] = None, + receiver_reverse_routing_address: Optional[str] = None, + functional_group_id: Optional[str] = None, + group_controlling_agency_code: Optional[str] = None, + group_message_version: Optional[str] = None, + group_message_release: Optional[str] = None, + group_control_number_prefix: Optional[str] = None, + group_control_number_suffix: Optional[str] = None, + group_application_receiver_qualifier: Optional[str] = None, + group_application_receiver_id: Optional[str] = None, + group_application_sender_qualifier: Optional[str] = None, + group_application_sender_id: Optional[str] = None, + group_application_password: Optional[str] = None, + transaction_set_control_number_prefix: Optional[str] = None, + transaction_set_control_number_suffix: Optional[str] = None, + sender_internal_identification: Optional[str] = None, + sender_internal_sub_identification: Optional[str] = None, + receiver_internal_identification: Optional[str] = None, + receiver_internal_sub_identification: Optional[str] = None, + **kwargs + ): + super(EdifactEnvelopeSettings, self).__init__(**kwargs) + self.group_association_assigned_code = group_association_assigned_code + self.communication_agreement_id = communication_agreement_id + self.apply_delimiter_string_advice = apply_delimiter_string_advice + self.create_grouping_segments = create_grouping_segments + self.enable_default_group_headers = enable_default_group_headers + self.recipient_reference_password_value = recipient_reference_password_value + self.recipient_reference_password_qualifier = recipient_reference_password_qualifier + self.application_reference_id = application_reference_id + self.processing_priority_code = processing_priority_code + self.interchange_control_number_lower_bound = interchange_control_number_lower_bound + self.interchange_control_number_upper_bound = interchange_control_number_upper_bound + self.rollover_interchange_control_number = rollover_interchange_control_number + self.interchange_control_number_prefix = interchange_control_number_prefix + self.interchange_control_number_suffix = interchange_control_number_suffix + self.sender_reverse_routing_address = sender_reverse_routing_address + self.receiver_reverse_routing_address = receiver_reverse_routing_address + self.functional_group_id = functional_group_id + self.group_controlling_agency_code = group_controlling_agency_code + self.group_message_version = group_message_version + self.group_message_release = group_message_release + self.group_control_number_lower_bound = group_control_number_lower_bound + self.group_control_number_upper_bound = group_control_number_upper_bound + self.rollover_group_control_number = rollover_group_control_number + self.group_control_number_prefix = group_control_number_prefix + self.group_control_number_suffix = group_control_number_suffix + self.group_application_receiver_qualifier = group_application_receiver_qualifier + self.group_application_receiver_id = group_application_receiver_id + self.group_application_sender_qualifier = group_application_sender_qualifier + self.group_application_sender_id = group_application_sender_id + self.group_application_password = group_application_password + self.overwrite_existing_transaction_set_control_number = overwrite_existing_transaction_set_control_number + self.transaction_set_control_number_prefix = transaction_set_control_number_prefix + self.transaction_set_control_number_suffix = transaction_set_control_number_suffix + self.transaction_set_control_number_lower_bound = transaction_set_control_number_lower_bound + self.transaction_set_control_number_upper_bound = transaction_set_control_number_upper_bound + self.rollover_transaction_set_control_number = rollover_transaction_set_control_number + self.is_test_interchange = is_test_interchange + self.sender_internal_identification = sender_internal_identification + self.sender_internal_sub_identification = sender_internal_sub_identification + self.receiver_internal_identification = receiver_internal_identification + self.receiver_internal_sub_identification = receiver_internal_sub_identification + + +class EdifactFramingSettings(msrest.serialization.Model): + """The Edifact agreement framing settings. + + All required parameters must be populated in order to send to Azure. + + :param service_code_list_directory_version: The service code list directory version. + :type service_code_list_directory_version: str + :param character_encoding: The character encoding. + :type character_encoding: str + :param protocol_version: Required. The protocol version. + :type protocol_version: int + :param data_element_separator: Required. The data element separator. + :type data_element_separator: int + :param component_separator: Required. The component separator. + :type component_separator: int + :param segment_terminator: Required. The segment terminator. + :type segment_terminator: int + :param release_indicator: Required. The release indicator. + :type release_indicator: int + :param repetition_separator: Required. The repetition separator. + :type repetition_separator: int + :param character_set: Required. The EDIFACT frame setting characterSet. Possible values + include: "NotSpecified", "UNOB", "UNOA", "UNOC", "UNOD", "UNOE", "UNOF", "UNOG", "UNOH", + "UNOI", "UNOJ", "UNOK", "UNOX", "UNOY", "KECA". + :type character_set: str or ~azure.mgmt.logic.models.EdifactCharacterSet + :param decimal_point_indicator: Required. The EDIFACT frame setting decimal indicator. Possible + values include: "NotSpecified", "Comma", "Decimal". + :type decimal_point_indicator: str or ~azure.mgmt.logic.models.EdifactDecimalIndicator + :param segment_terminator_suffix: Required. The EDIFACT frame setting segment terminator + suffix. Possible values include: "NotSpecified", "None", "CR", "LF", "CRLF". + :type segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix + """ + + _validation = { + 'protocol_version': {'required': True}, + 'data_element_separator': {'required': True}, + 'component_separator': {'required': True}, + 'segment_terminator': {'required': True}, + 'release_indicator': {'required': True}, + 'repetition_separator': {'required': True}, + 'character_set': {'required': True}, + 'decimal_point_indicator': {'required': True}, + 'segment_terminator_suffix': {'required': True}, + } + + _attribute_map = { + 'service_code_list_directory_version': {'key': 'serviceCodeListDirectoryVersion', 'type': 'str'}, + 'character_encoding': {'key': 'characterEncoding', 'type': 'str'}, + 'protocol_version': {'key': 'protocolVersion', 'type': 'int'}, + 'data_element_separator': {'key': 'dataElementSeparator', 'type': 'int'}, + 'component_separator': {'key': 'componentSeparator', 'type': 'int'}, + 'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'}, + 'release_indicator': {'key': 'releaseIndicator', 'type': 'int'}, + 'repetition_separator': {'key': 'repetitionSeparator', 'type': 'int'}, + 'character_set': {'key': 'characterSet', 'type': 'str'}, + 'decimal_point_indicator': {'key': 'decimalPointIndicator', 'type': 'str'}, + 'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'}, + } + + def __init__( + self, + *, + protocol_version: int, + data_element_separator: int, + component_separator: int, + segment_terminator: int, + release_indicator: int, + repetition_separator: int, + character_set: Union[str, "EdifactCharacterSet"], + decimal_point_indicator: Union[str, "EdifactDecimalIndicator"], + segment_terminator_suffix: Union[str, "SegmentTerminatorSuffix"], + service_code_list_directory_version: Optional[str] = None, + character_encoding: Optional[str] = None, + **kwargs + ): + super(EdifactFramingSettings, self).__init__(**kwargs) + self.service_code_list_directory_version = service_code_list_directory_version + self.character_encoding = character_encoding + self.protocol_version = protocol_version + self.data_element_separator = data_element_separator + self.component_separator = component_separator + self.segment_terminator = segment_terminator + self.release_indicator = release_indicator + self.repetition_separator = repetition_separator + self.character_set = character_set + self.decimal_point_indicator = decimal_point_indicator + self.segment_terminator_suffix = segment_terminator_suffix + + +class EdifactMessageFilter(msrest.serialization.Model): + """The Edifact message filter for odata query. + + All required parameters must be populated in order to send to Azure. + + :param message_filter_type: Required. The message filter type. Possible values include: + "NotSpecified", "Include", "Exclude". + :type message_filter_type: str or ~azure.mgmt.logic.models.MessageFilterType + """ + + _validation = { + 'message_filter_type': {'required': True}, + } + + _attribute_map = { + 'message_filter_type': {'key': 'messageFilterType', 'type': 'str'}, + } + + def __init__( + self, + *, + message_filter_type: Union[str, "MessageFilterType"], + **kwargs + ): + super(EdifactMessageFilter, self).__init__(**kwargs) + self.message_filter_type = message_filter_type + + +class EdifactMessageIdentifier(msrest.serialization.Model): + """The Edifact message identifier. + + All required parameters must be populated in order to send to Azure. + + :param message_id: Required. The message id on which this envelope settings has to be applied. + :type message_id: str + """ + + _validation = { + 'message_id': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + } + + def __init__( + self, + *, + message_id: str, + **kwargs + ): + super(EdifactMessageIdentifier, self).__init__(**kwargs) + self.message_id = message_id + + +class EdifactOneWayAgreement(msrest.serialization.Model): + """The Edifact one way agreement. + + All required parameters must be populated in order to send to Azure. + + :param sender_business_identity: Required. The sender business identity. + :type sender_business_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param receiver_business_identity: Required. The receiver business identity. + :type receiver_business_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param protocol_settings: Required. The EDIFACT protocol settings. + :type protocol_settings: ~azure.mgmt.logic.models.EdifactProtocolSettings + """ + + _validation = { + 'sender_business_identity': {'required': True}, + 'receiver_business_identity': {'required': True}, + 'protocol_settings': {'required': True}, + } + + _attribute_map = { + 'sender_business_identity': {'key': 'senderBusinessIdentity', 'type': 'BusinessIdentity'}, + 'receiver_business_identity': {'key': 'receiverBusinessIdentity', 'type': 'BusinessIdentity'}, + 'protocol_settings': {'key': 'protocolSettings', 'type': 'EdifactProtocolSettings'}, + } + + def __init__( + self, + *, + sender_business_identity: "BusinessIdentity", + receiver_business_identity: "BusinessIdentity", + protocol_settings: "EdifactProtocolSettings", + **kwargs + ): + super(EdifactOneWayAgreement, self).__init__(**kwargs) + self.sender_business_identity = sender_business_identity + self.receiver_business_identity = receiver_business_identity + self.protocol_settings = protocol_settings + + +class EdifactProcessingSettings(msrest.serialization.Model): + """The Edifact agreement protocol settings. + + All required parameters must be populated in order to send to Azure. + + :param mask_security_info: Required. The value indicating whether to mask security information. + :type mask_security_info: bool + :param preserve_interchange: Required. The value indicating whether to preserve interchange. + :type preserve_interchange: bool + :param suspend_interchange_on_error: Required. The value indicating whether to suspend + interchange on error. + :type suspend_interchange_on_error: bool + :param create_empty_xml_tags_for_trailing_separators: Required. The value indicating whether to + create empty xml tags for trailing separators. + :type create_empty_xml_tags_for_trailing_separators: bool + :param use_dot_as_decimal_separator: Required. The value indicating whether to use dot as + decimal separator. + :type use_dot_as_decimal_separator: bool + """ + + _validation = { + 'mask_security_info': {'required': True}, + 'preserve_interchange': {'required': True}, + 'suspend_interchange_on_error': {'required': True}, + 'create_empty_xml_tags_for_trailing_separators': {'required': True}, + 'use_dot_as_decimal_separator': {'required': True}, + } + + _attribute_map = { + 'mask_security_info': {'key': 'maskSecurityInfo', 'type': 'bool'}, + 'preserve_interchange': {'key': 'preserveInterchange', 'type': 'bool'}, + 'suspend_interchange_on_error': {'key': 'suspendInterchangeOnError', 'type': 'bool'}, + 'create_empty_xml_tags_for_trailing_separators': {'key': 'createEmptyXmlTagsForTrailingSeparators', 'type': 'bool'}, + 'use_dot_as_decimal_separator': {'key': 'useDotAsDecimalSeparator', 'type': 'bool'}, + } + + def __init__( + self, + *, + mask_security_info: bool, + preserve_interchange: bool, + suspend_interchange_on_error: bool, + create_empty_xml_tags_for_trailing_separators: bool, + use_dot_as_decimal_separator: bool, + **kwargs + ): + super(EdifactProcessingSettings, self).__init__(**kwargs) + self.mask_security_info = mask_security_info + self.preserve_interchange = preserve_interchange + self.suspend_interchange_on_error = suspend_interchange_on_error + self.create_empty_xml_tags_for_trailing_separators = create_empty_xml_tags_for_trailing_separators + self.use_dot_as_decimal_separator = use_dot_as_decimal_separator + + +class EdifactProtocolSettings(msrest.serialization.Model): + """The Edifact agreement protocol settings. + + All required parameters must be populated in order to send to Azure. + + :param validation_settings: Required. The EDIFACT validation settings. + :type validation_settings: ~azure.mgmt.logic.models.EdifactValidationSettings + :param framing_settings: Required. The EDIFACT framing settings. + :type framing_settings: ~azure.mgmt.logic.models.EdifactFramingSettings + :param envelope_settings: Required. The EDIFACT envelope settings. + :type envelope_settings: ~azure.mgmt.logic.models.EdifactEnvelopeSettings + :param acknowledgement_settings: Required. The EDIFACT acknowledgement settings. + :type acknowledgement_settings: ~azure.mgmt.logic.models.EdifactAcknowledgementSettings + :param message_filter: Required. The EDIFACT message filter. + :type message_filter: ~azure.mgmt.logic.models.EdifactMessageFilter + :param processing_settings: Required. The EDIFACT processing Settings. + :type processing_settings: ~azure.mgmt.logic.models.EdifactProcessingSettings + :param envelope_overrides: The EDIFACT envelope override settings. + :type envelope_overrides: list[~azure.mgmt.logic.models.EdifactEnvelopeOverride] + :param message_filter_list: The EDIFACT message filter list. + :type message_filter_list: list[~azure.mgmt.logic.models.EdifactMessageIdentifier] + :param schema_references: Required. The EDIFACT schema references. + :type schema_references: list[~azure.mgmt.logic.models.EdifactSchemaReference] + :param validation_overrides: The EDIFACT validation override settings. + :type validation_overrides: list[~azure.mgmt.logic.models.EdifactValidationOverride] + :param edifact_delimiter_overrides: The EDIFACT delimiter override settings. + :type edifact_delimiter_overrides: list[~azure.mgmt.logic.models.EdifactDelimiterOverride] + """ + + _validation = { + 'validation_settings': {'required': True}, + 'framing_settings': {'required': True}, + 'envelope_settings': {'required': True}, + 'acknowledgement_settings': {'required': True}, + 'message_filter': {'required': True}, + 'processing_settings': {'required': True}, + 'schema_references': {'required': True}, + } + + _attribute_map = { + 'validation_settings': {'key': 'validationSettings', 'type': 'EdifactValidationSettings'}, + 'framing_settings': {'key': 'framingSettings', 'type': 'EdifactFramingSettings'}, + 'envelope_settings': {'key': 'envelopeSettings', 'type': 'EdifactEnvelopeSettings'}, + 'acknowledgement_settings': {'key': 'acknowledgementSettings', 'type': 'EdifactAcknowledgementSettings'}, + 'message_filter': {'key': 'messageFilter', 'type': 'EdifactMessageFilter'}, + 'processing_settings': {'key': 'processingSettings', 'type': 'EdifactProcessingSettings'}, + 'envelope_overrides': {'key': 'envelopeOverrides', 'type': '[EdifactEnvelopeOverride]'}, + 'message_filter_list': {'key': 'messageFilterList', 'type': '[EdifactMessageIdentifier]'}, + 'schema_references': {'key': 'schemaReferences', 'type': '[EdifactSchemaReference]'}, + 'validation_overrides': {'key': 'validationOverrides', 'type': '[EdifactValidationOverride]'}, + 'edifact_delimiter_overrides': {'key': 'edifactDelimiterOverrides', 'type': '[EdifactDelimiterOverride]'}, + } + + def __init__( + self, + *, + validation_settings: "EdifactValidationSettings", + framing_settings: "EdifactFramingSettings", + envelope_settings: "EdifactEnvelopeSettings", + acknowledgement_settings: "EdifactAcknowledgementSettings", + message_filter: "EdifactMessageFilter", + processing_settings: "EdifactProcessingSettings", + schema_references: List["EdifactSchemaReference"], + envelope_overrides: Optional[List["EdifactEnvelopeOverride"]] = None, + message_filter_list: Optional[List["EdifactMessageIdentifier"]] = None, + validation_overrides: Optional[List["EdifactValidationOverride"]] = None, + edifact_delimiter_overrides: Optional[List["EdifactDelimiterOverride"]] = None, + **kwargs + ): + super(EdifactProtocolSettings, self).__init__(**kwargs) + self.validation_settings = validation_settings + self.framing_settings = framing_settings + self.envelope_settings = envelope_settings + self.acknowledgement_settings = acknowledgement_settings + self.message_filter = message_filter + self.processing_settings = processing_settings + self.envelope_overrides = envelope_overrides + self.message_filter_list = message_filter_list + self.schema_references = schema_references + self.validation_overrides = validation_overrides + self.edifact_delimiter_overrides = edifact_delimiter_overrides + + +class EdifactSchemaReference(msrest.serialization.Model): + """The Edifact schema reference. + + All required parameters must be populated in order to send to Azure. + + :param message_id: Required. The message id. + :type message_id: str + :param message_version: Required. The message version. + :type message_version: str + :param message_release: Required. The message release version. + :type message_release: str + :param sender_application_id: The sender application id. + :type sender_application_id: str + :param sender_application_qualifier: The sender application qualifier. + :type sender_application_qualifier: str + :param association_assigned_code: The association assigned code. + :type association_assigned_code: str + :param schema_name: Required. The schema name. + :type schema_name: str + """ + + _validation = { + 'message_id': {'required': True}, + 'message_version': {'required': True}, + 'message_release': {'required': True}, + 'schema_name': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'message_version': {'key': 'messageVersion', 'type': 'str'}, + 'message_release': {'key': 'messageRelease', 'type': 'str'}, + 'sender_application_id': {'key': 'senderApplicationId', 'type': 'str'}, + 'sender_application_qualifier': {'key': 'senderApplicationQualifier', 'type': 'str'}, + 'association_assigned_code': {'key': 'associationAssignedCode', 'type': 'str'}, + 'schema_name': {'key': 'schemaName', 'type': 'str'}, + } + + def __init__( + self, + *, + message_id: str, + message_version: str, + message_release: str, + schema_name: str, + sender_application_id: Optional[str] = None, + sender_application_qualifier: Optional[str] = None, + association_assigned_code: Optional[str] = None, + **kwargs + ): + super(EdifactSchemaReference, self).__init__(**kwargs) + self.message_id = message_id + self.message_version = message_version + self.message_release = message_release + self.sender_application_id = sender_application_id + self.sender_application_qualifier = sender_application_qualifier + self.association_assigned_code = association_assigned_code + self.schema_name = schema_name + + +class EdifactValidationOverride(msrest.serialization.Model): + """The Edifact validation override settings. + + All required parameters must be populated in order to send to Azure. + + :param message_id: Required. The message id on which the validation settings has to be applied. + :type message_id: str + :param enforce_character_set: Required. The value indicating whether to validate character Set. + :type enforce_character_set: bool + :param validate_edi_types: Required. The value indicating whether to validate EDI types. + :type validate_edi_types: bool + :param validate_xsd_types: Required. The value indicating whether to validate XSD types. + :type validate_xsd_types: bool + :param allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + allow leading and trailing spaces and zeroes. + :type allow_leading_and_trailing_spaces_and_zeroes: bool + :param trailing_separator_policy: Required. The trailing separator policy. Possible values + include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :type trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy + :param trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + trim leading and trailing spaces and zeroes. + :type trim_leading_and_trailing_spaces_and_zeroes: bool + """ + + _validation = { + 'message_id': {'required': True}, + 'enforce_character_set': {'required': True}, + 'validate_edi_types': {'required': True}, + 'validate_xsd_types': {'required': True}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'required': True}, + 'trailing_separator_policy': {'required': True}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'enforce_character_set': {'key': 'enforceCharacterSet', 'type': 'bool'}, + 'validate_edi_types': {'key': 'validateEDITypes', 'type': 'bool'}, + 'validate_xsd_types': {'key': 'validateXSDTypes', 'type': 'bool'}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'key': 'allowLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + 'trailing_separator_policy': {'key': 'trailingSeparatorPolicy', 'type': 'str'}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'key': 'trimLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + } + + def __init__( + self, + *, + message_id: str, + enforce_character_set: bool, + validate_edi_types: bool, + validate_xsd_types: bool, + allow_leading_and_trailing_spaces_and_zeroes: bool, + trailing_separator_policy: Union[str, "TrailingSeparatorPolicy"], + trim_leading_and_trailing_spaces_and_zeroes: bool, + **kwargs + ): + super(EdifactValidationOverride, self).__init__(**kwargs) + self.message_id = message_id + self.enforce_character_set = enforce_character_set + self.validate_edi_types = validate_edi_types + self.validate_xsd_types = validate_xsd_types + self.allow_leading_and_trailing_spaces_and_zeroes = allow_leading_and_trailing_spaces_and_zeroes + self.trailing_separator_policy = trailing_separator_policy + self.trim_leading_and_trailing_spaces_and_zeroes = trim_leading_and_trailing_spaces_and_zeroes + + +class EdifactValidationSettings(msrest.serialization.Model): + """The Edifact agreement validation settings. + + All required parameters must be populated in order to send to Azure. + + :param validate_character_set: Required. The value indicating whether to validate character set + in the message. + :type validate_character_set: bool + :param check_duplicate_interchange_control_number: Required. The value indicating whether to + check for duplicate interchange control number. + :type check_duplicate_interchange_control_number: bool + :param interchange_control_number_validity_days: Required. The validity period of interchange + control number. + :type interchange_control_number_validity_days: int + :param check_duplicate_group_control_number: Required. The value indicating whether to check + for duplicate group control number. + :type check_duplicate_group_control_number: bool + :param check_duplicate_transaction_set_control_number: Required. The value indicating whether + to check for duplicate transaction set control number. + :type check_duplicate_transaction_set_control_number: bool + :param validate_edi_types: Required. The value indicating whether to Whether to validate EDI + types. + :type validate_edi_types: bool + :param validate_xsd_types: Required. The value indicating whether to Whether to validate XSD + types. + :type validate_xsd_types: bool + :param allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + allow leading and trailing spaces and zeroes. + :type allow_leading_and_trailing_spaces_and_zeroes: bool + :param trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + trim leading and trailing spaces and zeroes. + :type trim_leading_and_trailing_spaces_and_zeroes: bool + :param trailing_separator_policy: Required. The trailing separator policy. Possible values + include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :type trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy + """ + + _validation = { + 'validate_character_set': {'required': True}, + 'check_duplicate_interchange_control_number': {'required': True}, + 'interchange_control_number_validity_days': {'required': True}, + 'check_duplicate_group_control_number': {'required': True}, + 'check_duplicate_transaction_set_control_number': {'required': True}, + 'validate_edi_types': {'required': True}, + 'validate_xsd_types': {'required': True}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'required': True}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'required': True}, + 'trailing_separator_policy': {'required': True}, + } + + _attribute_map = { + 'validate_character_set': {'key': 'validateCharacterSet', 'type': 'bool'}, + 'check_duplicate_interchange_control_number': {'key': 'checkDuplicateInterchangeControlNumber', 'type': 'bool'}, + 'interchange_control_number_validity_days': {'key': 'interchangeControlNumberValidityDays', 'type': 'int'}, + 'check_duplicate_group_control_number': {'key': 'checkDuplicateGroupControlNumber', 'type': 'bool'}, + 'check_duplicate_transaction_set_control_number': {'key': 'checkDuplicateTransactionSetControlNumber', 'type': 'bool'}, + 'validate_edi_types': {'key': 'validateEDITypes', 'type': 'bool'}, + 'validate_xsd_types': {'key': 'validateXSDTypes', 'type': 'bool'}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'key': 'allowLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'key': 'trimLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + 'trailing_separator_policy': {'key': 'trailingSeparatorPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + validate_character_set: bool, + check_duplicate_interchange_control_number: bool, + interchange_control_number_validity_days: int, + check_duplicate_group_control_number: bool, + check_duplicate_transaction_set_control_number: bool, + validate_edi_types: bool, + validate_xsd_types: bool, + allow_leading_and_trailing_spaces_and_zeroes: bool, + trim_leading_and_trailing_spaces_and_zeroes: bool, + trailing_separator_policy: Union[str, "TrailingSeparatorPolicy"], + **kwargs + ): + super(EdifactValidationSettings, self).__init__(**kwargs) + self.validate_character_set = validate_character_set + self.check_duplicate_interchange_control_number = check_duplicate_interchange_control_number + self.interchange_control_number_validity_days = interchange_control_number_validity_days + self.check_duplicate_group_control_number = check_duplicate_group_control_number + self.check_duplicate_transaction_set_control_number = check_duplicate_transaction_set_control_number + self.validate_edi_types = validate_edi_types + self.validate_xsd_types = validate_xsd_types + self.allow_leading_and_trailing_spaces_and_zeroes = allow_leading_and_trailing_spaces_and_zeroes + self.trim_leading_and_trailing_spaces_and_zeroes = trim_leading_and_trailing_spaces_and_zeroes + self.trailing_separator_policy = trailing_separator_policy + + +class ErrorProperties(msrest.serialization.Model): + """Error properties indicate why the Logic service was not able to process the incoming request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorProperties, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorResponse(msrest.serialization.Model): + """Error response indicates Logic service is not able to process the incoming request. The error property contains the error details. + + :param error: The error properties. + :type error: ~azure.mgmt.logic.models.ErrorProperties + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorProperties'}, + } + + def __init__( + self, + *, + error: Optional["ErrorProperties"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class Expression(msrest.serialization.Model): + """The expression. + + :param text: The text. + :type text: str + :param value: Any object. + :type value: object + :param subexpressions: The sub expressions. + :type subexpressions: list[~azure.mgmt.logic.models.Expression] + :param error: The azure resource error info. + :type error: ~azure.mgmt.logic.models.AzureResourceErrorInfo + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'subexpressions': {'key': 'subexpressions', 'type': '[Expression]'}, + 'error': {'key': 'error', 'type': 'AzureResourceErrorInfo'}, + } + + def __init__( + self, + *, + text: Optional[str] = None, + value: Optional[object] = None, + subexpressions: Optional[List["Expression"]] = None, + error: Optional["AzureResourceErrorInfo"] = None, + **kwargs + ): + super(Expression, self).__init__(**kwargs) + self.text = text + self.value = value + self.subexpressions = subexpressions + self.error = error + + +class ExpressionRoot(Expression): + """The expression root. + + :param text: The text. + :type text: str + :param value: Any object. + :type value: object + :param subexpressions: The sub expressions. + :type subexpressions: list[~azure.mgmt.logic.models.Expression] + :param error: The azure resource error info. + :type error: ~azure.mgmt.logic.models.AzureResourceErrorInfo + :param path: The path. + :type path: str + """ + + _attribute_map = { + 'text': {'key': 'text', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'subexpressions': {'key': 'subexpressions', 'type': '[Expression]'}, + 'error': {'key': 'error', 'type': 'AzureResourceErrorInfo'}, + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__( + self, + *, + text: Optional[str] = None, + value: Optional[object] = None, + subexpressions: Optional[List["Expression"]] = None, + error: Optional["AzureResourceErrorInfo"] = None, + path: Optional[str] = None, + **kwargs + ): + super(ExpressionRoot, self).__init__(text=text, value=value, subexpressions=subexpressions, error=error, **kwargs) + self.path = path + + +class ExpressionTraces(msrest.serialization.Model): + """The expression traces. + + :param inputs: + :type inputs: list[~azure.mgmt.logic.models.ExpressionRoot] + """ + + _attribute_map = { + 'inputs': {'key': 'inputs', 'type': '[ExpressionRoot]'}, + } + + def __init__( + self, + *, + inputs: Optional[List["ExpressionRoot"]] = None, + **kwargs + ): + super(ExpressionTraces, self).__init__(**kwargs) + self.inputs = inputs + + +class ExtendedErrorInfo(msrest.serialization.Model): + """The extended error info. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error code. Possible values include: "NotSpecified", + "IntegrationServiceEnvironmentNotFound", "InternalServerError", "InvalidOperationId". + :type code: str or ~azure.mgmt.logic.models.ErrorResponseCode + :param message: Required. The error message. + :type message: str + :param details: The error message details. + :type details: list[~azure.mgmt.logic.models.ExtendedErrorInfo] + :param inner_error: The inner error. + :type inner_error: object + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ExtendedErrorInfo]'}, + 'inner_error': {'key': 'innerError', 'type': 'object'}, + } + + def __init__( + self, + *, + code: Union[str, "ErrorResponseCode"], + message: str, + details: Optional[List["ExtendedErrorInfo"]] = None, + inner_error: Optional[object] = None, + **kwargs + ): + super(ExtendedErrorInfo, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + self.inner_error = inner_error + + +class FlowAccessControlConfiguration(msrest.serialization.Model): + """The access control configuration. + + :param triggers: The access control configuration for invoking workflow triggers. + :type triggers: ~azure.mgmt.logic.models.FlowAccessControlConfigurationPolicy + :param contents: The access control configuration for accessing workflow run contents. + :type contents: ~azure.mgmt.logic.models.FlowAccessControlConfigurationPolicy + :param actions: The access control configuration for workflow actions. + :type actions: ~azure.mgmt.logic.models.FlowAccessControlConfigurationPolicy + :param workflow_management: The access control configuration for workflow management. + :type workflow_management: ~azure.mgmt.logic.models.FlowAccessControlConfigurationPolicy + """ + + _attribute_map = { + 'triggers': {'key': 'triggers', 'type': 'FlowAccessControlConfigurationPolicy'}, + 'contents': {'key': 'contents', 'type': 'FlowAccessControlConfigurationPolicy'}, + 'actions': {'key': 'actions', 'type': 'FlowAccessControlConfigurationPolicy'}, + 'workflow_management': {'key': 'workflowManagement', 'type': 'FlowAccessControlConfigurationPolicy'}, + } + + def __init__( + self, + *, + triggers: Optional["FlowAccessControlConfigurationPolicy"] = None, + contents: Optional["FlowAccessControlConfigurationPolicy"] = None, + actions: Optional["FlowAccessControlConfigurationPolicy"] = None, + workflow_management: Optional["FlowAccessControlConfigurationPolicy"] = None, + **kwargs + ): + super(FlowAccessControlConfiguration, self).__init__(**kwargs) + self.triggers = triggers + self.contents = contents + self.actions = actions + self.workflow_management = workflow_management + + +class FlowAccessControlConfigurationPolicy(msrest.serialization.Model): + """The access control configuration policy. + + :param allowed_caller_ip_addresses: The allowed caller IP address ranges. + :type allowed_caller_ip_addresses: list[~azure.mgmt.logic.models.IpAddressRange] + :param open_authentication_policies: The authentication policies for workflow. + :type open_authentication_policies: ~azure.mgmt.logic.models.OpenAuthenticationAccessPolicies + """ + + _attribute_map = { + 'allowed_caller_ip_addresses': {'key': 'allowedCallerIpAddresses', 'type': '[IpAddressRange]'}, + 'open_authentication_policies': {'key': 'openAuthenticationPolicies', 'type': 'OpenAuthenticationAccessPolicies'}, + } + + def __init__( + self, + *, + allowed_caller_ip_addresses: Optional[List["IpAddressRange"]] = None, + open_authentication_policies: Optional["OpenAuthenticationAccessPolicies"] = None, + **kwargs + ): + super(FlowAccessControlConfigurationPolicy, self).__init__(**kwargs) + self.allowed_caller_ip_addresses = allowed_caller_ip_addresses + self.open_authentication_policies = open_authentication_policies + + +class FlowEndpoints(msrest.serialization.Model): + """The flow endpoints configuration. + + :param outgoing_ip_addresses: The outgoing ip address. + :type outgoing_ip_addresses: list[~azure.mgmt.logic.models.IpAddress] + :param access_endpoint_ip_addresses: The access endpoint ip address. + :type access_endpoint_ip_addresses: list[~azure.mgmt.logic.models.IpAddress] + """ + + _attribute_map = { + 'outgoing_ip_addresses': {'key': 'outgoingIpAddresses', 'type': '[IpAddress]'}, + 'access_endpoint_ip_addresses': {'key': 'accessEndpointIpAddresses', 'type': '[IpAddress]'}, + } + + def __init__( + self, + *, + outgoing_ip_addresses: Optional[List["IpAddress"]] = None, + access_endpoint_ip_addresses: Optional[List["IpAddress"]] = None, + **kwargs + ): + super(FlowEndpoints, self).__init__(**kwargs) + self.outgoing_ip_addresses = outgoing_ip_addresses + self.access_endpoint_ip_addresses = access_endpoint_ip_addresses + + +class FlowEndpointsConfiguration(msrest.serialization.Model): + """The endpoints configuration. + + :param workflow: The workflow endpoints. + :type workflow: ~azure.mgmt.logic.models.FlowEndpoints + :param connector: The connector endpoints. + :type connector: ~azure.mgmt.logic.models.FlowEndpoints + """ + + _attribute_map = { + 'workflow': {'key': 'workflow', 'type': 'FlowEndpoints'}, + 'connector': {'key': 'connector', 'type': 'FlowEndpoints'}, + } + + def __init__( + self, + *, + workflow: Optional["FlowEndpoints"] = None, + connector: Optional["FlowEndpoints"] = None, + **kwargs + ): + super(FlowEndpointsConfiguration, self).__init__(**kwargs) + self.workflow = workflow + self.connector = connector + + +class GenerateUpgradedDefinitionParameters(msrest.serialization.Model): + """The parameters to generate upgraded definition. + + :param target_schema_version: The target schema version. + :type target_schema_version: str + """ + + _attribute_map = { + 'target_schema_version': {'key': 'targetSchemaVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + target_schema_version: Optional[str] = None, + **kwargs + ): + super(GenerateUpgradedDefinitionParameters, self).__init__(**kwargs) + self.target_schema_version = target_schema_version + + +class GetCallbackUrlParameters(msrest.serialization.Model): + """The callback url parameters. + + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. Possible values include: "NotSpecified", "Primary", "Secondary". + :type key_type: str or ~azure.mgmt.logic.models.KeyType + """ + + _attribute_map = { + 'not_after': {'key': 'notAfter', 'type': 'iso-8601'}, + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__( + self, + *, + not_after: Optional[datetime.datetime] = None, + key_type: Optional[Union[str, "KeyType"]] = None, + **kwargs + ): + super(GetCallbackUrlParameters, self).__init__(**kwargs) + self.not_after = not_after + self.key_type = key_type + + +class IntegrationAccount(Resource): + """The integration account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param sku: The sku. + :type sku: ~azure.mgmt.logic.models.IntegrationAccountSku + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~azure.mgmt.logic.models.IntegrationServiceEnvironment + :param state: The workflow state. Possible values include: "NotSpecified", "Completed", + "Enabled", "Disabled", "Deleted", "Suspended". + :type state: str or ~azure.mgmt.logic.models.WorkflowState + """ + + _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}'}, + 'sku': {'key': 'sku', 'type': 'IntegrationAccountSku'}, + 'integration_service_environment': {'key': 'properties.integrationServiceEnvironment', 'type': 'IntegrationServiceEnvironment'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + sku: Optional["IntegrationAccountSku"] = None, + integration_service_environment: Optional["IntegrationServiceEnvironment"] = None, + state: Optional[Union[str, "WorkflowState"]] = None, + **kwargs + ): + super(IntegrationAccount, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.integration_service_environment = integration_service_environment + self.state = state + + +class IntegrationAccountAgreement(Resource): + """The integration account agreement. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :ivar created_time: The created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: The changed time. + :vartype changed_time: ~datetime.datetime + :param metadata: The metadata. + :type metadata: object + :param agreement_type: Required. The agreement type. Possible values include: "NotSpecified", + "AS2", "X12", "Edifact". + :type agreement_type: str or ~azure.mgmt.logic.models.AgreementType + :param host_partner: Required. The integration account partner that is set as host partner for + this agreement. + :type host_partner: str + :param guest_partner: Required. The integration account partner that is set as guest partner + for this agreement. + :type guest_partner: str + :param host_identity: Required. The business identity of the host partner. + :type host_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param guest_identity: Required. The business identity of the guest partner. + :type guest_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param content: Required. The agreement content. + :type content: ~azure.mgmt.logic.models.AgreementContent + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'agreement_type': {'required': True}, + 'host_partner': {'required': True}, + 'guest_partner': {'required': True}, + 'host_identity': {'required': True}, + 'guest_identity': {'required': True}, + 'content': {'required': 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}'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'agreement_type': {'key': 'properties.agreementType', 'type': 'str'}, + 'host_partner': {'key': 'properties.hostPartner', 'type': 'str'}, + 'guest_partner': {'key': 'properties.guestPartner', 'type': 'str'}, + 'host_identity': {'key': 'properties.hostIdentity', 'type': 'BusinessIdentity'}, + 'guest_identity': {'key': 'properties.guestIdentity', 'type': 'BusinessIdentity'}, + 'content': {'key': 'properties.content', 'type': 'AgreementContent'}, + } + + def __init__( + self, + *, + agreement_type: Union[str, "AgreementType"], + host_partner: str, + guest_partner: str, + host_identity: "BusinessIdentity", + guest_identity: "BusinessIdentity", + content: "AgreementContent", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + metadata: Optional[object] = None, + **kwargs + ): + super(IntegrationAccountAgreement, self).__init__(location=location, tags=tags, **kwargs) + self.created_time = None + self.changed_time = None + self.metadata = metadata + self.agreement_type = agreement_type + self.host_partner = host_partner + self.guest_partner = guest_partner + self.host_identity = host_identity + self.guest_identity = guest_identity + self.content = content + + +class IntegrationAccountAgreementFilter(msrest.serialization.Model): + """The integration account agreement filter for odata query. + + All required parameters must be populated in order to send to Azure. + + :param agreement_type: Required. The agreement type of integration account agreement. Possible + values include: "NotSpecified", "AS2", "X12", "Edifact". + :type agreement_type: str or ~azure.mgmt.logic.models.AgreementType + """ + + _validation = { + 'agreement_type': {'required': True}, + } + + _attribute_map = { + 'agreement_type': {'key': 'agreementType', 'type': 'str'}, + } + + def __init__( + self, + *, + agreement_type: Union[str, "AgreementType"], + **kwargs + ): + super(IntegrationAccountAgreementFilter, self).__init__(**kwargs) + self.agreement_type = agreement_type + + +class IntegrationAccountAgreementListResult(msrest.serialization.Model): + """The list of integration account agreements. + + :param value: The list of integration account agreements. + :type value: list[~azure.mgmt.logic.models.IntegrationAccountAgreement] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationAccountAgreement]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["IntegrationAccountAgreement"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(IntegrationAccountAgreementListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class IntegrationAccountCertificate(Resource): + """The integration account certificate. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :ivar created_time: The created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: The changed time. + :vartype changed_time: ~datetime.datetime + :param metadata: The metadata. + :type metadata: object + :param key: The key details in the key vault. + :type key: ~azure.mgmt.logic.models.KeyVaultKeyReference + :param public_certificate: The public certificate. + :type public_certificate: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'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}'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'key': {'key': 'properties.key', 'type': 'KeyVaultKeyReference'}, + 'public_certificate': {'key': 'properties.publicCertificate', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + metadata: Optional[object] = None, + key: Optional["KeyVaultKeyReference"] = None, + public_certificate: Optional[str] = None, + **kwargs + ): + super(IntegrationAccountCertificate, self).__init__(location=location, tags=tags, **kwargs) + self.created_time = None + self.changed_time = None + self.metadata = metadata + self.key = key + self.public_certificate = public_certificate + + +class IntegrationAccountCertificateListResult(msrest.serialization.Model): + """The list of integration account certificates. + + :param value: The list of integration account certificates. + :type value: list[~azure.mgmt.logic.models.IntegrationAccountCertificate] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationAccountCertificate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["IntegrationAccountCertificate"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(IntegrationAccountCertificateListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class IntegrationAccountListResult(msrest.serialization.Model): + """The list of integration accounts. + + :param value: The list of integration accounts. + :type value: list[~azure.mgmt.logic.models.IntegrationAccount] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationAccount]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["IntegrationAccount"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(IntegrationAccountListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class IntegrationAccountMap(Resource): + """The integration account map. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param map_type: Required. The map type. Possible values include: "NotSpecified", "Xslt", + "Xslt20", "Xslt30", "Liquid". + :type map_type: str or ~azure.mgmt.logic.models.MapType + :param parameters_schema: The parameters schema of integration account map. + :type parameters_schema: + ~azure.mgmt.logic.models.IntegrationAccountMapPropertiesParametersSchema + :ivar created_time: The created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: The changed time. + :vartype changed_time: ~datetime.datetime + :param content: The content. + :type content: str + :param content_type: The content type. + :type content_type: str + :ivar content_link: The content link. + :vartype content_link: ~azure.mgmt.logic.models.ContentLink + :param metadata: The metadata. + :type metadata: object + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'map_type': {'required': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'content_link': {'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}'}, + 'map_type': {'key': 'properties.mapType', 'type': 'str'}, + 'parameters_schema': {'key': 'properties.parametersSchema', 'type': 'IntegrationAccountMapPropertiesParametersSchema'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'content': {'key': 'properties.content', 'type': 'str'}, + 'content_type': {'key': 'properties.contentType', 'type': 'str'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + } + + def __init__( + self, + *, + map_type: Union[str, "MapType"], + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + parameters_schema: Optional["IntegrationAccountMapPropertiesParametersSchema"] = None, + content: Optional[str] = None, + content_type: Optional[str] = None, + metadata: Optional[object] = None, + **kwargs + ): + super(IntegrationAccountMap, self).__init__(location=location, tags=tags, **kwargs) + self.map_type = map_type + self.parameters_schema = parameters_schema + self.created_time = None + self.changed_time = None + self.content = content + self.content_type = content_type + self.content_link = None + self.metadata = metadata + + +class IntegrationAccountMapFilter(msrest.serialization.Model): + """The integration account map filter for odata query. + + All required parameters must be populated in order to send to Azure. + + :param map_type: Required. The map type of integration account map. Possible values include: + "NotSpecified", "Xslt", "Xslt20", "Xslt30", "Liquid". + :type map_type: str or ~azure.mgmt.logic.models.MapType + """ + + _validation = { + 'map_type': {'required': True}, + } + + _attribute_map = { + 'map_type': {'key': 'mapType', 'type': 'str'}, + } + + def __init__( + self, + *, + map_type: Union[str, "MapType"], + **kwargs + ): + super(IntegrationAccountMapFilter, self).__init__(**kwargs) + self.map_type = map_type + + +class IntegrationAccountMapListResult(msrest.serialization.Model): + """The list of integration account maps. + + :param value: The list of integration account maps. + :type value: list[~azure.mgmt.logic.models.IntegrationAccountMap] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationAccountMap]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["IntegrationAccountMap"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(IntegrationAccountMapListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class IntegrationAccountMapPropertiesParametersSchema(msrest.serialization.Model): + """The parameters schema of integration account map. + + :param ref: The reference name. + :type ref: str + """ + + _attribute_map = { + 'ref': {'key': 'ref', 'type': 'str'}, + } + + def __init__( + self, + *, + ref: Optional[str] = None, + **kwargs + ): + super(IntegrationAccountMapPropertiesParametersSchema, self).__init__(**kwargs) + self.ref = ref + + +class IntegrationAccountPartner(Resource): + """The integration account partner. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param partner_type: Required. The partner type. Possible values include: "NotSpecified", + "B2B". + :type partner_type: str or ~azure.mgmt.logic.models.PartnerType + :ivar created_time: The created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: The changed time. + :vartype changed_time: ~datetime.datetime + :param metadata: The metadata. + :type metadata: object + :param content: Required. The partner content. + :type content: ~azure.mgmt.logic.models.PartnerContent + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'partner_type': {'required': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'content': {'required': 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}'}, + 'partner_type': {'key': 'properties.partnerType', 'type': 'str'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'content': {'key': 'properties.content', 'type': 'PartnerContent'}, + } + + def __init__( + self, + *, + partner_type: Union[str, "PartnerType"], + content: "PartnerContent", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + metadata: Optional[object] = None, + **kwargs + ): + super(IntegrationAccountPartner, self).__init__(location=location, tags=tags, **kwargs) + self.partner_type = partner_type + self.created_time = None + self.changed_time = None + self.metadata = metadata + self.content = content + + +class IntegrationAccountPartnerFilter(msrest.serialization.Model): + """The integration account partner filter for odata query. + + All required parameters must be populated in order to send to Azure. + + :param partner_type: Required. The partner type of integration account partner. Possible values + include: "NotSpecified", "B2B". + :type partner_type: str or ~azure.mgmt.logic.models.PartnerType + """ + + _validation = { + 'partner_type': {'required': True}, + } + + _attribute_map = { + 'partner_type': {'key': 'partnerType', 'type': 'str'}, + } + + def __init__( + self, + *, + partner_type: Union[str, "PartnerType"], + **kwargs + ): + super(IntegrationAccountPartnerFilter, self).__init__(**kwargs) + self.partner_type = partner_type + + +class IntegrationAccountPartnerListResult(msrest.serialization.Model): + """The list of integration account partners. + + :param value: The list of integration account partners. + :type value: list[~azure.mgmt.logic.models.IntegrationAccountPartner] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationAccountPartner]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["IntegrationAccountPartner"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(IntegrationAccountPartnerListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class IntegrationAccountSchema(Resource): + """The integration account schema. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param schema_type: Required. The schema type. Possible values include: "NotSpecified", "Xml". + :type schema_type: str or ~azure.mgmt.logic.models.SchemaType + :param target_namespace: The target namespace of the schema. + :type target_namespace: str + :param document_name: The document name. + :type document_name: str + :param file_name: The file name. + :type file_name: str + :ivar created_time: The created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: The changed time. + :vartype changed_time: ~datetime.datetime + :param metadata: The metadata. + :type metadata: object + :param content: The content. + :type content: str + :param content_type: The content type. + :type content_type: str + :ivar content_link: The content link. + :vartype content_link: ~azure.mgmt.logic.models.ContentLink + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'schema_type': {'required': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'content_link': {'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}'}, + 'schema_type': {'key': 'properties.schemaType', 'type': 'str'}, + 'target_namespace': {'key': 'properties.targetNamespace', 'type': 'str'}, + 'document_name': {'key': 'properties.documentName', 'type': 'str'}, + 'file_name': {'key': 'properties.fileName', 'type': 'str'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + 'content': {'key': 'properties.content', 'type': 'str'}, + 'content_type': {'key': 'properties.contentType', 'type': 'str'}, + 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + } + + def __init__( + self, + *, + schema_type: Union[str, "SchemaType"], + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + target_namespace: Optional[str] = None, + document_name: Optional[str] = None, + file_name: Optional[str] = None, + metadata: Optional[object] = None, + content: Optional[str] = None, + content_type: Optional[str] = None, + **kwargs + ): + super(IntegrationAccountSchema, self).__init__(location=location, tags=tags, **kwargs) + self.schema_type = schema_type + self.target_namespace = target_namespace + self.document_name = document_name + self.file_name = file_name + self.created_time = None + self.changed_time = None + self.metadata = metadata + self.content = content + self.content_type = content_type + self.content_link = None + + +class IntegrationAccountSchemaFilter(msrest.serialization.Model): + """The integration account schema filter for odata query. + + All required parameters must be populated in order to send to Azure. + + :param schema_type: Required. The schema type of integration account schema. Possible values + include: "NotSpecified", "Xml". + :type schema_type: str or ~azure.mgmt.logic.models.SchemaType + """ + + _validation = { + 'schema_type': {'required': True}, + } + + _attribute_map = { + 'schema_type': {'key': 'schemaType', 'type': 'str'}, + } + + def __init__( + self, + *, + schema_type: Union[str, "SchemaType"], + **kwargs + ): + super(IntegrationAccountSchemaFilter, self).__init__(**kwargs) + self.schema_type = schema_type + + +class IntegrationAccountSchemaListResult(msrest.serialization.Model): + """The list of integration account schemas. + + :param value: The list of integration account schemas. + :type value: list[~azure.mgmt.logic.models.IntegrationAccountSchema] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationAccountSchema]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["IntegrationAccountSchema"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(IntegrationAccountSchemaListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class IntegrationAccountSession(Resource): + """The integration account session. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :ivar created_time: The created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: The changed time. + :vartype changed_time: ~datetime.datetime + :param content: The session content. + :type content: object + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'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}'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'content': {'key': 'properties.content', 'type': 'object'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + content: Optional[object] = None, + **kwargs + ): + super(IntegrationAccountSession, self).__init__(location=location, tags=tags, **kwargs) + self.created_time = None + self.changed_time = None + self.content = content + + +class IntegrationAccountSessionFilter(msrest.serialization.Model): + """The integration account session filter. + + All required parameters must be populated in order to send to Azure. + + :param changed_time: Required. The changed time of integration account sessions. + :type changed_time: ~datetime.datetime + """ + + _validation = { + 'changed_time': {'required': True}, + } + + _attribute_map = { + 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + changed_time: datetime.datetime, + **kwargs + ): + super(IntegrationAccountSessionFilter, self).__init__(**kwargs) + self.changed_time = changed_time + + +class IntegrationAccountSessionListResult(msrest.serialization.Model): + """The list of integration account sessions. + + :param value: The list of integration account sessions. + :type value: list[~azure.mgmt.logic.models.IntegrationAccountSession] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationAccountSession]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["IntegrationAccountSession"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(IntegrationAccountSessionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class IntegrationAccountSku(msrest.serialization.Model): + """The integration account sku. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The sku name. Possible values include: "NotSpecified", "Free", "Basic", + "Standard". + :type name: str or ~azure.mgmt.logic.models.IntegrationAccountSkuName + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Union[str, "IntegrationAccountSkuName"], + **kwargs + ): + super(IntegrationAccountSku, self).__init__(**kwargs) + self.name = name + + +class IntegrationServiceEnvironment(Resource): + """The integration service environment. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param properties: The integration service environment properties. + :type properties: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentProperties + :param sku: The sku. + :type sku: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSku + """ + + _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}'}, + 'properties': {'key': 'properties', 'type': 'IntegrationServiceEnvironmentProperties'}, + 'sku': {'key': 'sku', 'type': 'IntegrationServiceEnvironmentSku'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["IntegrationServiceEnvironmentProperties"] = None, + sku: Optional["IntegrationServiceEnvironmentSku"] = None, + **kwargs + ): + super(IntegrationServiceEnvironment, self).__init__(location=location, tags=tags, **kwargs) + self.properties = properties + self.sku = sku + + +class IntegrationServiceEnvironmentAccessEndpoint(msrest.serialization.Model): + """The integration service environment access endpoint. + + :param type: The access endpoint type. Possible values include: "NotSpecified", "External", + "Internal". + :type type: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentAccessEndpointType + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "IntegrationServiceEnvironmentAccessEndpointType"]] = None, + **kwargs + ): + super(IntegrationServiceEnvironmentAccessEndpoint, self).__init__(**kwargs) + self.type = type + + +class IntegrationServiceEnvironmentListResult(msrest.serialization.Model): + """The list of integration service environments. + + :param value: + :type value: list[~azure.mgmt.logic.models.IntegrationServiceEnvironment] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationServiceEnvironment]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["IntegrationServiceEnvironment"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(IntegrationServiceEnvironmentListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class IntegrationServiceEnvironmentNetworkDependency(msrest.serialization.Model): + """The azure async operation resource. + + :param category: The network dependency category type. Possible values include: "NotSpecified", + "AzureStorage", "AzureManagement", "AzureActiveDirectory", "SSLCertificateVerification", + "DiagnosticLogsAndMetrics", "IntegrationServiceEnvironmentConnectors", "RedisCache", + "AccessEndpoints", "RecoveryService", "SQL", "RegionalService". + :type category: str or + ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependencyCategoryType + :param display_name: The display name. + :type display_name: str + :param endpoints: The endpoints. + :type endpoints: list[~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkEndpoint] + """ + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'endpoints': {'key': 'endpoints', 'type': '[IntegrationServiceEnvironmentNetworkEndpoint]'}, + } + + def __init__( + self, + *, + category: Optional[Union[str, "IntegrationServiceEnvironmentNetworkDependencyCategoryType"]] = None, + display_name: Optional[str] = None, + endpoints: Optional[List["IntegrationServiceEnvironmentNetworkEndpoint"]] = None, + **kwargs + ): + super(IntegrationServiceEnvironmentNetworkDependency, self).__init__(**kwargs) + self.category = category + self.display_name = display_name + self.endpoints = endpoints + + +class IntegrationServiceEnvironmentNetworkDependencyHealth(msrest.serialization.Model): + """The integration service environment subnet network health. + + :param error: The error if any occurred during the operation. + :type error: ~azure.mgmt.logic.models.ExtendedErrorInfo + :param state: The network dependency health state. Possible values include: "NotSpecified", + "Healthy", "Unhealthy", "Unknown". + :type state: str or + ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependencyHealthState + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ExtendedErrorInfo'}, + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + error: Optional["ExtendedErrorInfo"] = None, + state: Optional[Union[str, "IntegrationServiceEnvironmentNetworkDependencyHealthState"]] = None, + **kwargs + ): + super(IntegrationServiceEnvironmentNetworkDependencyHealth, self).__init__(**kwargs) + self.error = error + self.state = state + + +class IntegrationServiceEnvironmentNetworkEndpoint(msrest.serialization.Model): + """The network endpoint. + + :param accessibility: The accessibility state. Possible values include: "NotSpecified", + "Unknown", "Available", "NotAvailable". + :type accessibility: str or + ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState + :param domain_name: The domain name. + :type domain_name: str + :param ports: The ports. + :type ports: list[str] + """ + + _attribute_map = { + 'accessibility': {'key': 'accessibility', 'type': 'str'}, + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'ports': {'key': 'ports', 'type': '[str]'}, + } + + def __init__( + self, + *, + accessibility: Optional[Union[str, "IntegrationServiceEnvironmentNetworkEndPointAccessibilityState"]] = None, + domain_name: Optional[str] = None, + ports: Optional[List[str]] = None, + **kwargs + ): + super(IntegrationServiceEnvironmentNetworkEndpoint, self).__init__(**kwargs) + self.accessibility = accessibility + self.domain_name = domain_name + self.ports = ports + + +class IntegrationServiceEnvironmentProperties(msrest.serialization.Model): + """The integration service environment properties. + + :param provisioning_state: The provisioning state. Possible values include: "NotSpecified", + "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", + "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :type provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState + :param state: The integration service environment state. Possible values include: + "NotSpecified", "Completed", "Enabled", "Disabled", "Deleted", "Suspended". + :type state: str or ~azure.mgmt.logic.models.WorkflowState + :param integration_service_environment_id: Gets the tracking id. + :type integration_service_environment_id: str + :param endpoints_configuration: The endpoints configuration. + :type endpoints_configuration: ~azure.mgmt.logic.models.FlowEndpointsConfiguration + :param network_configuration: The network configuration. + :type network_configuration: ~azure.mgmt.logic.models.NetworkConfiguration + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'integration_service_environment_id': {'key': 'integrationServiceEnvironmentId', 'type': 'str'}, + 'endpoints_configuration': {'key': 'endpointsConfiguration', 'type': 'FlowEndpointsConfiguration'}, + 'network_configuration': {'key': 'networkConfiguration', 'type': 'NetworkConfiguration'}, + } + + def __init__( + self, + *, + provisioning_state: Optional[Union[str, "WorkflowProvisioningState"]] = None, + state: Optional[Union[str, "WorkflowState"]] = None, + integration_service_environment_id: Optional[str] = None, + endpoints_configuration: Optional["FlowEndpointsConfiguration"] = None, + network_configuration: Optional["NetworkConfiguration"] = None, + **kwargs + ): + super(IntegrationServiceEnvironmentProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.state = state + self.integration_service_environment_id = integration_service_environment_id + self.endpoints_configuration = endpoints_configuration + self.network_configuration = network_configuration + + +class IntegrationServiceEnvironmentSku(msrest.serialization.Model): + """The integration service environment sku. + + :param name: The sku name. Possible values include: "NotSpecified", "Premium", "Developer". + :type name: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuName + :param capacity: The sku capacity. + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "IntegrationServiceEnvironmentSkuName"]] = None, + capacity: Optional[int] = None, + **kwargs + ): + super(IntegrationServiceEnvironmentSku, self).__init__(**kwargs) + self.name = name + self.capacity = capacity + + +class IntegrationServiceEnvironmentSkuCapacity(msrest.serialization.Model): + """The integration service environment sku capacity. + + :param minimum: The minimum capacity. + :type minimum: int + :param maximum: The maximum capacity. + :type maximum: int + :param default: The default capacity. + :type default: int + :param scale_type: The sku scale type. Possible values include: "Manual", "Automatic", "None". + :type scale_type: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuScaleType + """ + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + *, + minimum: Optional[int] = None, + maximum: Optional[int] = None, + default: Optional[int] = None, + scale_type: Optional[Union[str, "IntegrationServiceEnvironmentSkuScaleType"]] = None, + **kwargs + ): + super(IntegrationServiceEnvironmentSkuCapacity, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + self.default = default + self.scale_type = scale_type + + +class IntegrationServiceEnvironmentSkuDefinition(msrest.serialization.Model): + """The integration service environment sku definition. + + :param resource_type: The resource type. + :type resource_type: str + :param sku: The sku. + :type sku: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuDefinitionSku + :param capacity: The sku capacity. + :type capacity: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuCapacity + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'IntegrationServiceEnvironmentSkuDefinitionSku'}, + 'capacity': {'key': 'capacity', 'type': 'IntegrationServiceEnvironmentSkuCapacity'}, + } + + def __init__( + self, + *, + resource_type: Optional[str] = None, + sku: Optional["IntegrationServiceEnvironmentSkuDefinitionSku"] = None, + capacity: Optional["IntegrationServiceEnvironmentSkuCapacity"] = None, + **kwargs + ): + super(IntegrationServiceEnvironmentSkuDefinition, self).__init__(**kwargs) + self.resource_type = resource_type + self.sku = sku + self.capacity = capacity + + +class IntegrationServiceEnvironmentSkuDefinitionSku(msrest.serialization.Model): + """The sku. + + :param name: The sku name. Possible values include: "NotSpecified", "Premium", "Developer". + :type name: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuName + :param tier: The sku tier. + :type tier: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[Union[str, "IntegrationServiceEnvironmentSkuName"]] = None, + tier: Optional[str] = None, + **kwargs + ): + super(IntegrationServiceEnvironmentSkuDefinitionSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +class IntegrationServiceEnvironmentSkuList(msrest.serialization.Model): + """The list of integration service environment skus. + + :param value: The list of integration service environment skus. + :type value: list[~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuDefinition] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[IntegrationServiceEnvironmentSkuDefinition]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["IntegrationServiceEnvironmentSkuDefinition"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(IntegrationServiceEnvironmentSkuList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class IntegrationServiceEnvironmentSubnetNetworkHealth(msrest.serialization.Model): + """The integration service environment subnet network health. + + All required parameters must be populated in order to send to Azure. + + :param outbound_network_dependencies: The outbound network dependencies. + :type outbound_network_dependencies: + list[~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependency] + :param outbound_network_health: The integration service environment network health. + :type outbound_network_health: + ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependencyHealth + :param network_dependency_health_state: Required. The integration service environment network + health state. Possible values include: "NotSpecified", "Unknown", "Available", "NotAvailable". + :type network_dependency_health_state: str or + ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState + """ + + _validation = { + 'network_dependency_health_state': {'required': True}, + } + + _attribute_map = { + 'outbound_network_dependencies': {'key': 'outboundNetworkDependencies', 'type': '[IntegrationServiceEnvironmentNetworkDependency]'}, + 'outbound_network_health': {'key': 'outboundNetworkHealth', 'type': 'IntegrationServiceEnvironmentNetworkDependencyHealth'}, + 'network_dependency_health_state': {'key': 'networkDependencyHealthState', 'type': 'str'}, + } + + def __init__( + self, + *, + network_dependency_health_state: Union[str, "IntegrationServiceEnvironmentNetworkEndPointAccessibilityState"], + outbound_network_dependencies: Optional[List["IntegrationServiceEnvironmentNetworkDependency"]] = None, + outbound_network_health: Optional["IntegrationServiceEnvironmentNetworkDependencyHealth"] = None, + **kwargs + ): + super(IntegrationServiceEnvironmentSubnetNetworkHealth, self).__init__(**kwargs) + self.outbound_network_dependencies = outbound_network_dependencies + self.outbound_network_health = outbound_network_health + self.network_dependency_health_state = network_dependency_health_state + + +class IpAddress(msrest.serialization.Model): + """The ip address. + + :param address: The address. + :type address: str + """ + + _attribute_map = { + 'address': {'key': 'address', 'type': 'str'}, + } + + def __init__( + self, + *, + address: Optional[str] = None, + **kwargs + ): + super(IpAddress, self).__init__(**kwargs) + self.address = address + + +class IpAddressRange(msrest.serialization.Model): + """The ip address range. + + :param address_range: The IP address range. + :type address_range: str + """ + + _attribute_map = { + 'address_range': {'key': 'addressRange', 'type': 'str'}, + } + + def __init__( + self, + *, + address_range: Optional[str] = None, + **kwargs + ): + super(IpAddressRange, self).__init__(**kwargs) + self.address_range = address_range + + +class JsonSchema(msrest.serialization.Model): + """The JSON schema. + + :param title: The JSON title. + :type title: str + :param content: The JSON content. + :type content: str + """ + + _attribute_map = { + 'title': {'key': 'title', 'type': 'str'}, + 'content': {'key': 'content', 'type': 'str'}, + } + + def __init__( + self, + *, + title: Optional[str] = None, + content: Optional[str] = None, + **kwargs + ): + super(JsonSchema, self).__init__(**kwargs) + self.title = title + self.content = content + + +class KeyVaultKey(msrest.serialization.Model): + """The key vault key. + + :param kid: The key id. + :type kid: str + :param attributes: The key attributes. + :type attributes: ~azure.mgmt.logic.models.KeyVaultKeyAttributes + """ + + _attribute_map = { + 'kid': {'key': 'kid', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'KeyVaultKeyAttributes'}, + } + + def __init__( + self, + *, + kid: Optional[str] = None, + attributes: Optional["KeyVaultKeyAttributes"] = None, + **kwargs + ): + super(KeyVaultKey, self).__init__(**kwargs) + self.kid = kid + self.attributes = attributes + + +class KeyVaultKeyAttributes(msrest.serialization.Model): + """The key attributes. + + :param enabled: Whether the key is enabled or not. + :type enabled: bool + :param created: When the key was created. + :type created: long + :param updated: When the key was updated. + :type updated: long + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'long'}, + 'updated': {'key': 'updated', 'type': 'long'}, + } + + def __init__( + self, + *, + enabled: Optional[bool] = None, + created: Optional[int] = None, + updated: Optional[int] = None, + **kwargs + ): + super(KeyVaultKeyAttributes, self).__init__(**kwargs) + self.enabled = enabled + self.created = created + self.updated = updated + + +class KeyVaultKeyCollection(msrest.serialization.Model): + """Collection of key vault keys. + + :param value: The key vault keys. + :type value: list[~azure.mgmt.logic.models.KeyVaultKey] + :param skip_token: The skip token. + :type skip_token: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[KeyVaultKey]'}, + 'skip_token': {'key': 'skipToken', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["KeyVaultKey"]] = None, + skip_token: Optional[str] = None, + **kwargs + ): + super(KeyVaultKeyCollection, self).__init__(**kwargs) + self.value = value + self.skip_token = skip_token + + +class KeyVaultKeyReference(msrest.serialization.Model): + """The reference to the key vault key. + + All required parameters must be populated in order to send to Azure. + + :param key_vault: Required. The key vault reference. + :type key_vault: ~azure.mgmt.logic.models.KeyVaultKeyReferenceKeyVault + :param key_name: Required. The private key name in key vault. + :type key_name: str + :param key_version: The private key version in key vault. + :type key_version: str + """ + + _validation = { + 'key_vault': {'required': True}, + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_vault': {'key': 'keyVault', 'type': 'KeyVaultKeyReferenceKeyVault'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'key_version': {'key': 'keyVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + key_vault: "KeyVaultKeyReferenceKeyVault", + key_name: str, + key_version: Optional[str] = None, + **kwargs + ): + super(KeyVaultKeyReference, self).__init__(**kwargs) + self.key_vault = key_vault + self.key_name = key_name + self.key_version = key_version + + +class KeyVaultKeyReferenceKeyVault(msrest.serialization.Model): + """The key vault reference. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The resource id. + :type id: str + :ivar name: The resource name. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(KeyVaultKeyReferenceKeyVault, self).__init__(**kwargs) + self.id = id + self.name = None + self.type = None + + +class KeyVaultReference(ResourceReference): + """The key vault reference. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The resource id. + :type id: str + :ivar type: Gets the resource type. + :vartype type: str + :param name: The key vault name. + :type name: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + **kwargs + ): + super(KeyVaultReference, self).__init__(id=id, **kwargs) + self.name = name + + +class ListKeyVaultKeysDefinition(msrest.serialization.Model): + """The list key vault keys definition. + + All required parameters must be populated in order to send to Azure. + + :param key_vault: Required. The key vault reference. + :type key_vault: ~azure.mgmt.logic.models.KeyVaultReference + :param skip_token: The skip token. + :type skip_token: str + """ + + _validation = { + 'key_vault': {'required': True}, + } + + _attribute_map = { + 'key_vault': {'key': 'keyVault', 'type': 'KeyVaultReference'}, + 'skip_token': {'key': 'skipToken', 'type': 'str'}, + } + + def __init__( + self, + *, + key_vault: "KeyVaultReference", + skip_token: Optional[str] = None, + **kwargs + ): + super(ListKeyVaultKeysDefinition, self).__init__(**kwargs) + self.key_vault = key_vault + self.skip_token = skip_token + + +class ManagedApi(Resource): + """The managed api definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param properties: The api resource properties. + :type properties: ~azure.mgmt.logic.models.ApiResourceProperties + """ + + _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}'}, + 'properties': {'key': 'properties', 'type': 'ApiResourceProperties'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["ApiResourceProperties"] = None, + **kwargs + ): + super(ManagedApi, self).__init__(location=location, tags=tags, **kwargs) + self.properties = properties + + +class ManagedApiListResult(msrest.serialization.Model): + """The list of managed APIs. + + :param value: The managed APIs. + :type value: list[~azure.mgmt.logic.models.ManagedApi] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ManagedApi]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ManagedApi"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ManagedApiListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class NetworkConfiguration(msrest.serialization.Model): + """The network configuration. + + :param virtual_network_address_space: Gets the virtual network address space. + :type virtual_network_address_space: str + :param access_endpoint: The access endpoint. + :type access_endpoint: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentAccessEndpoint + :param subnets: The subnets. + :type subnets: list[~azure.mgmt.logic.models.ResourceReference] + """ + + _attribute_map = { + 'virtual_network_address_space': {'key': 'virtualNetworkAddressSpace', 'type': 'str'}, + 'access_endpoint': {'key': 'accessEndpoint', 'type': 'IntegrationServiceEnvironmentAccessEndpoint'}, + 'subnets': {'key': 'subnets', 'type': '[ResourceReference]'}, + } + + def __init__( + self, + *, + virtual_network_address_space: Optional[str] = None, + access_endpoint: Optional["IntegrationServiceEnvironmentAccessEndpoint"] = None, + subnets: Optional[List["ResourceReference"]] = None, + **kwargs + ): + super(NetworkConfiguration, self).__init__(**kwargs) + self.virtual_network_address_space = virtual_network_address_space + self.access_endpoint = access_endpoint + self.subnets = subnets + + +class OpenAuthenticationAccessPolicies(msrest.serialization.Model): + """AuthenticationPolicy of type Open. + + :param policies: Open authentication policies. + :type policies: dict[str, ~azure.mgmt.logic.models.OpenAuthenticationAccessPolicy] + """ + + _attribute_map = { + 'policies': {'key': 'policies', 'type': '{OpenAuthenticationAccessPolicy}'}, + } + + def __init__( + self, + *, + policies: Optional[Dict[str, "OpenAuthenticationAccessPolicy"]] = None, + **kwargs + ): + super(OpenAuthenticationAccessPolicies, self).__init__(**kwargs) + self.policies = policies + + +class OpenAuthenticationAccessPolicy(msrest.serialization.Model): + """Open authentication access policy defined by user. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: Type of provider for OAuth. Default value: "AAD". + :vartype type: str + :param claims: The access policy claims. + :type claims: list[~azure.mgmt.logic.models.OpenAuthenticationPolicyClaim] + """ + + _validation = { + 'type': {'readonly': True, 'constant': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'claims': {'key': 'claims', 'type': '[OpenAuthenticationPolicyClaim]'}, + } + + type = "AAD" + + def __init__( + self, + *, + claims: Optional[List["OpenAuthenticationPolicyClaim"]] = None, + **kwargs + ): + super(OpenAuthenticationAccessPolicy, self).__init__(**kwargs) + self.type = None + self.claims = claims + + +class OpenAuthenticationPolicyClaim(msrest.serialization.Model): + """Open authentication policy claim. + + :param name: The name of the claim. + :type name: str + :param value: The value of the claim. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + **kwargs + ): + super(OpenAuthenticationPolicyClaim, self).__init__(**kwargs) + self.name = name + self.value = value + + +class Operation(msrest.serialization.Model): + """Logic REST API operation. + + :param origin: Operation: origin. + :type origin: str + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.logic.models.OperationDisplay + :param properties: The properties. + :type properties: object + """ + + _attribute_map = { + 'origin': {'key': 'origin', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__( + self, + *, + origin: Optional[str] = None, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + properties: Optional[object] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.origin = origin + self.name = name + self.display = display + self.properties = properties + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Logic. + :type provider: str + :param resource: Resource on which the operation is performed: Profile, endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + :param description: Operation: description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list Logic operations. It contains a list of operations and a URL link to get the next set of results. + + :param value: List of Logic operations supported by the Logic resource provider. + :type value: list[~azure.mgmt.logic.models.Operation] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Operation"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class OperationResultProperties(msrest.serialization.Model): + """The run operation result properties. + + :param start_time: The start time of the workflow scope repetition. + :type start_time: ~datetime.datetime + :param end_time: The end time of the workflow scope repetition. + :type end_time: ~datetime.datetime + :param correlation: The correlation properties. + :type correlation: ~azure.mgmt.logic.models.RunActionCorrelation + :param status: The status of the workflow scope repetition. Possible values include: + "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", + "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :type status: str or ~azure.mgmt.logic.models.WorkflowStatus + :param code: The workflow scope repetition code. + :type code: str + :param error: Any object. + :type error: object + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'correlation': {'key': 'correlation', 'type': 'RunActionCorrelation'}, + 'status': {'key': 'status', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'object'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + correlation: Optional["RunActionCorrelation"] = None, + status: Optional[Union[str, "WorkflowStatus"]] = None, + code: Optional[str] = None, + error: Optional[object] = None, + **kwargs + ): + super(OperationResultProperties, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.correlation = correlation + self.status = status + self.code = code + self.error = error + + +class OperationResult(OperationResultProperties): + """The operation result definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param start_time: The start time of the workflow scope repetition. + :type start_time: ~datetime.datetime + :param end_time: The end time of the workflow scope repetition. + :type end_time: ~datetime.datetime + :param correlation: The correlation properties. + :type correlation: ~azure.mgmt.logic.models.RunActionCorrelation + :param status: The status of the workflow scope repetition. Possible values include: + "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", + "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :type status: str or ~azure.mgmt.logic.models.WorkflowStatus + :param code: The workflow scope repetition code. + :type code: str + :param error: Any object. + :type error: object + :ivar tracking_id: Gets the tracking id. + :vartype tracking_id: str + :ivar inputs: Gets the inputs. + :vartype inputs: object + :ivar inputs_link: Gets the link to inputs. + :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar outputs: Gets the outputs. + :vartype outputs: object + :ivar outputs_link: Gets the link to outputs. + :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar tracked_properties: Gets the tracked properties. + :vartype tracked_properties: object + :param retry_history: Gets the retry histories. + :type retry_history: list[~azure.mgmt.logic.models.RetryHistory] + :param iteration_count: + :type iteration_count: int + """ + + _validation = { + 'tracking_id': {'readonly': True}, + 'inputs': {'readonly': True}, + 'inputs_link': {'readonly': True}, + 'outputs': {'readonly': True}, + 'outputs_link': {'readonly': True}, + 'tracked_properties': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'correlation': {'key': 'correlation', 'type': 'RunActionCorrelation'}, + 'status': {'key': 'status', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'object'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': 'object'}, + 'inputs_link': {'key': 'inputsLink', 'type': 'ContentLink'}, + 'outputs': {'key': 'outputs', 'type': 'object'}, + 'outputs_link': {'key': 'outputsLink', 'type': 'ContentLink'}, + 'tracked_properties': {'key': 'trackedProperties', 'type': 'object'}, + 'retry_history': {'key': 'retryHistory', 'type': '[RetryHistory]'}, + 'iteration_count': {'key': 'iterationCount', 'type': 'int'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + correlation: Optional["RunActionCorrelation"] = None, + status: Optional[Union[str, "WorkflowStatus"]] = None, + code: Optional[str] = None, + error: Optional[object] = None, + retry_history: Optional[List["RetryHistory"]] = None, + iteration_count: Optional[int] = None, + **kwargs + ): + super(OperationResult, self).__init__(start_time=start_time, end_time=end_time, correlation=correlation, status=status, code=code, error=error, **kwargs) + self.tracking_id = None + self.inputs = None + self.inputs_link = None + self.outputs = None + self.outputs_link = None + self.tracked_properties = None + self.retry_history = retry_history + self.iteration_count = iteration_count + + +class PartnerContent(msrest.serialization.Model): + """The integration account partner content. + + :param b2_b: The B2B partner content. + :type b2_b: ~azure.mgmt.logic.models.B2BPartnerContent + """ + + _attribute_map = { + 'b2_b': {'key': 'b2b', 'type': 'B2BPartnerContent'}, + } + + def __init__( + self, + *, + b2_b: Optional["B2BPartnerContent"] = None, + **kwargs + ): + super(PartnerContent, self).__init__(**kwargs) + self.b2_b = b2_b + + +class RecurrenceSchedule(msrest.serialization.Model): + """The recurrence schedule. + + :param minutes: The minutes. + :type minutes: list[int] + :param hours: The hours. + :type hours: list[int] + :param week_days: The days of the week. + :type week_days: list[str or ~azure.mgmt.logic.models.DaysOfWeek] + :param month_days: The month days. + :type month_days: list[int] + :param monthly_occurrences: The monthly occurrences. + :type monthly_occurrences: list[~azure.mgmt.logic.models.RecurrenceScheduleOccurrence] + """ + + _attribute_map = { + 'minutes': {'key': 'minutes', 'type': '[int]'}, + 'hours': {'key': 'hours', 'type': '[int]'}, + 'week_days': {'key': 'weekDays', 'type': '[str]'}, + 'month_days': {'key': 'monthDays', 'type': '[int]'}, + 'monthly_occurrences': {'key': 'monthlyOccurrences', 'type': '[RecurrenceScheduleOccurrence]'}, + } + + def __init__( + self, + *, + minutes: Optional[List[int]] = None, + hours: Optional[List[int]] = None, + week_days: Optional[List[Union[str, "DaysOfWeek"]]] = None, + month_days: Optional[List[int]] = None, + monthly_occurrences: Optional[List["RecurrenceScheduleOccurrence"]] = None, + **kwargs + ): + super(RecurrenceSchedule, self).__init__(**kwargs) + self.minutes = minutes + self.hours = hours + self.week_days = week_days + self.month_days = month_days + self.monthly_occurrences = monthly_occurrences + + +class RecurrenceScheduleOccurrence(msrest.serialization.Model): + """The recurrence schedule occurrence. + + :param day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", "Saturday". + :type day: str or ~azure.mgmt.logic.models.DayOfWeek + :param occurrence: The occurrence. + :type occurrence: int + """ + + _attribute_map = { + 'day': {'key': 'day', 'type': 'str'}, + 'occurrence': {'key': 'occurrence', 'type': 'int'}, + } + + def __init__( + self, + *, + day: Optional[Union[str, "DayOfWeek"]] = None, + occurrence: Optional[int] = None, + **kwargs + ): + super(RecurrenceScheduleOccurrence, self).__init__(**kwargs) + self.day = day + self.occurrence = occurrence + + +class RegenerateActionParameter(msrest.serialization.Model): + """The access key regenerate action content. + + :param key_type: The key type. Possible values include: "NotSpecified", "Primary", "Secondary". + :type key_type: str or ~azure.mgmt.logic.models.KeyType + """ + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__( + self, + *, + key_type: Optional[Union[str, "KeyType"]] = None, + **kwargs + ): + super(RegenerateActionParameter, self).__init__(**kwargs) + self.key_type = key_type + + +class RepetitionIndex(msrest.serialization.Model): + """The workflow run action repetition index. + + All required parameters must be populated in order to send to Azure. + + :param scope_name: The scope. + :type scope_name: str + :param item_index: Required. The index. + :type item_index: int + """ + + _validation = { + 'item_index': {'required': True}, + } + + _attribute_map = { + 'scope_name': {'key': 'scopeName', 'type': 'str'}, + 'item_index': {'key': 'itemIndex', 'type': 'int'}, + } + + def __init__( + self, + *, + item_index: int, + scope_name: Optional[str] = None, + **kwargs + ): + super(RepetitionIndex, self).__init__(**kwargs) + self.scope_name = scope_name + self.item_index = item_index + + +class Request(msrest.serialization.Model): + """A request. + + :param headers: A list of all the headers attached to the request. + :type headers: object + :param uri: The destination for the request. + :type uri: str + :param method: The HTTP method used for the request. + :type method: str + """ + + _attribute_map = { + 'headers': {'key': 'headers', 'type': 'object'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + } + + def __init__( + self, + *, + headers: Optional[object] = None, + uri: Optional[str] = None, + method: Optional[str] = None, + **kwargs + ): + super(Request, self).__init__(**kwargs) + self.headers = headers + self.uri = uri + self.method = method + + +class RequestHistory(Resource): + """The request history. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param properties: The request history properties. + :type properties: ~azure.mgmt.logic.models.RequestHistoryProperties + """ + + _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}'}, + 'properties': {'key': 'properties', 'type': 'RequestHistoryProperties'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["RequestHistoryProperties"] = None, + **kwargs + ): + super(RequestHistory, self).__init__(location=location, tags=tags, **kwargs) + self.properties = properties + + +class RequestHistoryListResult(msrest.serialization.Model): + """The list of workflow request histories. + + :param value: A list of workflow request histories. + :type value: list[~azure.mgmt.logic.models.RequestHistory] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[RequestHistory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["RequestHistory"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(RequestHistoryListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class RequestHistoryProperties(msrest.serialization.Model): + """The request history. + + :param start_time: The time the request started. + :type start_time: ~datetime.datetime + :param end_time: The time the request ended. + :type end_time: ~datetime.datetime + :param request: The request. + :type request: ~azure.mgmt.logic.models.Request + :param response: The response. + :type response: ~azure.mgmt.logic.models.Response + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'request': {'key': 'request', 'type': 'Request'}, + 'response': {'key': 'response', 'type': 'Response'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + request: Optional["Request"] = None, + response: Optional["Response"] = None, + **kwargs + ): + super(RequestHistoryProperties, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.request = request + self.response = response + + +class Response(msrest.serialization.Model): + """A response. + + :param headers: A list of all the headers attached to the response. + :type headers: object + :param status_code: The status code of the response. + :type status_code: int + :param body_link: Details on the location of the body content. + :type body_link: ~azure.mgmt.logic.models.ContentLink + """ + + _attribute_map = { + 'headers': {'key': 'headers', 'type': 'object'}, + 'status_code': {'key': 'statusCode', 'type': 'int'}, + 'body_link': {'key': 'bodyLink', 'type': 'ContentLink'}, + } + + def __init__( + self, + *, + headers: Optional[object] = None, + status_code: Optional[int] = None, + body_link: Optional["ContentLink"] = None, + **kwargs + ): + super(Response, self).__init__(**kwargs) + self.headers = headers + self.status_code = status_code + self.body_link = body_link + + +class RetryHistory(msrest.serialization.Model): + """The retry history. + + :param start_time: Gets the start time. + :type start_time: ~datetime.datetime + :param end_time: Gets the end time. + :type end_time: ~datetime.datetime + :param code: Gets the status code. + :type code: str + :param client_request_id: Gets the client request Id. + :type client_request_id: str + :param service_request_id: Gets the service request Id. + :type service_request_id: str + :param error: Gets the error response. + :type error: ~azure.mgmt.logic.models.ErrorResponse + """ + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'code': {'key': 'code', 'type': 'str'}, + 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, + 'service_request_id': {'key': 'serviceRequestId', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + code: Optional[str] = None, + client_request_id: Optional[str] = None, + service_request_id: Optional[str] = None, + error: Optional["ErrorResponse"] = None, + **kwargs + ): + super(RetryHistory, self).__init__(**kwargs) + self.start_time = start_time + self.end_time = end_time + self.code = code + self.client_request_id = client_request_id + self.service_request_id = service_request_id + self.error = error + + +class RunCorrelation(msrest.serialization.Model): + """The correlation properties. + + :param client_tracking_id: The client tracking identifier. + :type client_tracking_id: str + :param client_keywords: The client keywords. + :type client_keywords: list[str] + """ + + _attribute_map = { + 'client_tracking_id': {'key': 'clientTrackingId', 'type': 'str'}, + 'client_keywords': {'key': 'clientKeywords', 'type': '[str]'}, + } + + def __init__( + self, + *, + client_tracking_id: Optional[str] = None, + client_keywords: Optional[List[str]] = None, + **kwargs + ): + super(RunCorrelation, self).__init__(**kwargs) + self.client_tracking_id = client_tracking_id + self.client_keywords = client_keywords + + +class RunActionCorrelation(RunCorrelation): + """The workflow run action correlation properties. + + :param client_tracking_id: The client tracking identifier. + :type client_tracking_id: str + :param client_keywords: The client keywords. + :type client_keywords: list[str] + :param action_tracking_id: The action tracking identifier. + :type action_tracking_id: str + """ + + _attribute_map = { + 'client_tracking_id': {'key': 'clientTrackingId', 'type': 'str'}, + 'client_keywords': {'key': 'clientKeywords', 'type': '[str]'}, + 'action_tracking_id': {'key': 'actionTrackingId', 'type': 'str'}, + } + + def __init__( + self, + *, + client_tracking_id: Optional[str] = None, + client_keywords: Optional[List[str]] = None, + action_tracking_id: Optional[str] = None, + **kwargs + ): + super(RunActionCorrelation, self).__init__(client_tracking_id=client_tracking_id, client_keywords=client_keywords, **kwargs) + self.action_tracking_id = action_tracking_id + + +class SetTriggerStateActionDefinition(msrest.serialization.Model): + """The set trigger state action definition. + + All required parameters must be populated in order to send to Azure. + + :param source: Required. The source. + :type source: ~azure.mgmt.logic.models.WorkflowTriggerReference + """ + + _validation = { + 'source': {'required': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'WorkflowTriggerReference'}, + } + + def __init__( + self, + *, + source: "WorkflowTriggerReference", + **kwargs + ): + super(SetTriggerStateActionDefinition, self).__init__(**kwargs) + self.source = source + + +class Sku(msrest.serialization.Model): + """The sku type. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name. Possible values include: "NotSpecified", "Free", "Shared", + "Basic", "Standard", "Premium". + :type name: str or ~azure.mgmt.logic.models.SkuName + :param plan: The reference to plan. + :type plan: ~azure.mgmt.logic.models.ResourceReference + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'plan': {'key': 'plan', 'type': 'ResourceReference'}, + } + + def __init__( + self, + *, + name: Union[str, "SkuName"], + plan: Optional["ResourceReference"] = None, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = name + self.plan = plan + + +class SubResource(msrest.serialization.Model): + """The sub resource type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubResource, self).__init__(**kwargs) + self.id = None + + +class SwaggerCustomDynamicList(msrest.serialization.Model): + """The swagger custom dynamic list. + + :param operation_id: The operation id to fetch dynamic schema. + :type operation_id: str + :param built_in_operation: The built in operation. + :type built_in_operation: str + :param items_path: The path to a response property (relative to the response object, not the + response body) which contains an array of dynamic value items. + :type items_path: str + :param item_value_path: The path to a property which defines the value which should be used. + :type item_value_path: str + :param item_title_path: The path to an item property which defines the display name of the + item. + :type item_title_path: str + :param parameters: The parameters. + :type parameters: dict[str, ~azure.mgmt.logic.models.SwaggerCustomDynamicProperties] + """ + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'built_in_operation': {'key': 'builtInOperation', 'type': 'str'}, + 'items_path': {'key': 'itemsPath', 'type': 'str'}, + 'item_value_path': {'key': 'itemValuePath', 'type': 'str'}, + 'item_title_path': {'key': 'itemTitlePath', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{SwaggerCustomDynamicProperties}'}, + } + + def __init__( + self, + *, + operation_id: Optional[str] = None, + built_in_operation: Optional[str] = None, + items_path: Optional[str] = None, + item_value_path: Optional[str] = None, + item_title_path: Optional[str] = None, + parameters: Optional[Dict[str, "SwaggerCustomDynamicProperties"]] = None, + **kwargs + ): + super(SwaggerCustomDynamicList, self).__init__(**kwargs) + self.operation_id = operation_id + self.built_in_operation = built_in_operation + self.items_path = items_path + self.item_value_path = item_value_path + self.item_title_path = item_title_path + self.parameters = parameters + + +class SwaggerCustomDynamicProperties(msrest.serialization.Model): + """The swagger custom dynamic properties. + + :param operation_id: The operation id to fetch dynamic schema. + :type operation_id: str + :param value_path: Json pointer to the dynamic schema on the response body. + :type value_path: str + :param parameters: The operation parameters. + :type parameters: dict[str, ~azure.mgmt.logic.models.SwaggerCustomDynamicProperties] + """ + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'value_path': {'key': 'valuePath', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{SwaggerCustomDynamicProperties}'}, + } + + def __init__( + self, + *, + operation_id: Optional[str] = None, + value_path: Optional[str] = None, + parameters: Optional[Dict[str, "SwaggerCustomDynamicProperties"]] = None, + **kwargs + ): + super(SwaggerCustomDynamicProperties, self).__init__(**kwargs) + self.operation_id = operation_id + self.value_path = value_path + self.parameters = parameters + + +class SwaggerCustomDynamicSchema(msrest.serialization.Model): + """The swagger custom dynamic schema. + + :param operation_id: The operation id to fetch dynamic schema. + :type operation_id: str + :param value_path: Json pointer to the dynamic schema on the response body. + :type value_path: str + :param parameters: The operation parameters. + :type parameters: dict[str, object] + """ + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'value_path': {'key': 'valuePath', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{object}'}, + } + + def __init__( + self, + *, + operation_id: Optional[str] = None, + value_path: Optional[str] = None, + parameters: Optional[Dict[str, object]] = None, + **kwargs + ): + super(SwaggerCustomDynamicSchema, self).__init__(**kwargs) + self.operation_id = operation_id + self.value_path = value_path + self.parameters = parameters + + +class SwaggerCustomDynamicTree(msrest.serialization.Model): + """The swagger custom dynamic tree. + + :param settings: The tree settings. + :type settings: ~azure.mgmt.logic.models.SwaggerCustomDynamicTreeSettings + :param open: The tree on-open configuration. + :type open: ~azure.mgmt.logic.models.SwaggerCustomDynamicTreeCommand + :param browse: The tree on-browse configuration. + :type browse: ~azure.mgmt.logic.models.SwaggerCustomDynamicTreeCommand + """ + + _attribute_map = { + 'settings': {'key': 'settings', 'type': 'SwaggerCustomDynamicTreeSettings'}, + 'open': {'key': 'open', 'type': 'SwaggerCustomDynamicTreeCommand'}, + 'browse': {'key': 'browse', 'type': 'SwaggerCustomDynamicTreeCommand'}, + } + + def __init__( + self, + *, + settings: Optional["SwaggerCustomDynamicTreeSettings"] = None, + open: Optional["SwaggerCustomDynamicTreeCommand"] = None, + browse: Optional["SwaggerCustomDynamicTreeCommand"] = None, + **kwargs + ): + super(SwaggerCustomDynamicTree, self).__init__(**kwargs) + self.settings = settings + self.open = open + self.browse = browse + + +class SwaggerCustomDynamicTreeCommand(msrest.serialization.Model): + """The swagger tree command. + + :param operation_id: The path to an item property which defines the display name of the item. + :type operation_id: str + :param items_path: The path to an item property which defines the display name of the item. + :type items_path: str + :param item_value_path: The path to an item property which defines the display name of the + item. + :type item_value_path: str + :param item_title_path: The path to an item property which defines the display name of the + item. + :type item_title_path: str + :param item_full_title_path: The path to an item property which defines the display name of the + item. + :type item_full_title_path: str + :param item_is_parent: The path to an item property which defines the display name of the item. + :type item_is_parent: str + :param selectable_filter: The path to an item property which defines the display name of the + item. + :type selectable_filter: str + :param parameters: Dictionary of :code:``. + :type parameters: dict[str, ~azure.mgmt.logic.models.SwaggerCustomDynamicTreeParameter] + """ + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + 'items_path': {'key': 'itemsPath', 'type': 'str'}, + 'item_value_path': {'key': 'itemValuePath', 'type': 'str'}, + 'item_title_path': {'key': 'itemTitlePath', 'type': 'str'}, + 'item_full_title_path': {'key': 'itemFullTitlePath', 'type': 'str'}, + 'item_is_parent': {'key': 'itemIsParent', 'type': 'str'}, + 'selectable_filter': {'key': 'selectableFilter', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{SwaggerCustomDynamicTreeParameter}'}, + } + + def __init__( + self, + *, + operation_id: Optional[str] = None, + items_path: Optional[str] = None, + item_value_path: Optional[str] = None, + item_title_path: Optional[str] = None, + item_full_title_path: Optional[str] = None, + item_is_parent: Optional[str] = None, + selectable_filter: Optional[str] = None, + parameters: Optional[Dict[str, "SwaggerCustomDynamicTreeParameter"]] = None, + **kwargs + ): + super(SwaggerCustomDynamicTreeCommand, self).__init__(**kwargs) + self.operation_id = operation_id + self.items_path = items_path + self.item_value_path = item_value_path + self.item_title_path = item_title_path + self.item_full_title_path = item_full_title_path + self.item_is_parent = item_is_parent + self.selectable_filter = selectable_filter + self.parameters = parameters + + +class SwaggerCustomDynamicTreeParameter(msrest.serialization.Model): + """The swagger custom dynamic tree parameter. + + :param selected_item_value_path: Gets or sets a path to a property in the currently selected + item to pass as a value to a parameter for the given operation. + :type selected_item_value_path: str + :param value: The parameter value. + :type value: object + :param parameter_reference: The parameter reference. + :type parameter_reference: str + :param required: Indicates whether the parameter is required. + :type required: bool + """ + + _attribute_map = { + 'selected_item_value_path': {'key': 'selectedItemValuePath', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'parameter_reference': {'key': 'parameterReference', 'type': 'str'}, + 'required': {'key': 'required', 'type': 'bool'}, + } + + def __init__( + self, + *, + selected_item_value_path: Optional[str] = None, + value: Optional[object] = None, + parameter_reference: Optional[str] = None, + required: Optional[bool] = None, + **kwargs + ): + super(SwaggerCustomDynamicTreeParameter, self).__init__(**kwargs) + self.selected_item_value_path = selected_item_value_path + self.value = value + self.parameter_reference = parameter_reference + self.required = required + + +class SwaggerCustomDynamicTreeSettings(msrest.serialization.Model): + """The swagger custom dynamic tree settings. + + :param can_select_parent_nodes: Indicates whether parent nodes can be selected. + :type can_select_parent_nodes: bool + :param can_select_leaf_nodes: Indicates whether leaf nodes can be selected. + :type can_select_leaf_nodes: bool + """ + + _attribute_map = { + 'can_select_parent_nodes': {'key': 'CanSelectParentNodes', 'type': 'bool'}, + 'can_select_leaf_nodes': {'key': 'CanSelectLeafNodes', 'type': 'bool'}, + } + + def __init__( + self, + *, + can_select_parent_nodes: Optional[bool] = None, + can_select_leaf_nodes: Optional[bool] = None, + **kwargs + ): + super(SwaggerCustomDynamicTreeSettings, self).__init__(**kwargs) + self.can_select_parent_nodes = can_select_parent_nodes + self.can_select_leaf_nodes = can_select_leaf_nodes + + +class SwaggerExternalDocumentation(msrest.serialization.Model): + """The swagger external documentation. + + :param description: The document description. + :type description: str + :param uri: The documentation Uri. + :type uri: str + :param extensions: The vendor extensions. + :type extensions: dict[str, object] + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'extensions': {'key': 'extensions', 'type': '{object}'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + uri: Optional[str] = None, + extensions: Optional[Dict[str, object]] = None, + **kwargs + ): + super(SwaggerExternalDocumentation, self).__init__(**kwargs) + self.description = description + self.uri = uri + self.extensions = extensions + + +class SwaggerSchema(msrest.serialization.Model): + """The swagger schema. + + :param ref: The reference. + :type ref: str + :param type: The type. Possible values include: "String", "Number", "Integer", "Boolean", + "Array", "File", "Object", "Null". + :type type: str or ~azure.mgmt.logic.models.SwaggerSchemaType + :param title: The title. + :type title: str + :param items: The items schema. + :type items: ~azure.mgmt.logic.models.SwaggerSchema + :param properties: The object properties. + :type properties: dict[str, ~azure.mgmt.logic.models.SwaggerSchema] + :param additional_properties: The additional properties. + :type additional_properties: object + :param required: The object required properties. + :type required: list[str] + :param max_properties: The maximum number of allowed properties. + :type max_properties: int + :param min_properties: The minimum number of allowed properties. + :type min_properties: int + :param all_of: The schemas which must pass validation when this schema is used. + :type all_of: list[~azure.mgmt.logic.models.SwaggerSchema] + :param discriminator: The discriminator. + :type discriminator: str + :param read_only: Indicates whether this property must be present in the a request. + :type read_only: bool + :param xml: The xml representation format for a property. + :type xml: ~azure.mgmt.logic.models.SwaggerXml + :param external_docs: The external documentation. + :type external_docs: ~azure.mgmt.logic.models.SwaggerExternalDocumentation + :param example: The example value. + :type example: object + :param notification_url_extension: Indicates the notification url extension. If this is set, + the property's value should be a callback url for a webhook. + :type notification_url_extension: bool + :param dynamic_schema_old: The dynamic schema configuration. + :type dynamic_schema_old: ~azure.mgmt.logic.models.SwaggerCustomDynamicSchema + :param dynamic_schema_new: The dynamic schema configuration. + :type dynamic_schema_new: ~azure.mgmt.logic.models.SwaggerCustomDynamicProperties + :param dynamic_list_new: The dynamic list. + :type dynamic_list_new: ~azure.mgmt.logic.models.SwaggerCustomDynamicList + :param dynamic_tree: The dynamic values tree configuration. + :type dynamic_tree: ~azure.mgmt.logic.models.SwaggerCustomDynamicTree + """ + + _attribute_map = { + 'ref': {'key': 'ref', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'items': {'key': 'items', 'type': 'SwaggerSchema'}, + 'properties': {'key': 'properties', 'type': '{SwaggerSchema}'}, + 'additional_properties': {'key': 'additionalProperties', 'type': 'object'}, + 'required': {'key': 'required', 'type': '[str]'}, + 'max_properties': {'key': 'maxProperties', 'type': 'int'}, + 'min_properties': {'key': 'minProperties', 'type': 'int'}, + 'all_of': {'key': 'allOf', 'type': '[SwaggerSchema]'}, + 'discriminator': {'key': 'discriminator', 'type': 'str'}, + 'read_only': {'key': 'readOnly', 'type': 'bool'}, + 'xml': {'key': 'xml', 'type': 'SwaggerXml'}, + 'external_docs': {'key': 'externalDocs', 'type': 'SwaggerExternalDocumentation'}, + 'example': {'key': 'example', 'type': 'object'}, + 'notification_url_extension': {'key': 'notificationUrlExtension', 'type': 'bool'}, + 'dynamic_schema_old': {'key': 'dynamicSchemaOld', 'type': 'SwaggerCustomDynamicSchema'}, + 'dynamic_schema_new': {'key': 'dynamicSchemaNew', 'type': 'SwaggerCustomDynamicProperties'}, + 'dynamic_list_new': {'key': 'dynamicListNew', 'type': 'SwaggerCustomDynamicList'}, + 'dynamic_tree': {'key': 'dynamicTree', 'type': 'SwaggerCustomDynamicTree'}, + } + + def __init__( + self, + *, + ref: Optional[str] = None, + type: Optional[Union[str, "SwaggerSchemaType"]] = None, + title: Optional[str] = None, + items: Optional["SwaggerSchema"] = None, + properties: Optional[Dict[str, "SwaggerSchema"]] = None, + additional_properties: Optional[object] = None, + required: Optional[List[str]] = None, + max_properties: Optional[int] = None, + min_properties: Optional[int] = None, + all_of: Optional[List["SwaggerSchema"]] = None, + discriminator: Optional[str] = None, + read_only: Optional[bool] = None, + xml: Optional["SwaggerXml"] = None, + external_docs: Optional["SwaggerExternalDocumentation"] = None, + example: Optional[object] = None, + notification_url_extension: Optional[bool] = None, + dynamic_schema_old: Optional["SwaggerCustomDynamicSchema"] = None, + dynamic_schema_new: Optional["SwaggerCustomDynamicProperties"] = None, + dynamic_list_new: Optional["SwaggerCustomDynamicList"] = None, + dynamic_tree: Optional["SwaggerCustomDynamicTree"] = None, + **kwargs + ): + super(SwaggerSchema, self).__init__(**kwargs) + self.ref = ref + self.type = type + self.title = title + self.items = items + self.properties = properties + self.additional_properties = additional_properties + self.required = required + self.max_properties = max_properties + self.min_properties = min_properties + self.all_of = all_of + self.discriminator = discriminator + self.read_only = read_only + self.xml = xml + self.external_docs = external_docs + self.example = example + self.notification_url_extension = notification_url_extension + self.dynamic_schema_old = dynamic_schema_old + self.dynamic_schema_new = dynamic_schema_new + self.dynamic_list_new = dynamic_list_new + self.dynamic_tree = dynamic_tree + + +class SwaggerXml(msrest.serialization.Model): + """The Swagger XML. + + :param name: The xml element or attribute name. + :type name: str + :param namespace: The xml namespace. + :type namespace: str + :param prefix: The name prefix. + :type prefix: str + :param attribute: Indicates whether the property should be an attribute instead of an element. + :type attribute: bool + :param wrapped: Indicates whether the array elements are wrapped in a container element. + :type wrapped: bool + :param extensions: The vendor extensions. + :type extensions: dict[str, object] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'prefix': {'key': 'prefix', 'type': 'str'}, + 'attribute': {'key': 'attribute', 'type': 'bool'}, + 'wrapped': {'key': 'wrapped', 'type': 'bool'}, + 'extensions': {'key': 'extensions', 'type': '{object}'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + namespace: Optional[str] = None, + prefix: Optional[str] = None, + attribute: Optional[bool] = None, + wrapped: Optional[bool] = None, + extensions: Optional[Dict[str, object]] = None, + **kwargs + ): + super(SwaggerXml, self).__init__(**kwargs) + self.name = name + self.namespace = namespace + self.prefix = prefix + self.attribute = attribute + self.wrapped = wrapped + self.extensions = extensions + + +class TrackingEvent(msrest.serialization.Model): + """The tracking event. + + All required parameters must be populated in order to send to Azure. + + :param event_level: Required. The event level. Possible values include: "LogAlways", + "Critical", "Error", "Warning", "Informational", "Verbose". + :type event_level: str or ~azure.mgmt.logic.models.EventLevel + :param event_time: Required. The event time. + :type event_time: ~datetime.datetime + :param record_type: Required. The record type. Possible values include: "NotSpecified", + "Custom", "AS2Message", "AS2MDN", "X12Interchange", "X12FunctionalGroup", "X12TransactionSet", + "X12InterchangeAcknowledgment", "X12FunctionalGroupAcknowledgment", + "X12TransactionSetAcknowledgment", "EdifactInterchange", "EdifactFunctionalGroup", + "EdifactTransactionSet", "EdifactInterchangeAcknowledgment", + "EdifactFunctionalGroupAcknowledgment", "EdifactTransactionSetAcknowledgment". + :type record_type: str or ~azure.mgmt.logic.models.TrackingRecordType + :param record: The record. + :type record: object + :param error: The error. + :type error: ~azure.mgmt.logic.models.TrackingEventErrorInfo + """ + + _validation = { + 'event_level': {'required': True}, + 'event_time': {'required': True}, + 'record_type': {'required': True}, + } + + _attribute_map = { + 'event_level': {'key': 'eventLevel', 'type': 'str'}, + 'event_time': {'key': 'eventTime', 'type': 'iso-8601'}, + 'record_type': {'key': 'recordType', 'type': 'str'}, + 'record': {'key': 'record', 'type': 'object'}, + 'error': {'key': 'error', 'type': 'TrackingEventErrorInfo'}, + } + + def __init__( + self, + *, + event_level: Union[str, "EventLevel"], + event_time: datetime.datetime, + record_type: Union[str, "TrackingRecordType"], + record: Optional[object] = None, + error: Optional["TrackingEventErrorInfo"] = None, + **kwargs + ): + super(TrackingEvent, self).__init__(**kwargs) + self.event_level = event_level + self.event_time = event_time + self.record_type = record_type + self.record = record + self.error = error + + +class TrackingEventErrorInfo(msrest.serialization.Model): + """The tracking event error info. + + :param message: The message. + :type message: str + :param code: The code. + :type code: str + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__( + self, + *, + message: Optional[str] = None, + code: Optional[str] = None, + **kwargs + ): + super(TrackingEventErrorInfo, self).__init__(**kwargs) + self.message = message + self.code = code + + +class TrackingEventsDefinition(msrest.serialization.Model): + """The tracking events definition. + + All required parameters must be populated in order to send to Azure. + + :param source_type: Required. The source type. + :type source_type: str + :param track_events_options: The track events options. Possible values include: "None", + "DisableSourceInfoEnrich". + :type track_events_options: str or ~azure.mgmt.logic.models.TrackEventsOperationOptions + :param events: Required. The events. + :type events: list[~azure.mgmt.logic.models.TrackingEvent] + """ + + _validation = { + 'source_type': {'required': True}, + 'events': {'required': True}, + } + + _attribute_map = { + 'source_type': {'key': 'sourceType', 'type': 'str'}, + 'track_events_options': {'key': 'trackEventsOptions', 'type': 'str'}, + 'events': {'key': 'events', 'type': '[TrackingEvent]'}, + } + + def __init__( + self, + *, + source_type: str, + events: List["TrackingEvent"], + track_events_options: Optional[Union[str, "TrackEventsOperationOptions"]] = None, + **kwargs + ): + super(TrackingEventsDefinition, self).__init__(**kwargs) + self.source_type = source_type + self.track_events_options = track_events_options + self.events = events + + +class Workflow(Resource): + """The workflow type. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :ivar provisioning_state: Gets the provisioning state. Possible values include: "NotSpecified", + "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", + "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :vartype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState + :ivar created_time: Gets the created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: Gets the changed time. + :vartype changed_time: ~datetime.datetime + :param state: The state. Possible values include: "NotSpecified", "Completed", "Enabled", + "Disabled", "Deleted", "Suspended". + :type state: str or ~azure.mgmt.logic.models.WorkflowState + :ivar version: Gets the version. + :vartype version: str + :ivar access_endpoint: Gets the access endpoint. + :vartype access_endpoint: str + :param endpoints_configuration: The endpoints configuration. + :type endpoints_configuration: ~azure.mgmt.logic.models.FlowEndpointsConfiguration + :param access_control: The access control configuration. + :type access_control: ~azure.mgmt.logic.models.FlowAccessControlConfiguration + :ivar sku: The sku. + :vartype sku: ~azure.mgmt.logic.models.Sku + :param integration_account: The integration account. + :type integration_account: ~azure.mgmt.logic.models.ResourceReference + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~azure.mgmt.logic.models.ResourceReference + :param definition: The definition. + :type definition: object + :param parameters: The parameters. + :type parameters: dict[str, ~azure.mgmt.logic.models.WorkflowParameter] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'version': {'readonly': True}, + 'access_endpoint': {'readonly': True}, + 'sku': {'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}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'access_endpoint': {'key': 'properties.accessEndpoint', 'type': 'str'}, + 'endpoints_configuration': {'key': 'properties.endpointsConfiguration', 'type': 'FlowEndpointsConfiguration'}, + 'access_control': {'key': 'properties.accessControl', 'type': 'FlowAccessControlConfiguration'}, + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'integration_account': {'key': 'properties.integrationAccount', 'type': 'ResourceReference'}, + 'integration_service_environment': {'key': 'properties.integrationServiceEnvironment', 'type': 'ResourceReference'}, + 'definition': {'key': 'properties.definition', 'type': 'object'}, + 'parameters': {'key': 'properties.parameters', 'type': '{WorkflowParameter}'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + state: Optional[Union[str, "WorkflowState"]] = None, + endpoints_configuration: Optional["FlowEndpointsConfiguration"] = None, + access_control: Optional["FlowAccessControlConfiguration"] = None, + integration_account: Optional["ResourceReference"] = None, + integration_service_environment: Optional["ResourceReference"] = None, + definition: Optional[object] = None, + parameters: Optional[Dict[str, "WorkflowParameter"]] = None, + **kwargs + ): + super(Workflow, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.created_time = None + self.changed_time = None + self.state = state + self.version = None + self.access_endpoint = None + self.endpoints_configuration = endpoints_configuration + self.access_control = access_control + self.sku = None + self.integration_account = integration_account + self.integration_service_environment = integration_service_environment + self.definition = definition + self.parameters = parameters + + +class WorkflowFilter(msrest.serialization.Model): + """The workflow filter. + + :param state: The state of workflows. Possible values include: "NotSpecified", "Completed", + "Enabled", "Disabled", "Deleted", "Suspended". + :type state: str or ~azure.mgmt.logic.models.WorkflowState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + state: Optional[Union[str, "WorkflowState"]] = None, + **kwargs + ): + super(WorkflowFilter, self).__init__(**kwargs) + self.state = state + + +class WorkflowListResult(msrest.serialization.Model): + """The list of workflows. + + :param value: The list of workflows. + :type value: list[~azure.mgmt.logic.models.Workflow] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Workflow]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Workflow"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(WorkflowListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class WorkflowParameter(msrest.serialization.Model): + """The workflow parameters. + + :param type: The type. Possible values include: "NotSpecified", "String", "SecureString", + "Int", "Float", "Bool", "Array", "Object", "SecureObject". + :type type: str or ~azure.mgmt.logic.models.ParameterType + :param value: The value. + :type value: object + :param metadata: The metadata. + :type metadata: object + :param description: The description. + :type description: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ParameterType"]] = None, + value: Optional[object] = None, + metadata: Optional[object] = None, + description: Optional[str] = None, + **kwargs + ): + super(WorkflowParameter, self).__init__(**kwargs) + self.type = type + self.value = value + self.metadata = metadata + self.description = description + + +class WorkflowOutputParameter(WorkflowParameter): + """The workflow output parameter. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: The type. Possible values include: "NotSpecified", "String", "SecureString", + "Int", "Float", "Bool", "Array", "Object", "SecureObject". + :type type: str or ~azure.mgmt.logic.models.ParameterType + :param value: The value. + :type value: object + :param metadata: The metadata. + :type metadata: object + :param description: The description. + :type description: str + :ivar error: Gets the error. + :vartype error: object + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + 'metadata': {'key': 'metadata', 'type': 'object'}, + 'description': {'key': 'description', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'object'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ParameterType"]] = None, + value: Optional[object] = None, + metadata: Optional[object] = None, + description: Optional[str] = None, + **kwargs + ): + super(WorkflowOutputParameter, self).__init__(type=type, value=value, metadata=metadata, description=description, **kwargs) + self.error = None + + +class WorkflowReference(ResourceReference): + """The workflow reference. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The resource id. + :type id: str + :ivar type: Gets the resource type. + :vartype type: str + :param name: The workflow name. + :type name: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + **kwargs + ): + super(WorkflowReference, self).__init__(id=id, **kwargs) + self.name = name + + +class WorkflowRun(SubResource): + """The workflow run. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the workflow run name. + :vartype name: str + :ivar type: Gets the workflow run type. + :vartype type: str + :ivar wait_end_time: Gets the wait end time. + :vartype wait_end_time: ~datetime.datetime + :ivar start_time: Gets the start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: Gets the end time. + :vartype end_time: ~datetime.datetime + :ivar status: Gets the status. Possible values include: "NotSpecified", "Paused", "Running", + "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", + "Aborted", "Ignored". + :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus + :ivar code: Gets the code. + :vartype code: str + :ivar error: Gets the error. + :vartype error: object + :ivar correlation_id: Gets the correlation id. + :vartype correlation_id: str + :param correlation: The run correlation. + :type correlation: ~azure.mgmt.logic.models.Correlation + :ivar workflow: Gets the reference to workflow version. + :vartype workflow: ~azure.mgmt.logic.models.ResourceReference + :ivar trigger: Gets the fired trigger. + :vartype trigger: ~azure.mgmt.logic.models.WorkflowRunTrigger + :ivar outputs: Gets the outputs. + :vartype outputs: dict[str, ~azure.mgmt.logic.models.WorkflowOutputParameter] + :ivar response: Gets the response of the flow run. + :vartype response: ~azure.mgmt.logic.models.WorkflowRunTrigger + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'wait_end_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'status': {'readonly': True}, + 'code': {'readonly': True}, + 'error': {'readonly': True}, + 'correlation_id': {'readonly': True}, + 'workflow': {'readonly': True}, + 'trigger': {'readonly': True}, + 'outputs': {'readonly': True}, + 'response': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'wait_end_time': {'key': 'properties.waitEndTime', 'type': 'iso-8601'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'code': {'key': 'properties.code', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'object'}, + 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, + 'correlation': {'key': 'properties.correlation', 'type': 'Correlation'}, + 'workflow': {'key': 'properties.workflow', 'type': 'ResourceReference'}, + 'trigger': {'key': 'properties.trigger', 'type': 'WorkflowRunTrigger'}, + 'outputs': {'key': 'properties.outputs', 'type': '{WorkflowOutputParameter}'}, + 'response': {'key': 'properties.response', 'type': 'WorkflowRunTrigger'}, + } + + def __init__( + self, + *, + correlation: Optional["Correlation"] = None, + **kwargs + ): + super(WorkflowRun, self).__init__(**kwargs) + self.name = None + self.type = None + self.wait_end_time = None + self.start_time = None + self.end_time = None + self.status = None + self.code = None + self.error = None + self.correlation_id = None + self.correlation = correlation + self.workflow = None + self.trigger = None + self.outputs = None + self.response = None + + +class WorkflowRunAction(SubResource): + """The workflow run action. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the workflow run action name. + :vartype name: str + :ivar type: Gets the workflow run action type. + :vartype type: str + :ivar start_time: Gets the start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: Gets the end time. + :vartype end_time: ~datetime.datetime + :ivar status: Gets the status. Possible values include: "NotSpecified", "Paused", "Running", + "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", + "Aborted", "Ignored". + :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus + :ivar code: Gets the code. + :vartype code: str + :ivar error: Gets the error. + :vartype error: object + :ivar tracking_id: Gets the tracking id. + :vartype tracking_id: str + :param correlation: The correlation properties. + :type correlation: ~azure.mgmt.logic.models.RunActionCorrelation + :ivar inputs_link: Gets the link to inputs. + :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar outputs_link: Gets the link to outputs. + :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar tracked_properties: Gets the tracked properties. + :vartype tracked_properties: object + :param retry_history: Gets the retry histories. + :type retry_history: list[~azure.mgmt.logic.models.RetryHistory] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'status': {'readonly': True}, + 'code': {'readonly': True}, + 'error': {'readonly': True}, + 'tracking_id': {'readonly': True}, + 'inputs_link': {'readonly': True}, + 'outputs_link': {'readonly': True}, + 'tracked_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'code': {'key': 'properties.code', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'object'}, + 'tracking_id': {'key': 'properties.trackingId', 'type': 'str'}, + 'correlation': {'key': 'properties.correlation', 'type': 'RunActionCorrelation'}, + 'inputs_link': {'key': 'properties.inputsLink', 'type': 'ContentLink'}, + 'outputs_link': {'key': 'properties.outputsLink', 'type': 'ContentLink'}, + 'tracked_properties': {'key': 'properties.trackedProperties', 'type': 'object'}, + 'retry_history': {'key': 'properties.retryHistory', 'type': '[RetryHistory]'}, + } + + def __init__( + self, + *, + correlation: Optional["RunActionCorrelation"] = None, + retry_history: Optional[List["RetryHistory"]] = None, + **kwargs + ): + super(WorkflowRunAction, self).__init__(**kwargs) + self.name = None + self.type = None + self.start_time = None + self.end_time = None + self.status = None + self.code = None + self.error = None + self.tracking_id = None + self.correlation = correlation + self.inputs_link = None + self.outputs_link = None + self.tracked_properties = None + self.retry_history = retry_history + + +class WorkflowRunActionFilter(msrest.serialization.Model): + """The workflow run action filter. + + :param status: The status of workflow run action. Possible values include: "NotSpecified", + "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", + "Faulted", "TimedOut", "Aborted", "Ignored". + :type status: str or ~azure.mgmt.logic.models.WorkflowStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "WorkflowStatus"]] = None, + **kwargs + ): + super(WorkflowRunActionFilter, self).__init__(**kwargs) + self.status = status + + +class WorkflowRunActionListResult(msrest.serialization.Model): + """The list of workflow run actions. + + :param value: A list of workflow run actions. + :type value: list[~azure.mgmt.logic.models.WorkflowRunAction] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkflowRunAction]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["WorkflowRunAction"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(WorkflowRunActionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class WorkflowRunActionRepetitionDefinition(Resource): + """The workflow run action repetition definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :param start_time: The start time of the workflow scope repetition. + :type start_time: ~datetime.datetime + :param end_time: The end time of the workflow scope repetition. + :type end_time: ~datetime.datetime + :param correlation: The correlation properties. + :type correlation: ~azure.mgmt.logic.models.RunActionCorrelation + :param status: The status of the workflow scope repetition. Possible values include: + "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", + "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :type status: str or ~azure.mgmt.logic.models.WorkflowStatus + :param code: The workflow scope repetition code. + :type code: str + :param error: Any object. + :type error: object + :ivar tracking_id: Gets the tracking id. + :vartype tracking_id: str + :ivar inputs: Gets the inputs. + :vartype inputs: object + :ivar inputs_link: Gets the link to inputs. + :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar outputs: Gets the outputs. + :vartype outputs: object + :ivar outputs_link: Gets the link to outputs. + :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar tracked_properties: Gets the tracked properties. + :vartype tracked_properties: object + :param retry_history: Gets the retry histories. + :type retry_history: list[~azure.mgmt.logic.models.RetryHistory] + :param iteration_count: + :type iteration_count: int + :param repetition_indexes: The repetition indexes. + :type repetition_indexes: list[~azure.mgmt.logic.models.RepetitionIndex] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tracking_id': {'readonly': True}, + 'inputs': {'readonly': True}, + 'inputs_link': {'readonly': True}, + 'outputs': {'readonly': True}, + 'outputs_link': {'readonly': True}, + 'tracked_properties': {'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}'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'correlation': {'key': 'properties.correlation', 'type': 'RunActionCorrelation'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'code': {'key': 'properties.code', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'object'}, + 'tracking_id': {'key': 'properties.trackingId', 'type': 'str'}, + 'inputs': {'key': 'properties.inputs', 'type': 'object'}, + 'inputs_link': {'key': 'properties.inputsLink', 'type': 'ContentLink'}, + 'outputs': {'key': 'properties.outputs', 'type': 'object'}, + 'outputs_link': {'key': 'properties.outputsLink', 'type': 'ContentLink'}, + 'tracked_properties': {'key': 'properties.trackedProperties', 'type': 'object'}, + 'retry_history': {'key': 'properties.retryHistory', 'type': '[RetryHistory]'}, + 'iteration_count': {'key': 'properties.iterationCount', 'type': 'int'}, + 'repetition_indexes': {'key': 'properties.repetitionIndexes', 'type': '[RepetitionIndex]'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + correlation: Optional["RunActionCorrelation"] = None, + status: Optional[Union[str, "WorkflowStatus"]] = None, + code: Optional[str] = None, + error: Optional[object] = None, + retry_history: Optional[List["RetryHistory"]] = None, + iteration_count: Optional[int] = None, + repetition_indexes: Optional[List["RepetitionIndex"]] = None, + **kwargs + ): + super(WorkflowRunActionRepetitionDefinition, self).__init__(location=location, tags=tags, **kwargs) + self.start_time = start_time + self.end_time = end_time + self.correlation = correlation + self.status = status + self.code = code + self.error = error + self.tracking_id = None + self.inputs = None + self.inputs_link = None + self.outputs = None + self.outputs_link = None + self.tracked_properties = None + self.retry_history = retry_history + self.iteration_count = iteration_count + self.repetition_indexes = repetition_indexes + + +class WorkflowRunActionRepetitionDefinitionCollection(msrest.serialization.Model): + """A collection of workflow run action repetitions. + + :param next_link: The link used to get the next page of recommendations. + :type next_link: str + :param value: + :type value: list[~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinition] + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[WorkflowRunActionRepetitionDefinition]'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + value: Optional[List["WorkflowRunActionRepetitionDefinition"]] = None, + **kwargs + ): + super(WorkflowRunActionRepetitionDefinitionCollection, self).__init__(**kwargs) + self.next_link = next_link + self.value = value + + +class WorkflowRunActionRepetitionProperties(OperationResult): + """The workflow run action repetition properties definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param start_time: The start time of the workflow scope repetition. + :type start_time: ~datetime.datetime + :param end_time: The end time of the workflow scope repetition. + :type end_time: ~datetime.datetime + :param correlation: The correlation properties. + :type correlation: ~azure.mgmt.logic.models.RunActionCorrelation + :param status: The status of the workflow scope repetition. Possible values include: + "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", + "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :type status: str or ~azure.mgmt.logic.models.WorkflowStatus + :param code: The workflow scope repetition code. + :type code: str + :param error: Any object. + :type error: object + :ivar tracking_id: Gets the tracking id. + :vartype tracking_id: str + :ivar inputs: Gets the inputs. + :vartype inputs: object + :ivar inputs_link: Gets the link to inputs. + :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar outputs: Gets the outputs. + :vartype outputs: object + :ivar outputs_link: Gets the link to outputs. + :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar tracked_properties: Gets the tracked properties. + :vartype tracked_properties: object + :param retry_history: Gets the retry histories. + :type retry_history: list[~azure.mgmt.logic.models.RetryHistory] + :param iteration_count: + :type iteration_count: int + :param repetition_indexes: The repetition indexes. + :type repetition_indexes: list[~azure.mgmt.logic.models.RepetitionIndex] + """ + + _validation = { + 'tracking_id': {'readonly': True}, + 'inputs': {'readonly': True}, + 'inputs_link': {'readonly': True}, + 'outputs': {'readonly': True}, + 'outputs_link': {'readonly': True}, + 'tracked_properties': {'readonly': True}, + } + + _attribute_map = { + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'correlation': {'key': 'correlation', 'type': 'RunActionCorrelation'}, + 'status': {'key': 'status', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'object'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': 'object'}, + 'inputs_link': {'key': 'inputsLink', 'type': 'ContentLink'}, + 'outputs': {'key': 'outputs', 'type': 'object'}, + 'outputs_link': {'key': 'outputsLink', 'type': 'ContentLink'}, + 'tracked_properties': {'key': 'trackedProperties', 'type': 'object'}, + 'retry_history': {'key': 'retryHistory', 'type': '[RetryHistory]'}, + 'iteration_count': {'key': 'iterationCount', 'type': 'int'}, + 'repetition_indexes': {'key': 'repetitionIndexes', 'type': '[RepetitionIndex]'}, + } + + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + correlation: Optional["RunActionCorrelation"] = None, + status: Optional[Union[str, "WorkflowStatus"]] = None, + code: Optional[str] = None, + error: Optional[object] = None, + retry_history: Optional[List["RetryHistory"]] = None, + iteration_count: Optional[int] = None, + repetition_indexes: Optional[List["RepetitionIndex"]] = None, + **kwargs + ): + super(WorkflowRunActionRepetitionProperties, self).__init__(start_time=start_time, end_time=end_time, correlation=correlation, status=status, code=code, error=error, retry_history=retry_history, iteration_count=iteration_count, **kwargs) + self.repetition_indexes = repetition_indexes + + +class WorkflowRunFilter(msrest.serialization.Model): + """The workflow run filter. + + :param status: The status of workflow run. Possible values include: "NotSpecified", "Paused", + "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", + "TimedOut", "Aborted", "Ignored". + :type status: str or ~azure.mgmt.logic.models.WorkflowStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "WorkflowStatus"]] = None, + **kwargs + ): + super(WorkflowRunFilter, self).__init__(**kwargs) + self.status = status + + +class WorkflowRunListResult(msrest.serialization.Model): + """The list of workflow runs. + + :param value: A list of workflow runs. + :type value: list[~azure.mgmt.logic.models.WorkflowRun] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkflowRun]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["WorkflowRun"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(WorkflowRunListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class WorkflowRunTrigger(msrest.serialization.Model): + """The workflow run trigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Gets the name. + :vartype name: str + :ivar inputs: Gets the inputs. + :vartype inputs: object + :ivar inputs_link: Gets the link to inputs. + :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar outputs: Gets the outputs. + :vartype outputs: object + :ivar outputs_link: Gets the link to outputs. + :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar scheduled_time: Gets the scheduled time. + :vartype scheduled_time: ~datetime.datetime + :ivar start_time: Gets the start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: Gets the end time. + :vartype end_time: ~datetime.datetime + :ivar tracking_id: Gets the tracking id. + :vartype tracking_id: str + :param correlation: The run correlation. + :type correlation: ~azure.mgmt.logic.models.Correlation + :ivar code: Gets the code. + :vartype code: str + :ivar status: Gets the status. Possible values include: "NotSpecified", "Paused", "Running", + "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", + "Aborted", "Ignored". + :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus + :ivar error: Gets the error. + :vartype error: object + :ivar tracked_properties: Gets the tracked properties. + :vartype tracked_properties: object + """ + + _validation = { + 'name': {'readonly': True}, + 'inputs': {'readonly': True}, + 'inputs_link': {'readonly': True}, + 'outputs': {'readonly': True}, + 'outputs_link': {'readonly': True}, + 'scheduled_time': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'tracking_id': {'readonly': True}, + 'code': {'readonly': True}, + 'status': {'readonly': True}, + 'error': {'readonly': True}, + 'tracked_properties': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': 'object'}, + 'inputs_link': {'key': 'inputsLink', 'type': 'ContentLink'}, + 'outputs': {'key': 'outputs', 'type': 'object'}, + 'outputs_link': {'key': 'outputsLink', 'type': 'ContentLink'}, + 'scheduled_time': {'key': 'scheduledTime', 'type': 'iso-8601'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'tracking_id': {'key': 'trackingId', 'type': 'str'}, + 'correlation': {'key': 'correlation', 'type': 'Correlation'}, + 'code': {'key': 'code', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'object'}, + 'tracked_properties': {'key': 'trackedProperties', 'type': 'object'}, + } + + def __init__( + self, + *, + correlation: Optional["Correlation"] = None, + **kwargs + ): + super(WorkflowRunTrigger, self).__init__(**kwargs) + self.name = None + self.inputs = None + self.inputs_link = None + self.outputs = None + self.outputs_link = None + self.scheduled_time = None + self.start_time = None + self.end_time = None + self.tracking_id = None + self.correlation = correlation + self.code = None + self.status = None + self.error = None + self.tracked_properties = None + + +class WorkflowTrigger(SubResource): + """The workflow trigger. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the workflow trigger name. + :vartype name: str + :ivar type: Gets the workflow trigger type. + :vartype type: str + :ivar provisioning_state: Gets the provisioning state. Possible values include: "NotSpecified", + "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", + "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + "Unregistered", "Completed". + :vartype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowTriggerProvisioningState + :ivar created_time: Gets the created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: Gets the changed time. + :vartype changed_time: ~datetime.datetime + :ivar state: Gets the state. Possible values include: "NotSpecified", "Completed", "Enabled", + "Disabled", "Deleted", "Suspended". + :vartype state: str or ~azure.mgmt.logic.models.WorkflowState + :ivar status: Gets the status. Possible values include: "NotSpecified", "Paused", "Running", + "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", + "Aborted", "Ignored". + :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus + :ivar last_execution_time: Gets the last execution time. + :vartype last_execution_time: ~datetime.datetime + :ivar next_execution_time: Gets the next execution time. + :vartype next_execution_time: ~datetime.datetime + :ivar recurrence: Gets the workflow trigger recurrence. + :vartype recurrence: ~azure.mgmt.logic.models.WorkflowTriggerRecurrence + :ivar workflow: Gets the reference to workflow. + :vartype workflow: ~azure.mgmt.logic.models.ResourceReference + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'state': {'readonly': True}, + 'status': {'readonly': True}, + 'last_execution_time': {'readonly': True}, + 'next_execution_time': {'readonly': True}, + 'recurrence': {'readonly': True}, + 'workflow': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'last_execution_time': {'key': 'properties.lastExecutionTime', 'type': 'iso-8601'}, + 'next_execution_time': {'key': 'properties.nextExecutionTime', 'type': 'iso-8601'}, + 'recurrence': {'key': 'properties.recurrence', 'type': 'WorkflowTriggerRecurrence'}, + 'workflow': {'key': 'properties.workflow', 'type': 'ResourceReference'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkflowTrigger, self).__init__(**kwargs) + self.name = None + self.type = None + self.provisioning_state = None + self.created_time = None + self.changed_time = None + self.state = None + self.status = None + self.last_execution_time = None + self.next_execution_time = None + self.recurrence = None + self.workflow = None + + +class WorkflowTriggerCallbackUrl(msrest.serialization.Model): + """The workflow trigger callback URL. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Gets the workflow trigger callback URL. + :vartype value: str + :ivar method: Gets the workflow trigger callback URL HTTP method. + :vartype method: str + :ivar base_path: Gets the workflow trigger callback URL base path. + :vartype base_path: str + :ivar relative_path: Gets the workflow trigger callback URL relative path. + :vartype relative_path: str + :param relative_path_parameters: Gets the workflow trigger callback URL relative path + parameters. + :type relative_path_parameters: list[str] + :param queries: Gets the workflow trigger callback URL query parameters. + :type queries: ~azure.mgmt.logic.models.WorkflowTriggerListCallbackUrlQueries + """ + + _validation = { + 'value': {'readonly': True}, + 'method': {'readonly': True}, + 'base_path': {'readonly': True}, + 'relative_path': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'method': {'key': 'method', 'type': 'str'}, + 'base_path': {'key': 'basePath', 'type': 'str'}, + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'relative_path_parameters': {'key': 'relativePathParameters', 'type': '[str]'}, + 'queries': {'key': 'queries', 'type': 'WorkflowTriggerListCallbackUrlQueries'}, + } + + def __init__( + self, + *, + relative_path_parameters: Optional[List[str]] = None, + queries: Optional["WorkflowTriggerListCallbackUrlQueries"] = None, + **kwargs + ): + super(WorkflowTriggerCallbackUrl, self).__init__(**kwargs) + self.value = None + self.method = None + self.base_path = None + self.relative_path = None + self.relative_path_parameters = relative_path_parameters + self.queries = queries + + +class WorkflowTriggerFilter(msrest.serialization.Model): + """The workflow trigger filter. + + :param state: The state of workflow trigger. Possible values include: "NotSpecified", + "Completed", "Enabled", "Disabled", "Deleted", "Suspended". + :type state: str or ~azure.mgmt.logic.models.WorkflowState + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + } + + def __init__( + self, + *, + state: Optional[Union[str, "WorkflowState"]] = None, + **kwargs + ): + super(WorkflowTriggerFilter, self).__init__(**kwargs) + self.state = state + + +class WorkflowTriggerHistory(SubResource): + """The workflow trigger history. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the workflow trigger history name. + :vartype name: str + :ivar type: Gets the workflow trigger history type. + :vartype type: str + :ivar start_time: Gets the start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: Gets the end time. + :vartype end_time: ~datetime.datetime + :ivar scheduled_time: The scheduled time. + :vartype scheduled_time: ~datetime.datetime + :ivar status: Gets the status. Possible values include: "NotSpecified", "Paused", "Running", + "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", + "Aborted", "Ignored". + :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus + :ivar code: Gets the code. + :vartype code: str + :ivar error: Gets the error. + :vartype error: object + :ivar tracking_id: Gets the tracking id. + :vartype tracking_id: str + :param correlation: The run correlation. + :type correlation: ~azure.mgmt.logic.models.Correlation + :ivar inputs_link: Gets the link to input parameters. + :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar outputs_link: Gets the link to output parameters. + :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink + :ivar fired: The value indicating whether trigger was fired. + :vartype fired: bool + :ivar run: Gets the reference to workflow run. + :vartype run: ~azure.mgmt.logic.models.ResourceReference + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'scheduled_time': {'readonly': True}, + 'status': {'readonly': True}, + 'code': {'readonly': True}, + 'error': {'readonly': True}, + 'tracking_id': {'readonly': True}, + 'inputs_link': {'readonly': True}, + 'outputs_link': {'readonly': True}, + 'fired': {'readonly': True}, + 'run': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, + 'scheduled_time': {'key': 'properties.scheduledTime', 'type': 'iso-8601'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'code': {'key': 'properties.code', 'type': 'str'}, + 'error': {'key': 'properties.error', 'type': 'object'}, + 'tracking_id': {'key': 'properties.trackingId', 'type': 'str'}, + 'correlation': {'key': 'properties.correlation', 'type': 'Correlation'}, + 'inputs_link': {'key': 'properties.inputsLink', 'type': 'ContentLink'}, + 'outputs_link': {'key': 'properties.outputsLink', 'type': 'ContentLink'}, + 'fired': {'key': 'properties.fired', 'type': 'bool'}, + 'run': {'key': 'properties.run', 'type': 'ResourceReference'}, + } + + def __init__( + self, + *, + correlation: Optional["Correlation"] = None, + **kwargs + ): + super(WorkflowTriggerHistory, self).__init__(**kwargs) + self.name = None + self.type = None + self.start_time = None + self.end_time = None + self.scheduled_time = None + self.status = None + self.code = None + self.error = None + self.tracking_id = None + self.correlation = correlation + self.inputs_link = None + self.outputs_link = None + self.fired = None + self.run = None + + +class WorkflowTriggerHistoryFilter(msrest.serialization.Model): + """The workflow trigger history filter. + + :param status: The status of workflow trigger history. Possible values include: "NotSpecified", + "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", + "Faulted", "TimedOut", "Aborted", "Ignored". + :type status: str or ~azure.mgmt.logic.models.WorkflowStatus + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "WorkflowStatus"]] = None, + **kwargs + ): + super(WorkflowTriggerHistoryFilter, self).__init__(**kwargs) + self.status = status + + +class WorkflowTriggerHistoryListResult(msrest.serialization.Model): + """The list of workflow trigger histories. + + :param value: A list of workflow trigger histories. + :type value: list[~azure.mgmt.logic.models.WorkflowTriggerHistory] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkflowTriggerHistory]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["WorkflowTriggerHistory"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(WorkflowTriggerHistoryListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class WorkflowTriggerListCallbackUrlQueries(msrest.serialization.Model): + """Gets the workflow trigger callback URL query parameters. + + :param api_version: The api version. + :type api_version: str + :param sp: The SAS permissions. + :type sp: str + :param sv: The SAS version. + :type sv: str + :param sig: The SAS signature. + :type sig: str + :param se: The SAS timestamp. + :type se: str + """ + + _attribute_map = { + 'api_version': {'key': 'api-version', 'type': 'str'}, + 'sp': {'key': 'sp', 'type': 'str'}, + 'sv': {'key': 'sv', 'type': 'str'}, + 'sig': {'key': 'sig', 'type': 'str'}, + 'se': {'key': 'se', 'type': 'str'}, + } + + def __init__( + self, + *, + api_version: Optional[str] = None, + sp: Optional[str] = None, + sv: Optional[str] = None, + sig: Optional[str] = None, + se: Optional[str] = None, + **kwargs + ): + super(WorkflowTriggerListCallbackUrlQueries, self).__init__(**kwargs) + self.api_version = api_version + self.sp = sp + self.sv = sv + self.sig = sig + self.se = se + + +class WorkflowTriggerListResult(msrest.serialization.Model): + """The list of workflow triggers. + + :param value: A list of workflow triggers. + :type value: list[~azure.mgmt.logic.models.WorkflowTrigger] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkflowTrigger]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["WorkflowTrigger"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(WorkflowTriggerListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class WorkflowTriggerRecurrence(msrest.serialization.Model): + """The workflow trigger recurrence. + + :param frequency: The frequency. Possible values include: "NotSpecified", "Second", "Minute", + "Hour", "Day", "Week", "Month", "Year". + :type frequency: str or ~azure.mgmt.logic.models.RecurrenceFrequency + :param interval: The interval. + :type interval: int + :param start_time: The start time. + :type start_time: str + :param end_time: The end time. + :type end_time: str + :param time_zone: The time zone. + :type time_zone: str + :param schedule: The recurrence schedule. + :type schedule: ~azure.mgmt.logic.models.RecurrenceSchedule + """ + + _attribute_map = { + 'frequency': {'key': 'frequency', 'type': 'str'}, + 'interval': {'key': 'interval', 'type': 'int'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'time_zone': {'key': 'timeZone', 'type': 'str'}, + 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + } + + def __init__( + self, + *, + frequency: Optional[Union[str, "RecurrenceFrequency"]] = None, + interval: Optional[int] = None, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + time_zone: Optional[str] = None, + schedule: Optional["RecurrenceSchedule"] = None, + **kwargs + ): + super(WorkflowTriggerRecurrence, self).__init__(**kwargs) + self.frequency = frequency + self.interval = interval + self.start_time = start_time + self.end_time = end_time + self.time_zone = time_zone + self.schedule = schedule + + +class WorkflowTriggerReference(ResourceReference): + """The workflow trigger reference. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param id: The resource id. + :type id: str + :ivar type: Gets the resource type. + :vartype type: str + :param name: The workflow trigger resource reference name. + :type name: str + :param flow_name: The workflow name. + :type flow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + """ + + _validation = { + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'flow_name': {'key': 'flowName', 'type': 'str'}, + 'trigger_name': {'key': 'triggerName', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + name: Optional[str] = None, + flow_name: Optional[str] = None, + trigger_name: Optional[str] = None, + **kwargs + ): + super(WorkflowTriggerReference, self).__init__(id=id, **kwargs) + self.name = name + self.flow_name = flow_name + self.trigger_name = trigger_name + + +class WorkflowVersion(Resource): + """The workflow version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The resource id. + :vartype id: str + :ivar name: Gets the resource name. + :vartype name: str + :ivar type: Gets the resource type. + :vartype type: str + :param location: The resource location. + :type location: str + :param tags: A set of tags. The resource tags. + :type tags: dict[str, str] + :ivar provisioning_state: The provisioning state. Possible values include: "NotSpecified", + "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", + "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :vartype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState + :ivar created_time: Gets the created time. + :vartype created_time: ~datetime.datetime + :ivar changed_time: Gets the changed time. + :vartype changed_time: ~datetime.datetime + :param state: The state. Possible values include: "NotSpecified", "Completed", "Enabled", + "Disabled", "Deleted", "Suspended". + :type state: str or ~azure.mgmt.logic.models.WorkflowState + :ivar version: Gets the version. + :vartype version: str + :ivar access_endpoint: Gets the access endpoint. + :vartype access_endpoint: str + :param endpoints_configuration: The endpoints configuration. + :type endpoints_configuration: ~azure.mgmt.logic.models.FlowEndpointsConfiguration + :param access_control: The access control configuration. + :type access_control: ~azure.mgmt.logic.models.FlowAccessControlConfiguration + :ivar sku: The sku. + :vartype sku: ~azure.mgmt.logic.models.Sku + :param integration_account: The integration account. + :type integration_account: ~azure.mgmt.logic.models.ResourceReference + :param definition: The definition. + :type definition: object + :param parameters: The parameters. + :type parameters: dict[str, ~azure.mgmt.logic.models.WorkflowParameter] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'created_time': {'readonly': True}, + 'changed_time': {'readonly': True}, + 'version': {'readonly': True}, + 'access_endpoint': {'readonly': True}, + 'sku': {'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}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, + 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'access_endpoint': {'key': 'properties.accessEndpoint', 'type': 'str'}, + 'endpoints_configuration': {'key': 'properties.endpointsConfiguration', 'type': 'FlowEndpointsConfiguration'}, + 'access_control': {'key': 'properties.accessControl', 'type': 'FlowAccessControlConfiguration'}, + 'sku': {'key': 'properties.sku', 'type': 'Sku'}, + 'integration_account': {'key': 'properties.integrationAccount', 'type': 'ResourceReference'}, + 'definition': {'key': 'properties.definition', 'type': 'object'}, + 'parameters': {'key': 'properties.parameters', 'type': '{WorkflowParameter}'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + state: Optional[Union[str, "WorkflowState"]] = None, + endpoints_configuration: Optional["FlowEndpointsConfiguration"] = None, + access_control: Optional["FlowAccessControlConfiguration"] = None, + integration_account: Optional["ResourceReference"] = None, + definition: Optional[object] = None, + parameters: Optional[Dict[str, "WorkflowParameter"]] = None, + **kwargs + ): + super(WorkflowVersion, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.created_time = None + self.changed_time = None + self.state = state + self.version = None + self.access_endpoint = None + self.endpoints_configuration = endpoints_configuration + self.access_control = access_control + self.sku = None + self.integration_account = integration_account + self.definition = definition + self.parameters = parameters + + +class WorkflowVersionListResult(msrest.serialization.Model): + """The list of workflow versions. + + :param value: A list of workflow versions. + :type value: list[~azure.mgmt.logic.models.WorkflowVersion] + :param next_link: The URL to get the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkflowVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["WorkflowVersion"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(WorkflowVersionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class WsdlService(msrest.serialization.Model): + """The WSDL service. + + :param qualified_name: The qualified name. + :type qualified_name: str + :param endpoint_qualified_names: The list of endpoints' qualified names. + :type endpoint_qualified_names: list[str] + """ + + _attribute_map = { + 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, + 'endpoint_qualified_names': {'key': 'EndpointQualifiedNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + qualified_name: Optional[str] = None, + endpoint_qualified_names: Optional[List[str]] = None, + **kwargs + ): + super(WsdlService, self).__init__(**kwargs) + self.qualified_name = qualified_name + self.endpoint_qualified_names = endpoint_qualified_names + + +class X12AcknowledgementSettings(msrest.serialization.Model): + """The X12 agreement acknowledgement settings. + + All required parameters must be populated in order to send to Azure. + + :param need_technical_acknowledgement: Required. The value indicating whether technical + acknowledgement is needed. + :type need_technical_acknowledgement: bool + :param batch_technical_acknowledgements: Required. The value indicating whether to batch the + technical acknowledgements. + :type batch_technical_acknowledgements: bool + :param need_functional_acknowledgement: Required. The value indicating whether functional + acknowledgement is needed. + :type need_functional_acknowledgement: bool + :param functional_acknowledgement_version: The functional acknowledgement version. + :type functional_acknowledgement_version: str + :param batch_functional_acknowledgements: Required. The value indicating whether to batch + functional acknowledgements. + :type batch_functional_acknowledgements: bool + :param need_implementation_acknowledgement: Required. The value indicating whether + implementation acknowledgement is needed. + :type need_implementation_acknowledgement: bool + :param implementation_acknowledgement_version: The implementation acknowledgement version. + :type implementation_acknowledgement_version: str + :param batch_implementation_acknowledgements: Required. The value indicating whether to batch + implementation acknowledgements. + :type batch_implementation_acknowledgements: bool + :param need_loop_for_valid_messages: Required. The value indicating whether a loop is needed + for valid messages. + :type need_loop_for_valid_messages: bool + :param send_synchronous_acknowledgement: Required. The value indicating whether to send + synchronous acknowledgement. + :type send_synchronous_acknowledgement: bool + :param acknowledgement_control_number_prefix: The acknowledgement control number prefix. + :type acknowledgement_control_number_prefix: str + :param acknowledgement_control_number_suffix: The acknowledgement control number suffix. + :type acknowledgement_control_number_suffix: str + :param acknowledgement_control_number_lower_bound: Required. The acknowledgement control number + lower bound. + :type acknowledgement_control_number_lower_bound: int + :param acknowledgement_control_number_upper_bound: Required. The acknowledgement control number + upper bound. + :type acknowledgement_control_number_upper_bound: int + :param rollover_acknowledgement_control_number: Required. The value indicating whether to + rollover acknowledgement control number. + :type rollover_acknowledgement_control_number: bool + """ + + _validation = { + 'need_technical_acknowledgement': {'required': True}, + 'batch_technical_acknowledgements': {'required': True}, + 'need_functional_acknowledgement': {'required': True}, + 'batch_functional_acknowledgements': {'required': True}, + 'need_implementation_acknowledgement': {'required': True}, + 'batch_implementation_acknowledgements': {'required': True}, + 'need_loop_for_valid_messages': {'required': True}, + 'send_synchronous_acknowledgement': {'required': True}, + 'acknowledgement_control_number_lower_bound': {'required': True}, + 'acknowledgement_control_number_upper_bound': {'required': True}, + 'rollover_acknowledgement_control_number': {'required': True}, + } + + _attribute_map = { + 'need_technical_acknowledgement': {'key': 'needTechnicalAcknowledgement', 'type': 'bool'}, + 'batch_technical_acknowledgements': {'key': 'batchTechnicalAcknowledgements', 'type': 'bool'}, + 'need_functional_acknowledgement': {'key': 'needFunctionalAcknowledgement', 'type': 'bool'}, + 'functional_acknowledgement_version': {'key': 'functionalAcknowledgementVersion', 'type': 'str'}, + 'batch_functional_acknowledgements': {'key': 'batchFunctionalAcknowledgements', 'type': 'bool'}, + 'need_implementation_acknowledgement': {'key': 'needImplementationAcknowledgement', 'type': 'bool'}, + 'implementation_acknowledgement_version': {'key': 'implementationAcknowledgementVersion', 'type': 'str'}, + 'batch_implementation_acknowledgements': {'key': 'batchImplementationAcknowledgements', 'type': 'bool'}, + 'need_loop_for_valid_messages': {'key': 'needLoopForValidMessages', 'type': 'bool'}, + 'send_synchronous_acknowledgement': {'key': 'sendSynchronousAcknowledgement', 'type': 'bool'}, + 'acknowledgement_control_number_prefix': {'key': 'acknowledgementControlNumberPrefix', 'type': 'str'}, + 'acknowledgement_control_number_suffix': {'key': 'acknowledgementControlNumberSuffix', 'type': 'str'}, + 'acknowledgement_control_number_lower_bound': {'key': 'acknowledgementControlNumberLowerBound', 'type': 'int'}, + 'acknowledgement_control_number_upper_bound': {'key': 'acknowledgementControlNumberUpperBound', 'type': 'int'}, + 'rollover_acknowledgement_control_number': {'key': 'rolloverAcknowledgementControlNumber', 'type': 'bool'}, + } + + def __init__( + self, + *, + need_technical_acknowledgement: bool, + batch_technical_acknowledgements: bool, + need_functional_acknowledgement: bool, + batch_functional_acknowledgements: bool, + need_implementation_acknowledgement: bool, + batch_implementation_acknowledgements: bool, + need_loop_for_valid_messages: bool, + send_synchronous_acknowledgement: bool, + acknowledgement_control_number_lower_bound: int, + acknowledgement_control_number_upper_bound: int, + rollover_acknowledgement_control_number: bool, + functional_acknowledgement_version: Optional[str] = None, + implementation_acknowledgement_version: Optional[str] = None, + acknowledgement_control_number_prefix: Optional[str] = None, + acknowledgement_control_number_suffix: Optional[str] = None, + **kwargs + ): + super(X12AcknowledgementSettings, self).__init__(**kwargs) + self.need_technical_acknowledgement = need_technical_acknowledgement + self.batch_technical_acknowledgements = batch_technical_acknowledgements + self.need_functional_acknowledgement = need_functional_acknowledgement + self.functional_acknowledgement_version = functional_acknowledgement_version + self.batch_functional_acknowledgements = batch_functional_acknowledgements + self.need_implementation_acknowledgement = need_implementation_acknowledgement + self.implementation_acknowledgement_version = implementation_acknowledgement_version + self.batch_implementation_acknowledgements = batch_implementation_acknowledgements + self.need_loop_for_valid_messages = need_loop_for_valid_messages + self.send_synchronous_acknowledgement = send_synchronous_acknowledgement + self.acknowledgement_control_number_prefix = acknowledgement_control_number_prefix + self.acknowledgement_control_number_suffix = acknowledgement_control_number_suffix + self.acknowledgement_control_number_lower_bound = acknowledgement_control_number_lower_bound + self.acknowledgement_control_number_upper_bound = acknowledgement_control_number_upper_bound + self.rollover_acknowledgement_control_number = rollover_acknowledgement_control_number + + +class X12AgreementContent(msrest.serialization.Model): + """The X12 agreement content. + + All required parameters must be populated in order to send to Azure. + + :param receive_agreement: Required. The X12 one-way receive agreement. + :type receive_agreement: ~azure.mgmt.logic.models.X12OneWayAgreement + :param send_agreement: Required. The X12 one-way send agreement. + :type send_agreement: ~azure.mgmt.logic.models.X12OneWayAgreement + """ + + _validation = { + 'receive_agreement': {'required': True}, + 'send_agreement': {'required': True}, + } + + _attribute_map = { + 'receive_agreement': {'key': 'receiveAgreement', 'type': 'X12OneWayAgreement'}, + 'send_agreement': {'key': 'sendAgreement', 'type': 'X12OneWayAgreement'}, + } + + def __init__( + self, + *, + receive_agreement: "X12OneWayAgreement", + send_agreement: "X12OneWayAgreement", + **kwargs + ): + super(X12AgreementContent, self).__init__(**kwargs) + self.receive_agreement = receive_agreement + self.send_agreement = send_agreement + + +class X12DelimiterOverrides(msrest.serialization.Model): + """The X12 delimiter override settings. + + All required parameters must be populated in order to send to Azure. + + :param protocol_version: The protocol version. + :type protocol_version: str + :param message_id: The message id. + :type message_id: str + :param data_element_separator: Required. The data element separator. + :type data_element_separator: int + :param component_separator: Required. The component separator. + :type component_separator: int + :param segment_terminator: Required. The segment terminator. + :type segment_terminator: int + :param segment_terminator_suffix: Required. The segment terminator suffix. Possible values + include: "NotSpecified", "None", "CR", "LF", "CRLF". + :type segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix + :param replace_character: Required. The replacement character. + :type replace_character: int + :param replace_separators_in_payload: Required. The value indicating whether to replace + separators in payload. + :type replace_separators_in_payload: bool + :param target_namespace: The target namespace on which this delimiter settings has to be + applied. + :type target_namespace: str + """ + + _validation = { + 'data_element_separator': {'required': True}, + 'component_separator': {'required': True}, + 'segment_terminator': {'required': True}, + 'segment_terminator_suffix': {'required': True}, + 'replace_character': {'required': True}, + 'replace_separators_in_payload': {'required': True}, + } + + _attribute_map = { + 'protocol_version': {'key': 'protocolVersion', 'type': 'str'}, + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'data_element_separator': {'key': 'dataElementSeparator', 'type': 'int'}, + 'component_separator': {'key': 'componentSeparator', 'type': 'int'}, + 'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'}, + 'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'}, + 'replace_character': {'key': 'replaceCharacter', 'type': 'int'}, + 'replace_separators_in_payload': {'key': 'replaceSeparatorsInPayload', 'type': 'bool'}, + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + } + + def __init__( + self, + *, + data_element_separator: int, + component_separator: int, + segment_terminator: int, + segment_terminator_suffix: Union[str, "SegmentTerminatorSuffix"], + replace_character: int, + replace_separators_in_payload: bool, + protocol_version: Optional[str] = None, + message_id: Optional[str] = None, + target_namespace: Optional[str] = None, + **kwargs + ): + super(X12DelimiterOverrides, self).__init__(**kwargs) + self.protocol_version = protocol_version + self.message_id = message_id + self.data_element_separator = data_element_separator + self.component_separator = component_separator + self.segment_terminator = segment_terminator + self.segment_terminator_suffix = segment_terminator_suffix + self.replace_character = replace_character + self.replace_separators_in_payload = replace_separators_in_payload + self.target_namespace = target_namespace + + +class X12EnvelopeOverride(msrest.serialization.Model): + """The X12 envelope override settings. + + All required parameters must be populated in order to send to Azure. + + :param target_namespace: Required. The target namespace on which this envelope settings has to + be applied. + :type target_namespace: str + :param protocol_version: Required. The protocol version on which this envelope settings has to + be applied. + :type protocol_version: str + :param message_id: Required. The message id on which this envelope settings has to be applied. + :type message_id: str + :param responsible_agency_code: Required. The responsible agency code. + :type responsible_agency_code: str + :param header_version: Required. The header version. + :type header_version: str + :param sender_application_id: Required. The sender application id. + :type sender_application_id: str + :param receiver_application_id: Required. The receiver application id. + :type receiver_application_id: str + :param functional_identifier_code: The functional identifier code. + :type functional_identifier_code: str + :param date_format: Required. The date format. Possible values include: "NotSpecified", + "CCYYMMDD", "YYMMDD". + :type date_format: str or ~azure.mgmt.logic.models.X12DateFormat + :param time_format: Required. The time format. Possible values include: "NotSpecified", "HHMM", + "HHMMSS", "HHMMSSdd", "HHMMSSd". + :type time_format: str or ~azure.mgmt.logic.models.X12TimeFormat + """ + + _validation = { + 'target_namespace': {'required': True}, + 'protocol_version': {'required': True}, + 'message_id': {'required': True}, + 'responsible_agency_code': {'required': True}, + 'header_version': {'required': True}, + 'sender_application_id': {'required': True}, + 'receiver_application_id': {'required': True}, + 'date_format': {'required': True}, + 'time_format': {'required': True}, + } + + _attribute_map = { + 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + 'protocol_version': {'key': 'protocolVersion', 'type': 'str'}, + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'responsible_agency_code': {'key': 'responsibleAgencyCode', 'type': 'str'}, + 'header_version': {'key': 'headerVersion', 'type': 'str'}, + 'sender_application_id': {'key': 'senderApplicationId', 'type': 'str'}, + 'receiver_application_id': {'key': 'receiverApplicationId', 'type': 'str'}, + 'functional_identifier_code': {'key': 'functionalIdentifierCode', 'type': 'str'}, + 'date_format': {'key': 'dateFormat', 'type': 'str'}, + 'time_format': {'key': 'timeFormat', 'type': 'str'}, + } + + def __init__( + self, + *, + target_namespace: str, + protocol_version: str, + message_id: str, + responsible_agency_code: str, + header_version: str, + sender_application_id: str, + receiver_application_id: str, + date_format: Union[str, "X12DateFormat"], + time_format: Union[str, "X12TimeFormat"], + functional_identifier_code: Optional[str] = None, + **kwargs + ): + super(X12EnvelopeOverride, self).__init__(**kwargs) + self.target_namespace = target_namespace + self.protocol_version = protocol_version + self.message_id = message_id + self.responsible_agency_code = responsible_agency_code + self.header_version = header_version + self.sender_application_id = sender_application_id + self.receiver_application_id = receiver_application_id + self.functional_identifier_code = functional_identifier_code + self.date_format = date_format + self.time_format = time_format + + +class X12EnvelopeSettings(msrest.serialization.Model): + """The X12 agreement envelope settings. + + All required parameters must be populated in order to send to Azure. + + :param control_standards_id: Required. The controls standards id. + :type control_standards_id: int + :param use_control_standards_id_as_repetition_character: Required. The value indicating whether + to use control standards id as repetition character. + :type use_control_standards_id_as_repetition_character: bool + :param sender_application_id: Required. The sender application id. + :type sender_application_id: str + :param receiver_application_id: Required. The receiver application id. + :type receiver_application_id: str + :param control_version_number: Required. The control version number. + :type control_version_number: str + :param interchange_control_number_lower_bound: Required. The interchange control number lower + bound. + :type interchange_control_number_lower_bound: int + :param interchange_control_number_upper_bound: Required. The interchange control number upper + bound. + :type interchange_control_number_upper_bound: int + :param rollover_interchange_control_number: Required. The value indicating whether to rollover + interchange control number. + :type rollover_interchange_control_number: bool + :param enable_default_group_headers: Required. The value indicating whether to enable default + group headers. + :type enable_default_group_headers: bool + :param functional_group_id: The functional group id. + :type functional_group_id: str + :param group_control_number_lower_bound: Required. The group control number lower bound. + :type group_control_number_lower_bound: int + :param group_control_number_upper_bound: Required. The group control number upper bound. + :type group_control_number_upper_bound: int + :param rollover_group_control_number: Required. The value indicating whether to rollover group + control number. + :type rollover_group_control_number: bool + :param group_header_agency_code: Required. The group header agency code. + :type group_header_agency_code: str + :param group_header_version: Required. The group header version. + :type group_header_version: str + :param transaction_set_control_number_lower_bound: Required. The transaction set control number + lower bound. + :type transaction_set_control_number_lower_bound: int + :param transaction_set_control_number_upper_bound: Required. The transaction set control number + upper bound. + :type transaction_set_control_number_upper_bound: int + :param rollover_transaction_set_control_number: Required. The value indicating whether to + rollover transaction set control number. + :type rollover_transaction_set_control_number: bool + :param transaction_set_control_number_prefix: The transaction set control number prefix. + :type transaction_set_control_number_prefix: str + :param transaction_set_control_number_suffix: The transaction set control number suffix. + :type transaction_set_control_number_suffix: str + :param overwrite_existing_transaction_set_control_number: Required. The value indicating + whether to overwrite existing transaction set control number. + :type overwrite_existing_transaction_set_control_number: bool + :param group_header_date_format: Required. The group header date format. Possible values + include: "NotSpecified", "CCYYMMDD", "YYMMDD". + :type group_header_date_format: str or ~azure.mgmt.logic.models.X12DateFormat + :param group_header_time_format: Required. The group header time format. Possible values + include: "NotSpecified", "HHMM", "HHMMSS", "HHMMSSdd", "HHMMSSd". + :type group_header_time_format: str or ~azure.mgmt.logic.models.X12TimeFormat + :param usage_indicator: Required. The usage indicator. Possible values include: "NotSpecified", + "Test", "Information", "Production". + :type usage_indicator: str or ~azure.mgmt.logic.models.UsageIndicator + """ + + _validation = { + 'control_standards_id': {'required': True}, + 'use_control_standards_id_as_repetition_character': {'required': True}, + 'sender_application_id': {'required': True}, + 'receiver_application_id': {'required': True}, + 'control_version_number': {'required': True}, + 'interchange_control_number_lower_bound': {'required': True}, + 'interchange_control_number_upper_bound': {'required': True}, + 'rollover_interchange_control_number': {'required': True}, + 'enable_default_group_headers': {'required': True}, + 'group_control_number_lower_bound': {'required': True}, + 'group_control_number_upper_bound': {'required': True}, + 'rollover_group_control_number': {'required': True}, + 'group_header_agency_code': {'required': True}, + 'group_header_version': {'required': True}, + 'transaction_set_control_number_lower_bound': {'required': True}, + 'transaction_set_control_number_upper_bound': {'required': True}, + 'rollover_transaction_set_control_number': {'required': True}, + 'overwrite_existing_transaction_set_control_number': {'required': True}, + 'group_header_date_format': {'required': True}, + 'group_header_time_format': {'required': True}, + 'usage_indicator': {'required': True}, + } + + _attribute_map = { + 'control_standards_id': {'key': 'controlStandardsId', 'type': 'int'}, + 'use_control_standards_id_as_repetition_character': {'key': 'useControlStandardsIdAsRepetitionCharacter', 'type': 'bool'}, + 'sender_application_id': {'key': 'senderApplicationId', 'type': 'str'}, + 'receiver_application_id': {'key': 'receiverApplicationId', 'type': 'str'}, + 'control_version_number': {'key': 'controlVersionNumber', 'type': 'str'}, + 'interchange_control_number_lower_bound': {'key': 'interchangeControlNumberLowerBound', 'type': 'int'}, + 'interchange_control_number_upper_bound': {'key': 'interchangeControlNumberUpperBound', 'type': 'int'}, + 'rollover_interchange_control_number': {'key': 'rolloverInterchangeControlNumber', 'type': 'bool'}, + 'enable_default_group_headers': {'key': 'enableDefaultGroupHeaders', 'type': 'bool'}, + 'functional_group_id': {'key': 'functionalGroupId', 'type': 'str'}, + 'group_control_number_lower_bound': {'key': 'groupControlNumberLowerBound', 'type': 'int'}, + 'group_control_number_upper_bound': {'key': 'groupControlNumberUpperBound', 'type': 'int'}, + 'rollover_group_control_number': {'key': 'rolloverGroupControlNumber', 'type': 'bool'}, + 'group_header_agency_code': {'key': 'groupHeaderAgencyCode', 'type': 'str'}, + 'group_header_version': {'key': 'groupHeaderVersion', 'type': 'str'}, + 'transaction_set_control_number_lower_bound': {'key': 'transactionSetControlNumberLowerBound', 'type': 'int'}, + 'transaction_set_control_number_upper_bound': {'key': 'transactionSetControlNumberUpperBound', 'type': 'int'}, + 'rollover_transaction_set_control_number': {'key': 'rolloverTransactionSetControlNumber', 'type': 'bool'}, + 'transaction_set_control_number_prefix': {'key': 'transactionSetControlNumberPrefix', 'type': 'str'}, + 'transaction_set_control_number_suffix': {'key': 'transactionSetControlNumberSuffix', 'type': 'str'}, + 'overwrite_existing_transaction_set_control_number': {'key': 'overwriteExistingTransactionSetControlNumber', 'type': 'bool'}, + 'group_header_date_format': {'key': 'groupHeaderDateFormat', 'type': 'str'}, + 'group_header_time_format': {'key': 'groupHeaderTimeFormat', 'type': 'str'}, + 'usage_indicator': {'key': 'usageIndicator', 'type': 'str'}, + } + + def __init__( + self, + *, + control_standards_id: int, + use_control_standards_id_as_repetition_character: bool, + sender_application_id: str, + receiver_application_id: str, + control_version_number: str, + interchange_control_number_lower_bound: int, + interchange_control_number_upper_bound: int, + rollover_interchange_control_number: bool, + enable_default_group_headers: bool, + group_control_number_lower_bound: int, + group_control_number_upper_bound: int, + rollover_group_control_number: bool, + group_header_agency_code: str, + group_header_version: str, + transaction_set_control_number_lower_bound: int, + transaction_set_control_number_upper_bound: int, + rollover_transaction_set_control_number: bool, + overwrite_existing_transaction_set_control_number: bool, + group_header_date_format: Union[str, "X12DateFormat"], + group_header_time_format: Union[str, "X12TimeFormat"], + usage_indicator: Union[str, "UsageIndicator"], + functional_group_id: Optional[str] = None, + transaction_set_control_number_prefix: Optional[str] = None, + transaction_set_control_number_suffix: Optional[str] = None, + **kwargs + ): + super(X12EnvelopeSettings, self).__init__(**kwargs) + self.control_standards_id = control_standards_id + self.use_control_standards_id_as_repetition_character = use_control_standards_id_as_repetition_character + self.sender_application_id = sender_application_id + self.receiver_application_id = receiver_application_id + self.control_version_number = control_version_number + self.interchange_control_number_lower_bound = interchange_control_number_lower_bound + self.interchange_control_number_upper_bound = interchange_control_number_upper_bound + self.rollover_interchange_control_number = rollover_interchange_control_number + self.enable_default_group_headers = enable_default_group_headers + self.functional_group_id = functional_group_id + self.group_control_number_lower_bound = group_control_number_lower_bound + self.group_control_number_upper_bound = group_control_number_upper_bound + self.rollover_group_control_number = rollover_group_control_number + self.group_header_agency_code = group_header_agency_code + self.group_header_version = group_header_version + self.transaction_set_control_number_lower_bound = transaction_set_control_number_lower_bound + self.transaction_set_control_number_upper_bound = transaction_set_control_number_upper_bound + self.rollover_transaction_set_control_number = rollover_transaction_set_control_number + self.transaction_set_control_number_prefix = transaction_set_control_number_prefix + self.transaction_set_control_number_suffix = transaction_set_control_number_suffix + self.overwrite_existing_transaction_set_control_number = overwrite_existing_transaction_set_control_number + self.group_header_date_format = group_header_date_format + self.group_header_time_format = group_header_time_format + self.usage_indicator = usage_indicator + + +class X12FramingSettings(msrest.serialization.Model): + """The X12 agreement framing settings. + + All required parameters must be populated in order to send to Azure. + + :param data_element_separator: Required. The data element separator. + :type data_element_separator: int + :param component_separator: Required. The component separator. + :type component_separator: int + :param replace_separators_in_payload: Required. The value indicating whether to replace + separators in payload. + :type replace_separators_in_payload: bool + :param replace_character: Required. The replacement character. + :type replace_character: int + :param segment_terminator: Required. The segment terminator. + :type segment_terminator: int + :param character_set: Required. The X12 character set. Possible values include: "NotSpecified", + "Basic", "Extended", "UTF8". + :type character_set: str or ~azure.mgmt.logic.models.X12CharacterSet + :param segment_terminator_suffix: Required. The segment terminator suffix. Possible values + include: "NotSpecified", "None", "CR", "LF", "CRLF". + :type segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix + """ + + _validation = { + 'data_element_separator': {'required': True}, + 'component_separator': {'required': True}, + 'replace_separators_in_payload': {'required': True}, + 'replace_character': {'required': True}, + 'segment_terminator': {'required': True}, + 'character_set': {'required': True}, + 'segment_terminator_suffix': {'required': True}, + } + + _attribute_map = { + 'data_element_separator': {'key': 'dataElementSeparator', 'type': 'int'}, + 'component_separator': {'key': 'componentSeparator', 'type': 'int'}, + 'replace_separators_in_payload': {'key': 'replaceSeparatorsInPayload', 'type': 'bool'}, + 'replace_character': {'key': 'replaceCharacter', 'type': 'int'}, + 'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'}, + 'character_set': {'key': 'characterSet', 'type': 'str'}, + 'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'}, + } + + def __init__( + self, + *, + data_element_separator: int, + component_separator: int, + replace_separators_in_payload: bool, + replace_character: int, + segment_terminator: int, + character_set: Union[str, "X12CharacterSet"], + segment_terminator_suffix: Union[str, "SegmentTerminatorSuffix"], + **kwargs + ): + super(X12FramingSettings, self).__init__(**kwargs) + self.data_element_separator = data_element_separator + self.component_separator = component_separator + self.replace_separators_in_payload = replace_separators_in_payload + self.replace_character = replace_character + self.segment_terminator = segment_terminator + self.character_set = character_set + self.segment_terminator_suffix = segment_terminator_suffix + + +class X12MessageFilter(msrest.serialization.Model): + """The X12 message filter for odata query. + + All required parameters must be populated in order to send to Azure. + + :param message_filter_type: Required. The message filter type. Possible values include: + "NotSpecified", "Include", "Exclude". + :type message_filter_type: str or ~azure.mgmt.logic.models.MessageFilterType + """ + + _validation = { + 'message_filter_type': {'required': True}, + } + + _attribute_map = { + 'message_filter_type': {'key': 'messageFilterType', 'type': 'str'}, + } + + def __init__( + self, + *, + message_filter_type: Union[str, "MessageFilterType"], + **kwargs + ): + super(X12MessageFilter, self).__init__(**kwargs) + self.message_filter_type = message_filter_type + + +class X12MessageIdentifier(msrest.serialization.Model): + """The X12 message identifier. + + All required parameters must be populated in order to send to Azure. + + :param message_id: Required. The message id. + :type message_id: str + """ + + _validation = { + 'message_id': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + } + + def __init__( + self, + *, + message_id: str, + **kwargs + ): + super(X12MessageIdentifier, self).__init__(**kwargs) + self.message_id = message_id + + +class X12OneWayAgreement(msrest.serialization.Model): + """The X12 one-way agreement. + + All required parameters must be populated in order to send to Azure. + + :param sender_business_identity: Required. The sender business identity. + :type sender_business_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param receiver_business_identity: Required. The receiver business identity. + :type receiver_business_identity: ~azure.mgmt.logic.models.BusinessIdentity + :param protocol_settings: Required. The X12 protocol settings. + :type protocol_settings: ~azure.mgmt.logic.models.X12ProtocolSettings + """ + + _validation = { + 'sender_business_identity': {'required': True}, + 'receiver_business_identity': {'required': True}, + 'protocol_settings': {'required': True}, + } + + _attribute_map = { + 'sender_business_identity': {'key': 'senderBusinessIdentity', 'type': 'BusinessIdentity'}, + 'receiver_business_identity': {'key': 'receiverBusinessIdentity', 'type': 'BusinessIdentity'}, + 'protocol_settings': {'key': 'protocolSettings', 'type': 'X12ProtocolSettings'}, + } + + def __init__( + self, + *, + sender_business_identity: "BusinessIdentity", + receiver_business_identity: "BusinessIdentity", + protocol_settings: "X12ProtocolSettings", + **kwargs + ): + super(X12OneWayAgreement, self).__init__(**kwargs) + self.sender_business_identity = sender_business_identity + self.receiver_business_identity = receiver_business_identity + self.protocol_settings = protocol_settings + + +class X12ProcessingSettings(msrest.serialization.Model): + """The X12 processing settings. + + All required parameters must be populated in order to send to Azure. + + :param mask_security_info: Required. The value indicating whether to mask security information. + :type mask_security_info: bool + :param convert_implied_decimal: Required. The value indicating whether to convert numerical + type to implied decimal. + :type convert_implied_decimal: bool + :param preserve_interchange: Required. The value indicating whether to preserve interchange. + :type preserve_interchange: bool + :param suspend_interchange_on_error: Required. The value indicating whether to suspend + interchange on error. + :type suspend_interchange_on_error: bool + :param create_empty_xml_tags_for_trailing_separators: Required. The value indicating whether to + create empty xml tags for trailing separators. + :type create_empty_xml_tags_for_trailing_separators: bool + :param use_dot_as_decimal_separator: Required. The value indicating whether to use dot as + decimal separator. + :type use_dot_as_decimal_separator: bool + """ + + _validation = { + 'mask_security_info': {'required': True}, + 'convert_implied_decimal': {'required': True}, + 'preserve_interchange': {'required': True}, + 'suspend_interchange_on_error': {'required': True}, + 'create_empty_xml_tags_for_trailing_separators': {'required': True}, + 'use_dot_as_decimal_separator': {'required': True}, + } + + _attribute_map = { + 'mask_security_info': {'key': 'maskSecurityInfo', 'type': 'bool'}, + 'convert_implied_decimal': {'key': 'convertImpliedDecimal', 'type': 'bool'}, + 'preserve_interchange': {'key': 'preserveInterchange', 'type': 'bool'}, + 'suspend_interchange_on_error': {'key': 'suspendInterchangeOnError', 'type': 'bool'}, + 'create_empty_xml_tags_for_trailing_separators': {'key': 'createEmptyXmlTagsForTrailingSeparators', 'type': 'bool'}, + 'use_dot_as_decimal_separator': {'key': 'useDotAsDecimalSeparator', 'type': 'bool'}, + } + + def __init__( + self, + *, + mask_security_info: bool, + convert_implied_decimal: bool, + preserve_interchange: bool, + suspend_interchange_on_error: bool, + create_empty_xml_tags_for_trailing_separators: bool, + use_dot_as_decimal_separator: bool, + **kwargs + ): + super(X12ProcessingSettings, self).__init__(**kwargs) + self.mask_security_info = mask_security_info + self.convert_implied_decimal = convert_implied_decimal + self.preserve_interchange = preserve_interchange + self.suspend_interchange_on_error = suspend_interchange_on_error + self.create_empty_xml_tags_for_trailing_separators = create_empty_xml_tags_for_trailing_separators + self.use_dot_as_decimal_separator = use_dot_as_decimal_separator + + +class X12ProtocolSettings(msrest.serialization.Model): + """The X12 agreement protocol settings. + + All required parameters must be populated in order to send to Azure. + + :param validation_settings: Required. The X12 validation settings. + :type validation_settings: ~azure.mgmt.logic.models.X12ValidationSettings + :param framing_settings: Required. The X12 framing settings. + :type framing_settings: ~azure.mgmt.logic.models.X12FramingSettings + :param envelope_settings: Required. The X12 envelope settings. + :type envelope_settings: ~azure.mgmt.logic.models.X12EnvelopeSettings + :param acknowledgement_settings: Required. The X12 acknowledgment settings. + :type acknowledgement_settings: ~azure.mgmt.logic.models.X12AcknowledgementSettings + :param message_filter: Required. The X12 message filter. + :type message_filter: ~azure.mgmt.logic.models.X12MessageFilter + :param security_settings: Required. The X12 security settings. + :type security_settings: ~azure.mgmt.logic.models.X12SecuritySettings + :param processing_settings: Required. The X12 processing settings. + :type processing_settings: ~azure.mgmt.logic.models.X12ProcessingSettings + :param envelope_overrides: The X12 envelope override settings. + :type envelope_overrides: list[~azure.mgmt.logic.models.X12EnvelopeOverride] + :param validation_overrides: The X12 validation override settings. + :type validation_overrides: list[~azure.mgmt.logic.models.X12ValidationOverride] + :param message_filter_list: The X12 message filter list. + :type message_filter_list: list[~azure.mgmt.logic.models.X12MessageIdentifier] + :param schema_references: Required. The X12 schema references. + :type schema_references: list[~azure.mgmt.logic.models.X12SchemaReference] + :param x12_delimiter_overrides: The X12 delimiter override settings. + :type x12_delimiter_overrides: list[~azure.mgmt.logic.models.X12DelimiterOverrides] + """ + + _validation = { + 'validation_settings': {'required': True}, + 'framing_settings': {'required': True}, + 'envelope_settings': {'required': True}, + 'acknowledgement_settings': {'required': True}, + 'message_filter': {'required': True}, + 'security_settings': {'required': True}, + 'processing_settings': {'required': True}, + 'schema_references': {'required': True}, + } + + _attribute_map = { + 'validation_settings': {'key': 'validationSettings', 'type': 'X12ValidationSettings'}, + 'framing_settings': {'key': 'framingSettings', 'type': 'X12FramingSettings'}, + 'envelope_settings': {'key': 'envelopeSettings', 'type': 'X12EnvelopeSettings'}, + 'acknowledgement_settings': {'key': 'acknowledgementSettings', 'type': 'X12AcknowledgementSettings'}, + 'message_filter': {'key': 'messageFilter', 'type': 'X12MessageFilter'}, + 'security_settings': {'key': 'securitySettings', 'type': 'X12SecuritySettings'}, + 'processing_settings': {'key': 'processingSettings', 'type': 'X12ProcessingSettings'}, + 'envelope_overrides': {'key': 'envelopeOverrides', 'type': '[X12EnvelopeOverride]'}, + 'validation_overrides': {'key': 'validationOverrides', 'type': '[X12ValidationOverride]'}, + 'message_filter_list': {'key': 'messageFilterList', 'type': '[X12MessageIdentifier]'}, + 'schema_references': {'key': 'schemaReferences', 'type': '[X12SchemaReference]'}, + 'x12_delimiter_overrides': {'key': 'x12DelimiterOverrides', 'type': '[X12DelimiterOverrides]'}, + } + + def __init__( + self, + *, + validation_settings: "X12ValidationSettings", + framing_settings: "X12FramingSettings", + envelope_settings: "X12EnvelopeSettings", + acknowledgement_settings: "X12AcknowledgementSettings", + message_filter: "X12MessageFilter", + security_settings: "X12SecuritySettings", + processing_settings: "X12ProcessingSettings", + schema_references: List["X12SchemaReference"], + envelope_overrides: Optional[List["X12EnvelopeOverride"]] = None, + validation_overrides: Optional[List["X12ValidationOverride"]] = None, + message_filter_list: Optional[List["X12MessageIdentifier"]] = None, + x12_delimiter_overrides: Optional[List["X12DelimiterOverrides"]] = None, + **kwargs + ): + super(X12ProtocolSettings, self).__init__(**kwargs) + self.validation_settings = validation_settings + self.framing_settings = framing_settings + self.envelope_settings = envelope_settings + self.acknowledgement_settings = acknowledgement_settings + self.message_filter = message_filter + self.security_settings = security_settings + self.processing_settings = processing_settings + self.envelope_overrides = envelope_overrides + self.validation_overrides = validation_overrides + self.message_filter_list = message_filter_list + self.schema_references = schema_references + self.x12_delimiter_overrides = x12_delimiter_overrides + + +class X12SchemaReference(msrest.serialization.Model): + """The X12 schema reference. + + All required parameters must be populated in order to send to Azure. + + :param message_id: Required. The message id. + :type message_id: str + :param sender_application_id: The sender application id. + :type sender_application_id: str + :param schema_version: Required. The schema version. + :type schema_version: str + :param schema_name: Required. The schema name. + :type schema_name: str + """ + + _validation = { + 'message_id': {'required': True}, + 'schema_version': {'required': True}, + 'schema_name': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'sender_application_id': {'key': 'senderApplicationId', 'type': 'str'}, + 'schema_version': {'key': 'schemaVersion', 'type': 'str'}, + 'schema_name': {'key': 'schemaName', 'type': 'str'}, + } + + def __init__( + self, + *, + message_id: str, + schema_version: str, + schema_name: str, + sender_application_id: Optional[str] = None, + **kwargs + ): + super(X12SchemaReference, self).__init__(**kwargs) + self.message_id = message_id + self.sender_application_id = sender_application_id + self.schema_version = schema_version + self.schema_name = schema_name + + +class X12SecuritySettings(msrest.serialization.Model): + """The X12 agreement security settings. + + All required parameters must be populated in order to send to Azure. + + :param authorization_qualifier: Required. The authorization qualifier. + :type authorization_qualifier: str + :param authorization_value: The authorization value. + :type authorization_value: str + :param security_qualifier: Required. The security qualifier. + :type security_qualifier: str + :param password_value: The password value. + :type password_value: str + """ + + _validation = { + 'authorization_qualifier': {'required': True}, + 'security_qualifier': {'required': True}, + } + + _attribute_map = { + 'authorization_qualifier': {'key': 'authorizationQualifier', 'type': 'str'}, + 'authorization_value': {'key': 'authorizationValue', 'type': 'str'}, + 'security_qualifier': {'key': 'securityQualifier', 'type': 'str'}, + 'password_value': {'key': 'passwordValue', 'type': 'str'}, + } + + def __init__( + self, + *, + authorization_qualifier: str, + security_qualifier: str, + authorization_value: Optional[str] = None, + password_value: Optional[str] = None, + **kwargs + ): + super(X12SecuritySettings, self).__init__(**kwargs) + self.authorization_qualifier = authorization_qualifier + self.authorization_value = authorization_value + self.security_qualifier = security_qualifier + self.password_value = password_value + + +class X12ValidationOverride(msrest.serialization.Model): + """The X12 validation override settings. + + All required parameters must be populated in order to send to Azure. + + :param message_id: Required. The message id on which the validation settings has to be applied. + :type message_id: str + :param validate_edi_types: Required. The value indicating whether to validate EDI types. + :type validate_edi_types: bool + :param validate_xsd_types: Required. The value indicating whether to validate XSD types. + :type validate_xsd_types: bool + :param allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + allow leading and trailing spaces and zeroes. + :type allow_leading_and_trailing_spaces_and_zeroes: bool + :param validate_character_set: Required. The value indicating whether to validate character + Set. + :type validate_character_set: bool + :param trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + trim leading and trailing spaces and zeroes. + :type trim_leading_and_trailing_spaces_and_zeroes: bool + :param trailing_separator_policy: Required. The trailing separator policy. Possible values + include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :type trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy + """ + + _validation = { + 'message_id': {'required': True}, + 'validate_edi_types': {'required': True}, + 'validate_xsd_types': {'required': True}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'required': True}, + 'validate_character_set': {'required': True}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'required': True}, + 'trailing_separator_policy': {'required': True}, + } + + _attribute_map = { + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'validate_edi_types': {'key': 'validateEDITypes', 'type': 'bool'}, + 'validate_xsd_types': {'key': 'validateXSDTypes', 'type': 'bool'}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'key': 'allowLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + 'validate_character_set': {'key': 'validateCharacterSet', 'type': 'bool'}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'key': 'trimLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + 'trailing_separator_policy': {'key': 'trailingSeparatorPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + message_id: str, + validate_edi_types: bool, + validate_xsd_types: bool, + allow_leading_and_trailing_spaces_and_zeroes: bool, + validate_character_set: bool, + trim_leading_and_trailing_spaces_and_zeroes: bool, + trailing_separator_policy: Union[str, "TrailingSeparatorPolicy"], + **kwargs + ): + super(X12ValidationOverride, self).__init__(**kwargs) + self.message_id = message_id + self.validate_edi_types = validate_edi_types + self.validate_xsd_types = validate_xsd_types + self.allow_leading_and_trailing_spaces_and_zeroes = allow_leading_and_trailing_spaces_and_zeroes + self.validate_character_set = validate_character_set + self.trim_leading_and_trailing_spaces_and_zeroes = trim_leading_and_trailing_spaces_and_zeroes + self.trailing_separator_policy = trailing_separator_policy + + +class X12ValidationSettings(msrest.serialization.Model): + """The X12 agreement validation settings. + + All required parameters must be populated in order to send to Azure. + + :param validate_character_set: Required. The value indicating whether to validate character set + in the message. + :type validate_character_set: bool + :param check_duplicate_interchange_control_number: Required. The value indicating whether to + check for duplicate interchange control number. + :type check_duplicate_interchange_control_number: bool + :param interchange_control_number_validity_days: Required. The validity period of interchange + control number. + :type interchange_control_number_validity_days: int + :param check_duplicate_group_control_number: Required. The value indicating whether to check + for duplicate group control number. + :type check_duplicate_group_control_number: bool + :param check_duplicate_transaction_set_control_number: Required. The value indicating whether + to check for duplicate transaction set control number. + :type check_duplicate_transaction_set_control_number: bool + :param validate_edi_types: Required. The value indicating whether to Whether to validate EDI + types. + :type validate_edi_types: bool + :param validate_xsd_types: Required. The value indicating whether to Whether to validate XSD + types. + :type validate_xsd_types: bool + :param allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + allow leading and trailing spaces and zeroes. + :type allow_leading_and_trailing_spaces_and_zeroes: bool + :param trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to + trim leading and trailing spaces and zeroes. + :type trim_leading_and_trailing_spaces_and_zeroes: bool + :param trailing_separator_policy: Required. The trailing separator policy. Possible values + include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :type trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy + """ + + _validation = { + 'validate_character_set': {'required': True}, + 'check_duplicate_interchange_control_number': {'required': True}, + 'interchange_control_number_validity_days': {'required': True}, + 'check_duplicate_group_control_number': {'required': True}, + 'check_duplicate_transaction_set_control_number': {'required': True}, + 'validate_edi_types': {'required': True}, + 'validate_xsd_types': {'required': True}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'required': True}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'required': True}, + 'trailing_separator_policy': {'required': True}, + } + + _attribute_map = { + 'validate_character_set': {'key': 'validateCharacterSet', 'type': 'bool'}, + 'check_duplicate_interchange_control_number': {'key': 'checkDuplicateInterchangeControlNumber', 'type': 'bool'}, + 'interchange_control_number_validity_days': {'key': 'interchangeControlNumberValidityDays', 'type': 'int'}, + 'check_duplicate_group_control_number': {'key': 'checkDuplicateGroupControlNumber', 'type': 'bool'}, + 'check_duplicate_transaction_set_control_number': {'key': 'checkDuplicateTransactionSetControlNumber', 'type': 'bool'}, + 'validate_edi_types': {'key': 'validateEDITypes', 'type': 'bool'}, + 'validate_xsd_types': {'key': 'validateXSDTypes', 'type': 'bool'}, + 'allow_leading_and_trailing_spaces_and_zeroes': {'key': 'allowLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + 'trim_leading_and_trailing_spaces_and_zeroes': {'key': 'trimLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + 'trailing_separator_policy': {'key': 'trailingSeparatorPolicy', 'type': 'str'}, + } + + def __init__( + self, + *, + validate_character_set: bool, + check_duplicate_interchange_control_number: bool, + interchange_control_number_validity_days: int, + check_duplicate_group_control_number: bool, + check_duplicate_transaction_set_control_number: bool, + validate_edi_types: bool, + validate_xsd_types: bool, + allow_leading_and_trailing_spaces_and_zeroes: bool, + trim_leading_and_trailing_spaces_and_zeroes: bool, + trailing_separator_policy: Union[str, "TrailingSeparatorPolicy"], + **kwargs + ): + super(X12ValidationSettings, self).__init__(**kwargs) + self.validate_character_set = validate_character_set + self.check_duplicate_interchange_control_number = check_duplicate_interchange_control_number + self.interchange_control_number_validity_days = interchange_control_number_validity_days + self.check_duplicate_group_control_number = check_duplicate_group_control_number + self.check_duplicate_transaction_set_control_number = check_duplicate_transaction_set_control_number + self.validate_edi_types = validate_edi_types + self.validate_xsd_types = validate_xsd_types + self.allow_leading_and_trailing_spaces_and_zeroes = allow_leading_and_trailing_spaces_and_zeroes + self.trim_leading_and_trailing_spaces_and_zeroes = trim_leading_and_trailing_spaces_and_zeroes + self.trailing_separator_policy = trailing_separator_policy diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/__init__.py b/src/logic/azext_logic/vendored_sdks/logic/operations/__init__.py new file mode 100644 index 00000000000..c3673ac689e --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/__init__.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 ._workflow_operations import WorkflowOperations +from ._workflow_version_operations import WorkflowVersionOperations +from ._workflow_trigger_operations import WorkflowTriggerOperations +from ._workflow_version_trigger_operations import WorkflowVersionTriggerOperations +from ._workflow_trigger_history_operations import WorkflowTriggerHistoryOperations +from ._workflow_run_operations import WorkflowRunOperations +from ._workflow_run_action_operations import WorkflowRunActionOperations +from ._workflow_run_action_repetition_operations import WorkflowRunActionRepetitionOperations +from ._workflow_run_action_repetition_request_history_operations import WorkflowRunActionRepetitionRequestHistoryOperations +from ._workflow_run_action_request_history_operations import WorkflowRunActionRequestHistoryOperations +from ._workflow_run_action_scope_repetition_operations import WorkflowRunActionScopeRepetitionOperations +from ._workflow_run_operation_operations import WorkflowRunOperationOperations +from ._integration_account_operations import IntegrationAccountOperations +from ._integration_account_assembly_operations import IntegrationAccountAssemblyOperations +from ._integration_account_batch_configuration_operations import IntegrationAccountBatchConfigurationOperations +from ._integration_account_schema_operations import IntegrationAccountSchemaOperations +from ._integration_account_map_operations import IntegrationAccountMapOperations +from ._integration_account_partner_operations import IntegrationAccountPartnerOperations +from ._integration_account_agreement_operations import IntegrationAccountAgreementOperations +from ._integration_account_certificate_operations import IntegrationAccountCertificateOperations +from ._integration_account_session_operations import IntegrationAccountSessionOperations +from ._integration_service_environment_operations import IntegrationServiceEnvironmentOperations +from ._integration_service_environment_sku_operations import IntegrationServiceEnvironmentSkuOperations +from ._integration_service_environment_network_health_operations import IntegrationServiceEnvironmentNetworkHealthOperations +from ._integration_service_environment_managed_api_operations import IntegrationServiceEnvironmentManagedApiOperations +from ._integration_service_environment_managed_api_operation_operations import IntegrationServiceEnvironmentManagedApiOperationOperations +from ._operation_operations import OperationOperations + +__all__ = [ + 'WorkflowOperations', + 'WorkflowVersionOperations', + 'WorkflowTriggerOperations', + 'WorkflowVersionTriggerOperations', + 'WorkflowTriggerHistoryOperations', + 'WorkflowRunOperations', + 'WorkflowRunActionOperations', + 'WorkflowRunActionRepetitionOperations', + 'WorkflowRunActionRepetitionRequestHistoryOperations', + 'WorkflowRunActionRequestHistoryOperations', + 'WorkflowRunActionScopeRepetitionOperations', + 'WorkflowRunOperationOperations', + 'IntegrationAccountOperations', + 'IntegrationAccountAssemblyOperations', + 'IntegrationAccountBatchConfigurationOperations', + 'IntegrationAccountSchemaOperations', + 'IntegrationAccountMapOperations', + 'IntegrationAccountPartnerOperations', + 'IntegrationAccountAgreementOperations', + 'IntegrationAccountCertificateOperations', + 'IntegrationAccountSessionOperations', + 'IntegrationServiceEnvironmentOperations', + 'IntegrationServiceEnvironmentSkuOperations', + 'IntegrationServiceEnvironmentNetworkHealthOperations', + 'IntegrationServiceEnvironmentManagedApiOperations', + 'IntegrationServiceEnvironmentManagedApiOperationOperations', + 'OperationOperations', +] diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_agreement_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_agreement_operations.py new file mode 100644 index 00000000000..38198c748a4 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_agreement_operations.py @@ -0,0 +1,421 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountAgreementOperations(object): + """IntegrationAccountAgreementOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + integration_account_name, # type: str + top=None, # type: Optional[int] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountAgreementListResult" + """Gets a list of integration account agreements. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: + AgreementType. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountAgreementListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountAgreementListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountAgreementListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountAgreementListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements'} + + def get( + self, + resource_group_name, # type: str + integration_account_name, # type: str + agreement_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountAgreement" + """Gets an integration account agreement. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. + :type agreement_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountAgreement or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountAgreement + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountAgreement"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'agreementName': self._serialize.url("agreement_name", agreement_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccountAgreement', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}'} + + def create_or_update( + self, + resource_group_name, # type: str + integration_account_name, # type: str + agreement_name, # type: str + agreement_type, # type: Union[str, "models.AgreementType"] + host_partner, # type: str + guest_partner, # type: str + host_identity, # type: "models.BusinessIdentity" + guest_identity, # type: "models.BusinessIdentity" + content, # type: "models.AgreementContent" + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + metadata=None, # type: Optional[object] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountAgreement" + """Creates or updates an integration account agreement. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. + :type agreement_name: str + :param agreement_type: The agreement type. + :type agreement_type: str or ~logic_management_client.models.AgreementType + :param host_partner: The integration account partner that is set as host partner for this + agreement. + :type host_partner: str + :param guest_partner: The integration account partner that is set as guest partner for this + agreement. + :type guest_partner: str + :param host_identity: The business identity of the host partner. + :type host_identity: ~logic_management_client.models.BusinessIdentity + :param guest_identity: The business identity of the guest partner. + :type guest_identity: ~logic_management_client.models.BusinessIdentity + :param content: The agreement content. + :type content: ~logic_management_client.models.AgreementContent + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param metadata: The metadata. + :type metadata: object + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountAgreement or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountAgreement or ~logic_management_client.models.IntegrationAccountAgreement + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountAgreement"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _agreement = models.IntegrationAccountAgreement(location=location, tags=tags, metadata=metadata, agreement_type=agreement_type, host_partner=host_partner, guest_partner=guest_partner, host_identity=host_identity, guest_identity=guest_identity, content=content) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'agreementName': self._serialize.url("agreement_name", agreement_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_agreement, 'IntegrationAccountAgreement') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationAccountAgreement', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationAccountAgreement', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}'} + + def delete( + self, + resource_group_name, # type: str + integration_account_name, # type: str + agreement_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an integration account agreement. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. + :type agreement_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'agreementName': self._serialize.url("agreement_name", agreement_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}'} + + def list_content_callback_url( + self, + resource_group_name, # type: str + integration_account_name, # type: str + agreement_name, # type: str + not_after=None, # type: Optional[datetime.datetime] + key_type=None, # type: Optional[Union[str, "models.KeyType"]] + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowTriggerCallbackUrl" + """Get the content callback url. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. + :type agreement_name: str + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _list_content_callback_url = models.GetCallbackUrlParameters(not_after=not_after, key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.list_content_callback_url.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'agreementName': self._serialize.url("agreement_name", agreement_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_list_content_callback_url, 'GetCallbackUrlParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_content_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}/listContentCallbackUrl'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_assembly_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_assembly_operations.py new file mode 100644 index 00000000000..c33801e9f97 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_assembly_operations.py @@ -0,0 +1,375 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountAssemblyOperations(object): + """IntegrationAccountAssemblyOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + integration_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AssemblyCollection" + """List the assemblies for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssemblyCollection or the result of cls(response) + :rtype: ~logic_management_client.models.AssemblyCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AssemblyCollection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AssemblyCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies'} + + def get( + self, + resource_group_name, # type: str + integration_account_name, # type: str + assembly_artifact_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AssemblyDefinition" + """Get an assembly for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param assembly_artifact_name: The assembly artifact name. + :type assembly_artifact_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssemblyDefinition or the result of cls(response) + :rtype: ~logic_management_client.models.AssemblyDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AssemblyDefinition"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'assemblyArtifactName': self._serialize.url("assembly_artifact_name", assembly_artifact_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AssemblyDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}'} + + def create_or_update( + self, + resource_group_name, # type: str + integration_account_name, # type: str + assembly_artifact_name, # type: str + properties, # type: "models.AssemblyProperties" + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + **kwargs # type: Any + ): + # type: (...) -> "models.AssemblyDefinition" + """Create or update an assembly for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param assembly_artifact_name: The assembly artifact name. + :type assembly_artifact_name: str + :param properties: The assembly properties. + :type properties: ~logic_management_client.models.AssemblyProperties + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssemblyDefinition or the result of cls(response) + :rtype: ~logic_management_client.models.AssemblyDefinition or ~logic_management_client.models.AssemblyDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AssemblyDefinition"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _assembly_artifact = models.AssemblyDefinition(location=location, tags=tags, properties=properties) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'assemblyArtifactName': self._serialize.url("assembly_artifact_name", assembly_artifact_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_assembly_artifact, 'AssemblyDefinition') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AssemblyDefinition', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AssemblyDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}'} + + def delete( + self, + resource_group_name, # type: str + integration_account_name, # type: str + assembly_artifact_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete an assembly for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param assembly_artifact_name: The assembly artifact name. + :type assembly_artifact_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'assemblyArtifactName': self._serialize.url("assembly_artifact_name", assembly_artifact_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}'} + + def list_content_callback_url( + self, + resource_group_name, # type: str + integration_account_name, # type: str + assembly_artifact_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowTriggerCallbackUrl" + """Get the content callback url for an integration account assembly. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param assembly_artifact_name: The assembly artifact name. + :type assembly_artifact_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.list_content_callback_url.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'assemblyArtifactName': self._serialize.url("assembly_artifact_name", assembly_artifact_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_content_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}/listContentCallbackUrl'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_batch_configuration_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_batch_configuration_operations.py new file mode 100644 index 00000000000..acde6505e62 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_batch_configuration_operations.py @@ -0,0 +1,314 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountBatchConfigurationOperations(object): + """IntegrationAccountBatchConfigurationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + integration_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.BatchConfigurationCollection" + """List the batch configurations for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BatchConfigurationCollection or the result of cls(response) + :rtype: ~logic_management_client.models.BatchConfigurationCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BatchConfigurationCollection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('BatchConfigurationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations'} + + def get( + self, + resource_group_name, # type: str + integration_account_name, # type: str + batch_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.BatchConfiguration" + """Get a batch configuration for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param batch_configuration_name: The batch configuration name. + :type batch_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BatchConfiguration or the result of cls(response) + :rtype: ~logic_management_client.models.BatchConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BatchConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'batchConfigurationName': self._serialize.url("batch_configuration_name", batch_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('BatchConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}'} + + def create_or_update( + self, + resource_group_name, # type: str + integration_account_name, # type: str + batch_configuration_name, # type: str + properties, # type: "models.BatchConfigurationProperties" + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + **kwargs # type: Any + ): + # type: (...) -> "models.BatchConfiguration" + """Create or update a batch configuration for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param batch_configuration_name: The batch configuration name. + :type batch_configuration_name: str + :param properties: The batch configuration properties. + :type properties: ~logic_management_client.models.BatchConfigurationProperties + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BatchConfiguration or the result of cls(response) + :rtype: ~logic_management_client.models.BatchConfiguration or ~logic_management_client.models.BatchConfiguration + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.BatchConfiguration"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _batch_configuration = models.BatchConfiguration(location=location, tags=tags, properties=properties) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'batchConfigurationName': self._serialize.url("batch_configuration_name", batch_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_batch_configuration, 'BatchConfiguration') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BatchConfiguration', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('BatchConfiguration', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}'} + + def delete( + self, + resource_group_name, # type: str + integration_account_name, # type: str + batch_configuration_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a batch configuration for an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param batch_configuration_name: The batch configuration name. + :type batch_configuration_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'batchConfigurationName': self._serialize.url("batch_configuration_name", batch_configuration_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_certificate_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_certificate_operations.py new file mode 100644 index 00000000000..4222becf4b2 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_certificate_operations.py @@ -0,0 +1,325 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountCertificateOperations(object): + """IntegrationAccountCertificateOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + integration_account_name, # type: str + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountCertificateListResult" + """Gets a list of integration account certificates. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param top: The number of items to be included in the result. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountCertificateListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountCertificateListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountCertificateListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountCertificateListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates'} + + def get( + self, + resource_group_name, # type: str + integration_account_name, # type: str + certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountCertificate" + """Gets an integration account certificate. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param certificate_name: The integration account certificate name. + :type certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountCertificate or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountCertificate"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccountCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}'} + + def create_or_update( + self, + resource_group_name, # type: str + integration_account_name, # type: str + certificate_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + metadata=None, # type: Optional[object] + key=None, # type: Optional["models.KeyVaultKeyReference"] + public_certificate=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountCertificate" + """Creates or updates an integration account certificate. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param certificate_name: The integration account certificate name. + :type certificate_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param metadata: The metadata. + :type metadata: object + :param key: The key details in the key vault. + :type key: ~logic_management_client.models.KeyVaultKeyReference + :param public_certificate: The public certificate. + :type public_certificate: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountCertificate or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountCertificate or ~logic_management_client.models.IntegrationAccountCertificate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountCertificate"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _certificate = models.IntegrationAccountCertificate(location=location, tags=tags, metadata=metadata, key=key, public_certificate=public_certificate) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_certificate, 'IntegrationAccountCertificate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationAccountCertificate', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationAccountCertificate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}'} + + def delete( + self, + resource_group_name, # type: str + integration_account_name, # type: str + certificate_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an integration account certificate. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param certificate_name: The integration account certificate name. + :type certificate_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_map_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_map_operations.py new file mode 100644 index 00000000000..4969a4a989c --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_map_operations.py @@ -0,0 +1,412 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountMapOperations(object): + """IntegrationAccountMapOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + integration_account_name, # type: str + top=None, # type: Optional[int] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountMapListResult" + """Gets a list of integration account maps. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: MapType. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountMapListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountMapListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountMapListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountMapListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps'} + + def get( + self, + resource_group_name, # type: str + integration_account_name, # type: str + map_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountMap" + """Gets an integration account map. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param map_name: The integration account map name. + :type map_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountMap or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountMap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountMap"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'mapName': self._serialize.url("map_name", map_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccountMap', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}'} + + def create_or_update( + self, + resource_group_name, # type: str + integration_account_name, # type: str + map_name, # type: str + map_type, # type: Union[str, "models.MapType"] + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + parameters_schema=None, # type: Optional["models.IntegrationAccountMapPropertiesParametersSchema"] + content=None, # type: Optional[str] + content_type_parameter=None, # type: Optional[str] + metadata=None, # type: Optional[object] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountMap" + """Creates or updates an integration account map. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param map_name: The integration account map name. + :type map_name: str + :param map_type: The map type. + :type map_type: str or ~logic_management_client.models.MapType + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param parameters_schema: The parameters schema of integration account map. + :type parameters_schema: ~logic_management_client.models.IntegrationAccountMapPropertiesParametersSchema + :param content: The content. + :type content: str + :param content_type_parameter: The content type. + :type content_type_parameter: str + :param metadata: The metadata. + :type metadata: object + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountMap or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountMap or ~logic_management_client.models.IntegrationAccountMap + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountMap"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _map = models.IntegrationAccountMap(location=location, tags=tags, map_type=map_type, parameters_schema=parameters_schema, content=content, content_type=content_type_parameter, metadata=metadata) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'mapName': self._serialize.url("map_name", map_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_map, 'IntegrationAccountMap') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationAccountMap', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationAccountMap', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}'} + + def delete( + self, + resource_group_name, # type: str + integration_account_name, # type: str + map_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an integration account map. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param map_name: The integration account map name. + :type map_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'mapName': self._serialize.url("map_name", map_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}'} + + def list_content_callback_url( + self, + resource_group_name, # type: str + integration_account_name, # type: str + map_name, # type: str + not_after=None, # type: Optional[datetime.datetime] + key_type=None, # type: Optional[Union[str, "models.KeyType"]] + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowTriggerCallbackUrl" + """Get the content callback url. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param map_name: The integration account map name. + :type map_name: str + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _list_content_callback_url = models.GetCallbackUrlParameters(not_after=not_after, key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.list_content_callback_url.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'mapName': self._serialize.url("map_name", map_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_list_content_callback_url, 'GetCallbackUrlParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_content_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}/listContentCallbackUrl'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_operations.py new file mode 100644 index 00000000000..c353a90a19d --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_operations.py @@ -0,0 +1,753 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountOperations(object): + """IntegrationAccountOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountListResult" + """Gets a list of integration accounts by subscription. + + :param top: The number of items to be included in the result. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # 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) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationAccounts'} + + def list_by_resource_group( + self, + resource_group_name, # type: str + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountListResult" + """Gets a list of integration accounts by resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param top: The number of items to be included in the result. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # 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'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts'} + + def get( + self, + resource_group_name, # type: str + integration_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccount" + """Gets an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccount"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}'} + + def create_or_update( + self, + resource_group_name, # type: str + integration_account_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + sku=None, # type: Optional["models.IntegrationAccountSku"] + integration_service_environment=None, # type: Optional["models.IntegrationServiceEnvironment"] + state=None, # type: Optional[Union[str, "models.WorkflowState"]] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccount" + """Creates or updates an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param sku: The sku. + :type sku: ~logic_management_client.models.IntegrationAccountSku + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~logic_management_client.models.IntegrationServiceEnvironment + :param state: The workflow state. + :type state: str or ~logic_management_client.models.WorkflowState + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccount or ~logic_management_client.models.IntegrationAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccount"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _integration_account = models.IntegrationAccount(location=location, tags=tags, sku=sku, integration_service_environment=integration_service_environment, state=state) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_integration_account, 'IntegrationAccount') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationAccount', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}'} + + def update( + self, + resource_group_name, # type: str + integration_account_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + sku=None, # type: Optional["models.IntegrationAccountSku"] + integration_service_environment=None, # type: Optional["models.IntegrationServiceEnvironment"] + state=None, # type: Optional[Union[str, "models.WorkflowState"]] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccount" + """Updates an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param sku: The sku. + :type sku: ~logic_management_client.models.IntegrationAccountSku + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~logic_management_client.models.IntegrationServiceEnvironment + :param state: The workflow state. + :type state: str or ~logic_management_client.models.WorkflowState + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccount"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _integration_account = models.IntegrationAccount(location=location, tags=tags, sku=sku, integration_service_environment=integration_service_environment, state=state) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_integration_account, 'IntegrationAccount') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}'} + + def delete( + self, + resource_group_name, # type: str + integration_account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an integration account. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}'} + + def list_callback_url( + self, + resource_group_name, # type: str + integration_account_name, # type: str + not_after=None, # type: Optional[datetime.datetime] + key_type=None, # type: Optional[Union[str, "models.KeyType"]] + **kwargs # type: Any + ): + # type: (...) -> "models.CallbackUrl" + """Gets the integration account callback URL. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.CallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.GetCallbackUrlParameters(not_after=not_after, key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.list_callback_url.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'GetCallbackUrlParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('CallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listCallbackUrl'} + + def list_key_vault_key( + self, + resource_group_name, # type: str + integration_account_name, # type: str + key_vault, # type: "models.KeyVaultReference" + skip_token=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.KeyVaultKeyCollection" + """Gets the integration account's Key Vault keys. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param key_vault: The key vault reference. + :type key_vault: ~logic_management_client.models.KeyVaultReference + :param skip_token: The skip token. + :type skip_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: KeyVaultKeyCollection or the result of cls(response) + :rtype: ~logic_management_client.models.KeyVaultKeyCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.KeyVaultKeyCollection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + _list_key_vault_keys = models.ListKeyVaultKeysDefinition(key_vault=key_vault, skip_token=skip_token) + api_version = "2019-05-01" + content_type = "application/json" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_key_vault_key.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_list_key_vault_keys, 'ListKeyVaultKeysDefinition') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('KeyVaultKeyCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_key_vault_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listKeyVaultKeys'} + + def log_tracking_event( + self, + resource_group_name, # type: str + integration_account_name, # type: str + source_type, # type: str + events, # type: List["TrackingEvent"] + track_events_options=None, # type: Optional[Union[str, "models.TrackEventsOperationOptions"]] + **kwargs # type: Any + ): + # type: (...) -> None + """Logs the integration account's tracking events. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param source_type: The source type. + :type source_type: str + :param events: The events. + :type events: list[~logic_management_client.models.TrackingEvent] + :param track_events_options: The track events options. + :type track_events_options: str or ~logic_management_client.models.TrackEventsOperationOptions + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _log_tracking_events = models.TrackingEventsDefinition(source_type=source_type, track_events_options=track_events_options, events=events) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.log_tracking_event.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_log_tracking_events, 'TrackingEventsDefinition') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + log_tracking_event.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/logTrackingEvents'} + + def regenerate_access_key( + self, + resource_group_name, # type: str + integration_account_name, # type: str + key_type=None, # type: Optional[Union[str, "models.KeyType"]] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccount" + """Regenerates the integration account access key. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccount + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccount"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _regenerate_access_key = models.RegenerateActionParameter(key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.regenerate_access_key.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_regenerate_access_key, 'RegenerateActionParameter') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccount', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + regenerate_access_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/regenerateAccessKey'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_partner_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_partner_operations.py new file mode 100644 index 00000000000..3919f8083b0 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_partner_operations.py @@ -0,0 +1,406 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountPartnerOperations(object): + """IntegrationAccountPartnerOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + integration_account_name, # type: str + top=None, # type: Optional[int] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountPartnerListResult" + """Gets a list of integration account partners. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: PartnerType. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountPartnerListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountPartnerListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountPartnerListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountPartnerListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners'} + + def get( + self, + resource_group_name, # type: str + integration_account_name, # type: str + partner_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountPartner" + """Gets an integration account partner. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param partner_name: The integration account partner name. + :type partner_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountPartner or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountPartner + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountPartner"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'partnerName': self._serialize.url("partner_name", partner_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccountPartner', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}'} + + def create_or_update( + self, + resource_group_name, # type: str + integration_account_name, # type: str + partner_name, # type: str + partner_type, # type: Union[str, "models.PartnerType"] + content, # type: "models.PartnerContent" + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + metadata=None, # type: Optional[object] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountPartner" + """Creates or updates an integration account partner. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param partner_name: The integration account partner name. + :type partner_name: str + :param partner_type: The partner type. + :type partner_type: str or ~logic_management_client.models.PartnerType + :param content: The partner content. + :type content: ~logic_management_client.models.PartnerContent + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param metadata: The metadata. + :type metadata: object + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountPartner or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountPartner or ~logic_management_client.models.IntegrationAccountPartner + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountPartner"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _partner = models.IntegrationAccountPartner(location=location, tags=tags, partner_type=partner_type, metadata=metadata, content=content) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'partnerName': self._serialize.url("partner_name", partner_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_partner, 'IntegrationAccountPartner') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationAccountPartner', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationAccountPartner', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}'} + + def delete( + self, + resource_group_name, # type: str + integration_account_name, # type: str + partner_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an integration account partner. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param partner_name: The integration account partner name. + :type partner_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'partnerName': self._serialize.url("partner_name", partner_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}'} + + def list_content_callback_url( + self, + resource_group_name, # type: str + integration_account_name, # type: str + partner_name, # type: str + not_after=None, # type: Optional[datetime.datetime] + key_type=None, # type: Optional[Union[str, "models.KeyType"]] + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowTriggerCallbackUrl" + """Get the content callback url. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param partner_name: The integration account partner name. + :type partner_name: str + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _list_content_callback_url = models.GetCallbackUrlParameters(not_after=not_after, key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.list_content_callback_url.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'partnerName': self._serialize.url("partner_name", partner_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_list_content_callback_url, 'GetCallbackUrlParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_content_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}/listContentCallbackUrl'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_schema_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_schema_operations.py new file mode 100644 index 00000000000..2cc9b609d90 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_schema_operations.py @@ -0,0 +1,418 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountSchemaOperations(object): + """IntegrationAccountSchemaOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + integration_account_name, # type: str + top=None, # type: Optional[int] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountSchemaListResult" + """Gets a list of integration account schemas. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: SchemaType. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSchemaListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountSchemaListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountSchemaListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountSchemaListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas'} + + def get( + self, + resource_group_name, # type: str + integration_account_name, # type: str + schema_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountSchema" + """Gets an integration account schema. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param schema_name: The integration account schema name. + :type schema_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSchema or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountSchema + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountSchema"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccountSchema', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}'} + + def create_or_update( + self, + resource_group_name, # type: str + integration_account_name, # type: str + schema_name, # type: str + schema_type, # type: Union[str, "models.SchemaType"] + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + target_namespace=None, # type: Optional[str] + document_name=None, # type: Optional[str] + file_name=None, # type: Optional[str] + metadata=None, # type: Optional[object] + content=None, # type: Optional[str] + content_type_parameter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountSchema" + """Creates or updates an integration account schema. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param schema_name: The integration account schema name. + :type schema_name: str + :param schema_type: The schema type. + :type schema_type: str or ~logic_management_client.models.SchemaType + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param target_namespace: The target namespace of the schema. + :type target_namespace: str + :param document_name: The document name. + :type document_name: str + :param file_name: The file name. + :type file_name: str + :param metadata: The metadata. + :type metadata: object + :param content: The content. + :type content: str + :param content_type_parameter: The content type. + :type content_type_parameter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSchema or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountSchema or ~logic_management_client.models.IntegrationAccountSchema + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountSchema"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _schema = models.IntegrationAccountSchema(location=location, tags=tags, schema_type=schema_type, target_namespace=target_namespace, document_name=document_name, file_name=file_name, metadata=metadata, content=content, content_type=content_type_parameter) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_schema, 'IntegrationAccountSchema') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationAccountSchema', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationAccountSchema', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}'} + + def delete( + self, + resource_group_name, # type: str + integration_account_name, # type: str + schema_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an integration account schema. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param schema_name: The integration account schema name. + :type schema_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}'} + + def list_content_callback_url( + self, + resource_group_name, # type: str + integration_account_name, # type: str + schema_name, # type: str + not_after=None, # type: Optional[datetime.datetime] + key_type=None, # type: Optional[Union[str, "models.KeyType"]] + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowTriggerCallbackUrl" + """Get the content callback url. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param schema_name: The integration account schema name. + :type schema_name: str + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _list_content_callback_url = models.GetCallbackUrlParameters(not_after=not_after, key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.list_content_callback_url.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_list_content_callback_url, 'GetCallbackUrlParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_content_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}/listContentCallbackUrl'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_session_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_session_operations.py new file mode 100644 index 00000000000..45c1becc47a --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_account_session_operations.py @@ -0,0 +1,324 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationAccountSessionOperations(object): + """IntegrationAccountSessionOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + integration_account_name, # type: str + top=None, # type: Optional[int] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountSessionListResult" + """Gets a list of integration account sessions. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: ChangedTime. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSessionListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountSessionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountSessionListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationAccountSessionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions'} + + def get( + self, + resource_group_name, # type: str + integration_account_name, # type: str + session_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountSession" + """Gets an integration account session. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param session_name: The integration account session name. + :type session_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSession or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountSession + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountSession"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'sessionName': self._serialize.url("session_name", session_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationAccountSession', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}'} + + def create_or_update( + self, + resource_group_name, # type: str + integration_account_name, # type: str + session_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + content=None, # type: Optional[object] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationAccountSession" + """Creates or updates an integration account session. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param session_name: The integration account session name. + :type session_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param content: The session content. + :type content: object + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSession or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationAccountSession or ~logic_management_client.models.IntegrationAccountSession + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationAccountSession"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _session = models.IntegrationAccountSession(location=location, tags=tags, content=content) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'sessionName': self._serialize.url("session_name", session_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_session, 'IntegrationAccountSession') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationAccountSession', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationAccountSession', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}'} + + def delete( + self, + resource_group_name, # type: str + integration_account_name, # type: str + session_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an integration account session. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param integration_account_name: The integration account name. + :type integration_account_name: str + :param session_name: The integration account session name. + :type session_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'integrationAccountName': self._serialize.url("integration_account_name", integration_account_name, 'str'), + 'sessionName': self._serialize.url("session_name", session_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_service_environment_managed_api_operation_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_service_environment_managed_api_operation_operations.py new file mode 100644 index 00000000000..7b803cec812 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_service_environment_managed_api_operation_operations.py @@ -0,0 +1,117 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationServiceEnvironmentManagedApiOperationOperations(object): + """IntegrationServiceEnvironmentManagedApiOperationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + api_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ApiOperationListResult" + """Gets the managed Api operations. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :param api_name: The api name. + :type api_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApiOperationListResult or the result of cls(response) + :rtype: ~logic_management_client.models.ApiOperationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ApiOperationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + 'apiName': self._serialize.url("api_name", api_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApiOperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}/apiOperations'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_service_environment_managed_api_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_service_environment_managed_api_operations.py new file mode 100644 index 00000000000..288f9ca1d56 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_service_environment_managed_api_operations.py @@ -0,0 +1,373 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationServiceEnvironmentManagedApiOperations(object): + """IntegrationServiceEnvironmentManagedApiOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedApiListResult" + """Gets the integration service environment managed Apis. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedApiListResult or the result of cls(response) + :rtype: ~logic_management_client.models.ManagedApiListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedApiListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ManagedApiListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis'} + + def get( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + api_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedApi" + """Gets the integration service environment managed Api. + + :param resource_group: The resource group name. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :param api_name: The api name. + :type api_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedApi or the result of cls(response) + :rtype: ~logic_management_client.models.ManagedApi + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedApi"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + 'apiName': self._serialize.url("api_name", api_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('ManagedApi', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}'} + + def _put_initial( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + api_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedApi" + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedApi"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self._put_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + 'apiName': self._serialize.url("api_name", api_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ManagedApi', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ManagedApi', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _put_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}'} + + def begin_put( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + api_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagedApi" + """Puts the integration service environment managed Api. + + :param resource_group: The resource group name. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :param api_name: The api name. + :type api_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns ManagedApi + :rtype: ~azure.core.polling.LROPoller[~logic_management_client.models.ManagedApi] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagedApi"] + raw_result = self._put_initial( + resource_group=resource_group, + integration_service_environment_name=integration_service_environment_name, + api_name=api_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ManagedApi', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}'} + + def _delete_initial( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + api_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self._delete_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + 'apiName': self._serialize.url("api_name", api_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}'} + + def begin_delete( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + api_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the integration service environment managed Api. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :param api_name: The api name. + :type api_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = self._delete_initial( + resource_group=resource_group, + integration_service_environment_name=integration_service_environment_name, + api_name=api_name, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_service_environment_network_health_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_service_environment_network_health_operations.py new file mode 100644 index 00000000000..f43562abb72 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_service_environment_network_health_operations.py @@ -0,0 +1,97 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationServiceEnvironmentNetworkHealthOperations(object): + """IntegrationServiceEnvironmentNetworkHealthOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Dict[str, "IntegrationServiceEnvironmentSubnetNetworkHealth"] + """Gets the integration service environment network health. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: dict or the result of cls(response) + :rtype: dict[str, ~logic_management_client.models.IntegrationServiceEnvironmentSubnetNetworkHealth] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "IntegrationServiceEnvironmentSubnetNetworkHealth"]] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('{IntegrationServiceEnvironmentSubnetNetworkHealth}', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/health/network'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_service_environment_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_service_environment_operations.py new file mode 100644 index 00000000000..9b2eeda72aa --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_service_environment_operations.py @@ -0,0 +1,596 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationServiceEnvironmentOperations(object): + """IntegrationServiceEnvironmentOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationServiceEnvironmentListResult" + """Gets a list of integration service environments by subscription. + + :param top: The number of items to be included in the result. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationServiceEnvironmentListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationServiceEnvironmentListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironmentListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # 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) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationServiceEnvironmentListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationServiceEnvironments'} + + def list_by_resource_group( + self, + resource_group, # type: str + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationServiceEnvironmentListResult" + """Gets a list of integration service environments by resource group. + + :param resource_group: The resource group. + :type resource_group: str + :param top: The number of items to be included in the result. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationServiceEnvironmentListResult or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationServiceEnvironmentListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironmentListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # 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'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationServiceEnvironmentListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments'} + + def get( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationServiceEnvironment" + """Gets an integration service environment. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationServiceEnvironment or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationServiceEnvironment + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironment"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}'} + + def _create_or_update_initial( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + properties=None, # type: Optional["models.IntegrationServiceEnvironmentProperties"] + sku=None, # type: Optional["models.IntegrationServiceEnvironmentSku"] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationServiceEnvironment" + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironment"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _integration_service_environment = models.IntegrationServiceEnvironment(location=location, tags=tags, properties=properties, sku=sku) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._create_or_update_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_integration_service_environment, 'IntegrationServiceEnvironment') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}'} + + def begin_create_or_update( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + properties=None, # type: Optional["models.IntegrationServiceEnvironmentProperties"] + sku=None, # type: Optional["models.IntegrationServiceEnvironmentSku"] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationServiceEnvironment" + """Creates or updates an integration service environment. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param properties: The integration service environment properties. + :type properties: ~logic_management_client.models.IntegrationServiceEnvironmentProperties + :param sku: The sku. + :type sku: ~logic_management_client.models.IntegrationServiceEnvironmentSku + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns IntegrationServiceEnvironment + :rtype: ~azure.core.polling.LROPoller[~logic_management_client.models.IntegrationServiceEnvironment] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironment"] + raw_result = self._create_or_update_initial( + resource_group=resource_group, + integration_service_environment_name=integration_service_environment_name, + location=location, + tags=tags, + properties=properties, + sku=sku, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}'} + + def _update_initial( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + properties=None, # type: Optional["models.IntegrationServiceEnvironmentProperties"] + sku=None, # type: Optional["models.IntegrationServiceEnvironmentSku"] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationServiceEnvironment" + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironment"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _integration_service_environment = models.IntegrationServiceEnvironment(location=location, tags=tags, properties=properties, sku=sku) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._update_initial.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_integration_service_environment, 'IntegrationServiceEnvironment') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}'} + + def begin_update( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + properties=None, # type: Optional["models.IntegrationServiceEnvironmentProperties"] + sku=None, # type: Optional["models.IntegrationServiceEnvironmentSku"] + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationServiceEnvironment" + """Updates an integration service environment. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param properties: The integration service environment properties. + :type properties: ~logic_management_client.models.IntegrationServiceEnvironmentProperties + :param sku: The sku. + :type sku: ~logic_management_client.models.IntegrationServiceEnvironmentSku + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns IntegrationServiceEnvironment + :rtype: ~azure.core.polling.LROPoller[~logic_management_client.models.IntegrationServiceEnvironment] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironment"] + raw_result = self._update_initial( + resource_group=resource_group, + integration_service_environment_name=integration_service_environment_name, + location=location, + tags=tags, + properties=properties, + sku=sku, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}'} + + def delete( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an integration service environment. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}'} + + def restart( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Restarts an integration service environment. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.restart.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/restart'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_service_environment_sku_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_service_environment_sku_operations.py new file mode 100644 index 00000000000..2a8d954b363 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_integration_service_environment_sku_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class IntegrationServiceEnvironmentSkuOperations(object): + """IntegrationServiceEnvironmentSkuOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group, # type: str + integration_service_environment_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.IntegrationServiceEnvironmentSkuList" + """Gets a list of integration service environment Skus. + + :param resource_group: The resource group. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + :type integration_service_environment_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationServiceEnvironmentSkuList or the result of cls(response) + :rtype: ~logic_management_client.models.IntegrationServiceEnvironmentSkuList + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.IntegrationServiceEnvironmentSkuList"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str'), + 'integrationServiceEnvironmentName': self._serialize.url("integration_service_environment_name", integration_service_environment_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('IntegrationServiceEnvironmentSkuList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/skus'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_operation_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_operation_operations.py new file mode 100644 index 00000000000..549f969dc54 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_operation_operations.py @@ -0,0 +1,101 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations(object): + """OperationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.OperationListResult" + """Lists all of the available Logic REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationListResult or the result of cls(response) + :rtype: ~logic_management_client.models.OperationListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Logic/operations'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_operations.py new file mode 100644 index 00000000000..51d901031df --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_operations.py @@ -0,0 +1,1135 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowOperations(object): + """WorkflowOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_by_subscription( + self, + top=None, # type: Optional[int] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowListResult" + """Gets a list of workflows by subscription. + + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: State, + Trigger, and ReferencedResourceId. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowListResult or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # 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) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Logic/workflows'} + + def list_by_resource_group( + self, + resource_group_name, # type: str + top=None, # type: Optional[int] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowListResult" + """Gets a list of workflows by resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: State, + Trigger, and ReferencedResourceId. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowListResult or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # 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'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows'} + + def get( + self, + resource_group_name, # type: str + workflow_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Workflow" + """Gets a workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workflow or the result of cls(response) + :rtype: ~logic_management_client.models.Workflow + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Workflow"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Workflow', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}'} + + def create_or_update( + self, + resource_group_name, # type: str + workflow_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + state=None, # type: Optional[Union[str, "models.WorkflowState"]] + endpoints_configuration=None, # type: Optional["models.FlowEndpointsConfiguration"] + access_control=None, # type: Optional["models.FlowAccessControlConfiguration"] + integration_account=None, # type: Optional["models.ResourceReference"] + integration_service_environment=None, # type: Optional["models.ResourceReference"] + definition=None, # type: Optional[object] + parameters=None, # type: Optional[Dict[str, "WorkflowParameter"]] + **kwargs # type: Any + ): + # type: (...) -> "models.Workflow" + """Creates or updates a workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param state: The state. + :type state: str or ~logic_management_client.models.WorkflowState + :param endpoints_configuration: The endpoints configuration. + :type endpoints_configuration: ~logic_management_client.models.FlowEndpointsConfiguration + :param integration_account: The integration account. + :type integration_account: ~logic_management_client.models.ResourceReference + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~logic_management_client.models.ResourceReference + :param definition: The definition. + :type definition: object + :param parameters: The parameters. + :type parameters: dict[str, ~logic_management_client.models.WorkflowParameter] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workflow or the result of cls(response) + :rtype: ~logic_management_client.models.Workflow or ~logic_management_client.models.Workflow + :raises: ~azure.core.exceptions.HttpResponseError + """ + + cls = kwargs.pop('cls', None) # type: ClsType["models.Workflow"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _workflow = models.Workflow(location=location, tags=tags, state=state, endpoints_configuration=endpoints_configuration, access_control=access_control, integration_account=integration_account, integration_service_environment=integration_service_environment, definition=definition, parameters=parameters) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_workflow, 'Workflow') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Workflow', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Workflow', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}'} + + def update( + self, + resource_group_name, # type: str + workflow_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + state=None, # type: Optional[Union[str, "models.WorkflowState"]] + endpoints_configuration=None, # type: Optional["models.FlowEndpointsConfiguration"] + integration_account=None, # type: Optional["models.ResourceReference"] + integration_service_environment=None, # type: Optional["models.ResourceReference"] + definition=None, # type: Optional[object] + parameters=None, # type: Optional[Dict[str, "WorkflowParameter"]] + **kwargs # type: Any + ): + # type: (...) -> "models.Workflow" + """Updates a workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param state: The state. + :type state: str or ~logic_management_client.models.WorkflowState + :param endpoints_configuration: The endpoints configuration. + :type endpoints_configuration: ~logic_management_client.models.FlowEndpointsConfiguration + :param integration_account: The integration account. + :type integration_account: ~logic_management_client.models.ResourceReference + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~logic_management_client.models.ResourceReference + :param definition: The definition. + :type definition: object + :param parameters: The parameters. + :type parameters: dict[str, ~logic_management_client.models.WorkflowParameter] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workflow or the result of cls(response) + :rtype: ~logic_management_client.models.Workflow + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Workflow"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _workflow = models.Workflow(location=location, tags=tags, state=state, endpoints_configuration=endpoints_configuration, integration_account=integration_account, integration_service_environment=integration_service_environment, definition=definition, parameters=parameters) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_workflow, 'Workflow') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Workflow', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}'} + + def delete( + self, + resource_group_name, # type: str + workflow_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}'} + + def disable( + self, + resource_group_name, # type: str + workflow_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Disables a workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.disable.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + disable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/disable'} + + def enable( + self, + resource_group_name, # type: str + workflow_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Enables a workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.enable.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + enable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/enable'} + + def generate_upgraded_definition( + self, + resource_group_name, # type: str + workflow_name, # type: str + target_schema_version=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> object + """Generates the upgraded definition for a workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param target_schema_version: The target schema version. + :type target_schema_version: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: object or the result of cls(response) + :rtype: object + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[object] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.GenerateUpgradedDefinitionParameters(target_schema_version=target_schema_version) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.generate_upgraded_definition.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_parameters, 'GenerateUpgradedDefinitionParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + generate_upgraded_definition.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/generateUpgradedDefinition'} + + def list_callback_url( + self, + resource_group_name, # type: str + workflow_name, # type: str + not_after=None, # type: Optional[datetime.datetime] + key_type=None, # type: Optional[Union[str, "models.KeyType"]] + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowTriggerCallbackUrl" + """Get the workflow callback Url. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _list_callback_url = models.GetCallbackUrlParameters(not_after=not_after, key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.list_callback_url.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_list_callback_url, 'GetCallbackUrlParameters') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listCallbackUrl'} + + def list_swagger( + self, + resource_group_name, # type: str + workflow_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> object + """Gets an OpenAPI definition for the workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: object or the result of cls(response) + :rtype: object + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[object] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.list_swagger.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('object', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_swagger.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listSwagger'} + + def _move_initial( + self, + resource_group_name, # type: str + workflow_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + state=None, # type: Optional[Union[str, "models.WorkflowState"]] + endpoints_configuration=None, # type: Optional["models.FlowEndpointsConfiguration"] + integration_account=None, # type: Optional["models.ResourceReference"] + integration_service_environment=None, # type: Optional["models.ResourceReference"] + definition=None, # type: Optional[object] + parameters=None, # type: Optional[Dict[str, "WorkflowParameter"]] + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _move = models.Workflow(location=location, tags=tags, state=state, endpoints_configuration=endpoints_configuration, integration_account=integration_account, integration_service_environment=integration_service_environment, definition=definition, parameters=parameters) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self._move_initial.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_move, 'Workflow') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + _move_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move'} + + def begin_move( + self, + resource_group_name, # type: str + workflow_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + state=None, # type: Optional[Union[str, "models.WorkflowState"]] + endpoints_configuration=None, # type: Optional["models.FlowEndpointsConfiguration"] + integration_account=None, # type: Optional["models.ResourceReference"] + integration_service_environment=None, # type: Optional["models.ResourceReference"] + definition=None, # type: Optional[object] + parameters=None, # type: Optional[Dict[str, "WorkflowParameter"]] + **kwargs # type: Any + ): + # type: (...) -> None + """Moves an existing workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param state: The state. + :type state: str or ~logic_management_client.models.WorkflowState + :param endpoints_configuration: The endpoints configuration. + :type endpoints_configuration: ~logic_management_client.models.FlowEndpointsConfiguration + :param integration_account: The integration account. + :type integration_account: ~logic_management_client.models.ResourceReference + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~logic_management_client.models.ResourceReference + :param definition: The definition. + :type definition: object + :param parameters: The parameters. + :type parameters: dict[str, ~logic_management_client.models.WorkflowParameter] + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + raw_result = self._move_initial( + resource_group_name=resource_group_name, + workflow_name=workflow_name, + location=location, + tags=tags, + state=state, + endpoints_configuration=endpoints_configuration, + integration_account=integration_account, + integration_service_environment=integration_service_environment, + definition=definition, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + lro_delay = kwargs.get( + 'polling_interval', + self._config.polling_interval + ) + if polling is True: raise ValueError("polling being True is not valid because no default polling implemetation has been defined.") + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move'} + + def regenerate_access_key( + self, + resource_group_name, # type: str + workflow_name, # type: str + key_type=None, # type: Optional[Union[str, "models.KeyType"]] + **kwargs # type: Any + ): + # type: (...) -> None + """Regenerates the callback URL access key for request triggers. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _key_type = models.RegenerateActionParameter(key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.regenerate_access_key.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_key_type, 'RegenerateActionParameter') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + regenerate_access_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/regenerateAccessKey'} + + def validate_by_resource_group( + self, + resource_group_name, # type: str + workflow_name, # type: str + location=None, # type: Optional[str] + tags=None, # type: Optional[Dict[str, str]] + state=None, # type: Optional[Union[str, "models.WorkflowState"]] + endpoints_configuration=None, # type: Optional["models.FlowEndpointsConfiguration"] + integration_account=None, # type: Optional["models.ResourceReference"] + integration_service_environment=None, # type: Optional["models.ResourceReference"] + definition=None, # type: Optional[object] + parameters=None, # type: Optional[Dict[str, "WorkflowParameter"]] + **kwargs # type: Any + ): + # type: (...) -> None + """Validates the workflow. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param location: The resource location. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param state: The state. + :type state: str or ~logic_management_client.models.WorkflowState + :param endpoints_configuration: The endpoints configuration. + :type endpoints_configuration: ~logic_management_client.models.FlowEndpointsConfiguration + :param integration_account: The integration account. + :type integration_account: ~logic_management_client.models.ResourceReference + :param integration_service_environment: The integration service environment. + :type integration_service_environment: ~logic_management_client.models.ResourceReference + :param definition: The definition. + :type definition: object + :param parameters: The parameters. + :type parameters: dict[str, ~logic_management_client.models.WorkflowParameter] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _validate = models.Workflow(location=location, tags=tags, state=state, endpoints_configuration=endpoints_configuration, integration_account=integration_account, integration_service_environment=integration_service_environment, definition=definition, parameters=parameters) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.validate_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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_validate, 'Workflow') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + validate_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/validate'} + + def validate_by_location( + self, + resource_group_name, # type: str + location, # type: str + workflow_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Validates the workflow definition. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param location: The workflow location. + :type location: str + :param workflow_name: The workflow name. + :type workflow_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.validate_by_location.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'), + 'location': self._serialize.url("location", location, 'str'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + validate_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/locations/{location}/workflows/{workflowName}/validate'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_action_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_action_operations.py new file mode 100644 index 00000000000..98c083e7b5b --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_action_operations.py @@ -0,0 +1,272 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowRunActionOperations(object): + """WorkflowRunActionOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + workflow_name, # type: str + run_name, # type: str + top=None, # type: Optional[int] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowRunActionListResult" + """Gets a list of workflow run actions. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: Status. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRunActionListResult or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRunActionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRunActionListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowRunActionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions'} + + def get( + self, + resource_group_name, # type: str + workflow_name, # type: str + run_name, # type: str + action_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowRunAction" + """Gets a workflow run action. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRunAction or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRunAction + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRunAction"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowRunAction', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}'} + + def list_expression_trace( + self, + resource_group_name, # type: str + workflow_name, # type: str + run_name, # type: str + action_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ExpressionTraces" + """Lists a workflow run expression trace. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressionTraces or the result of cls(response) + :rtype: ~logic_management_client.models.ExpressionTraces + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressionTraces"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_expression_trace.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressionTraces', pipeline_response) + list_of_elem = deserialized.inputs + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_expression_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/listExpressionTraces'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_action_repetition_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_action_repetition_operations.py new file mode 100644 index 00000000000..920ba54db8c --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_action_repetition_operations.py @@ -0,0 +1,274 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowRunActionRepetitionOperations(object): + """WorkflowRunActionRepetitionOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + workflow_name, # type: str + run_name, # type: str + action_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowRunActionRepetitionDefinitionCollection" + """Get all of a workflow run action repetitions. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRunActionRepetitionDefinitionCollection or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRunActionRepetitionDefinitionCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRunActionRepetitionDefinitionCollection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowRunActionRepetitionDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions'} + + def get( + self, + resource_group_name, # type: str + workflow_name, # type: str + run_name, # type: str + action_name, # type: str + repetition_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowRunActionRepetitionDefinition" + """Get a workflow run action repetition. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :param repetition_name: The workflow repetition. + :type repetition_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRunActionRepetitionDefinition or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRunActionRepetitionDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRunActionRepetitionDefinition"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + 'repetitionName': self._serialize.url("repetition_name", repetition_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowRunActionRepetitionDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}'} + + def list_expression_trace( + self, + resource_group_name, # type: str + workflow_name, # type: str + run_name, # type: str + action_name, # type: str + repetition_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ExpressionTraces" + """Lists a workflow run expression trace. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :param repetition_name: The workflow repetition. + :type repetition_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ExpressionTraces or the result of cls(response) + :rtype: ~logic_management_client.models.ExpressionTraces + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ExpressionTraces"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_expression_trace.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + 'repetitionName': self._serialize.url("repetition_name", repetition_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ExpressionTraces', pipeline_response) + list_of_elem = deserialized.inputs + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_expression_trace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/listExpressionTraces'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_action_repetition_request_history_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_action_repetition_request_history_operations.py new file mode 100644 index 00000000000..86fa5de0eb5 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_action_repetition_request_history_operations.py @@ -0,0 +1,198 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowRunActionRepetitionRequestHistoryOperations(object): + """WorkflowRunActionRepetitionRequestHistoryOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + workflow_name, # type: str + run_name, # type: str + action_name, # type: str + repetition_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.RequestHistoryListResult" + """List a workflow run repetition request history. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :param repetition_name: The workflow repetition. + :type repetition_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RequestHistoryListResult or the result of cls(response) + :rtype: ~logic_management_client.models.RequestHistoryListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RequestHistoryListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + 'repetitionName': self._serialize.url("repetition_name", repetition_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RequestHistoryListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories'} + + def get( + self, + resource_group_name, # type: str + workflow_name, # type: str + run_name, # type: str + action_name, # type: str + repetition_name, # type: str + request_history_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.RequestHistory" + """Gets a workflow run repetition request history. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :param repetition_name: The workflow repetition. + :type repetition_name: str + :param request_history_name: The request history name. + :type request_history_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RequestHistory or the result of cls(response) + :rtype: ~logic_management_client.models.RequestHistory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RequestHistory"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + 'repetitionName': self._serialize.url("repetition_name", repetition_name, 'str'), + 'requestHistoryName': self._serialize.url("request_history_name", request_history_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('RequestHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories/{requestHistoryName}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_action_request_history_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_action_request_history_operations.py new file mode 100644 index 00000000000..f558cef9f46 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_action_request_history_operations.py @@ -0,0 +1,190 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowRunActionRequestHistoryOperations(object): + """WorkflowRunActionRequestHistoryOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + workflow_name, # type: str + run_name, # type: str + action_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.RequestHistoryListResult" + """List a workflow run request history. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RequestHistoryListResult or the result of cls(response) + :rtype: ~logic_management_client.models.RequestHistoryListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RequestHistoryListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('RequestHistoryListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories'} + + def get( + self, + resource_group_name, # type: str + workflow_name, # type: str + run_name, # type: str + action_name, # type: str + request_history_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.RequestHistory" + """Gets a workflow run request history. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :param request_history_name: The request history name. + :type request_history_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RequestHistory or the result of cls(response) + :rtype: ~logic_management_client.models.RequestHistory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.RequestHistory"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + 'requestHistoryName': self._serialize.url("request_history_name", request_history_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('RequestHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories/{requestHistoryName}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_action_scope_repetition_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_action_scope_repetition_operations.py new file mode 100644 index 00000000000..8bd48b1fae4 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_action_scope_repetition_operations.py @@ -0,0 +1,190 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowRunActionScopeRepetitionOperations(object): + """WorkflowRunActionScopeRepetitionOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + workflow_name, # type: str + run_name, # type: str + action_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowRunActionRepetitionDefinitionCollection" + """List the workflow run action scoped repetitions. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRunActionRepetitionDefinitionCollection or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRunActionRepetitionDefinitionCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRunActionRepetitionDefinitionCollection"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowRunActionRepetitionDefinitionCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions'} + + def get( + self, + resource_group_name, # type: str + workflow_name, # type: str + run_name, # type: str + action_name, # type: str + repetition_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowRunActionRepetitionDefinition" + """Get a workflow run action scoped repetition. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param action_name: The workflow action name. + :type action_name: str + :param repetition_name: The workflow repetition. + :type repetition_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRunActionRepetitionDefinition or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRunActionRepetitionDefinition + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRunActionRepetitionDefinition"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'actionName': self._serialize.url("action_name", action_name, 'str'), + 'repetitionName': self._serialize.url("repetition_name", repetition_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowRunActionRepetitionDefinition', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions/{repetitionName}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_operation_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_operation_operations.py new file mode 100644 index 00000000000..c0c609527f9 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_operation_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowRunOperationOperations(object): + """WorkflowRunOperationOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + workflow_name, # type: str + run_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowRun" + """Gets an operation for a run. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :param operation_id: The workflow operation id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRun or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRun + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRun"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowRun', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/operations/{operationId}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_operations.py new file mode 100644 index 00000000000..44bd25c0029 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_run_operations.py @@ -0,0 +1,242 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowRunOperations(object): + """WorkflowRunOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + workflow_name, # type: str + top=None, # type: Optional[int] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowRunListResult" + """Gets a list of workflow runs. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: Status, + StartTime, and ClientTrackingId. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRunListResult or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRunListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRunListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowRunListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs'} + + def get( + self, + resource_group_name, # type: str + workflow_name, # type: str + run_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowRun" + """Gets a workflow run. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowRun or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowRun + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowRun"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowRun', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}'} + + def cancel( + self, + resource_group_name, # type: str + workflow_name, # type: str + run_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Cancels a workflow run. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param run_name: The workflow run name. + :type run_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.cancel.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'runName': self._serialize.url("run_name", run_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/cancel'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_trigger_history_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_trigger_history_operations.py new file mode 100644 index 00000000000..f23446ceddc --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_trigger_history_operations.py @@ -0,0 +1,256 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowTriggerHistoryOperations(object): + """WorkflowTriggerHistoryOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + workflow_name, # type: str + trigger_name, # type: str + top=None, # type: Optional[int] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowTriggerHistoryListResult" + """Gets a list of workflow trigger histories. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. Options for filters include: Status, + StartTime, and ClientTrackingId. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerHistoryListResult or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerHistoryListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerHistoryListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowTriggerHistoryListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories'} + + def get( + self, + resource_group_name, # type: str + workflow_name, # type: str + trigger_name, # type: str + history_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowTriggerHistory" + """Gets a workflow trigger history. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :param history_name: The workflow trigger history name. Corresponds to the run name for + triggers that resulted in a run. + :type history_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerHistory or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerHistory + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerHistory"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + 'historyName': self._serialize.url("history_name", history_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerHistory', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}'} + + def resubmit( + self, + resource_group_name, # type: str + workflow_name, # type: str + trigger_name, # type: str + history_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Resubmits a workflow run based on the trigger history. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :param history_name: The workflow trigger history name. Corresponds to the run name for + triggers that resulted in a run. + :type history_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.resubmit.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + 'historyName': self._serialize.url("history_name", history_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + resubmit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}/resubmit'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_trigger_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_trigger_operations.py new file mode 100644 index 00000000000..b12fbd43f9e --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_trigger_operations.py @@ -0,0 +1,488 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowTriggerOperations(object): + """WorkflowTriggerOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + workflow_name, # type: str + top=None, # type: Optional[int] + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowTriggerListResult" + """Gets a list of workflow triggers. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param top: The number of items to be included in the result. + :type top: int + :param filter: The filter to apply on the operation. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerListResult or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowTriggerListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers'} + + def get( + self, + resource_group_name, # type: str + workflow_name, # type: str + trigger_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowTrigger" + """Gets a workflow trigger. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTrigger or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTrigger + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTrigger"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTrigger', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}'} + + def reset( + self, + resource_group_name, # type: str + workflow_name, # type: str + trigger_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Resets a workflow trigger. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.reset.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/reset'} + + def run( + self, + resource_group_name, # type: str + workflow_name, # type: str + trigger_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Runs a workflow trigger. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.run.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in []: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize('object', response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + run.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/run'} + + def get_schema_json( + self, + resource_group_name, # type: str + workflow_name, # type: str + trigger_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.JsonSchema" + """Get the trigger schema as JSON. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JsonSchema or the result of cls(response) + :rtype: ~logic_management_client.models.JsonSchema + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.JsonSchema"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.get_schema_json.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('JsonSchema', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_schema_json.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/schemas/json'} + + def set_state( + self, + resource_group_name, # type: str + workflow_name, # type: str + trigger_name, # type: str + source, # type: "models.WorkflowTrigger" + **kwargs # type: Any + ): + # type: (...) -> None + """Sets the state of a workflow trigger. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :param source: The source. + :type source: ~logic_management_client.models.WorkflowTrigger + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _set_state = models.SetTriggerStateActionDefinition(source=source) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.set_state.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_set_state, 'SetTriggerStateActionDefinition') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + set_state.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/setState'} + + def list_callback_url( + self, + resource_group_name, # type: str + workflow_name, # type: str + trigger_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowTriggerCallbackUrl" + """Get the callback URL for a workflow trigger. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # Construct URL + url = self.list_callback_url.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/listCallbackUrl'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_version_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_version_operations.py new file mode 100644 index 00000000000..f6a72051320 --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_version_operations.py @@ -0,0 +1,179 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowVersionOperations(object): + """WorkflowVersionOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + workflow_name, # type: str + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowVersionListResult" + """Gets a list of workflow versions. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param top: The number of items to be included in the result. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowVersionListResult or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowVersionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowVersionListResult"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkflowVersionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions'} + + def get( + self, + resource_group_name, # type: str + workflow_name, # type: str + version_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowVersion" + """Gets a workflow version. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param version_id: The workflow versionId. + :type version_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowVersion or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowVersion"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + api_version = "2019-05-01" + + # 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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_version_trigger_operations.py b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_version_trigger_operations.py new file mode 100644 index 00000000000..6a3515447af --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/operations/_workflow_version_trigger_operations.py @@ -0,0 +1,123 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkflowVersionTriggerOperations(object): + """WorkflowVersionTriggerOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~logic_management_client.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_callback_url( + self, + resource_group_name, # type: str + workflow_name, # type: str + version_id, # type: str + trigger_name, # type: str + not_after=None, # type: Optional[datetime.datetime] + key_type=None, # type: Optional[Union[str, "models.KeyType"]] + **kwargs # type: Any + ): + # type: (...) -> "models.WorkflowTriggerCallbackUrl" + """Get the callback url for a trigger of a workflow version. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param workflow_name: The workflow name. + :type workflow_name: str + :param version_id: The workflow versionId. + :type version_id: str + :param trigger_name: The workflow trigger name. + :type trigger_name: str + :param not_after: The expiry time. + :type not_after: ~datetime.datetime + :param key_type: The key type. + :type key_type: str or ~logic_management_client.models.KeyType + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~logic_management_client.models.WorkflowTriggerCallbackUrl + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.WorkflowTriggerCallbackUrl"] + error_map = kwargs.pop('error_map', {404: ResourceNotFoundError, 409: ResourceExistsError}) + + _parameters = models.GetCallbackUrlParameters(not_after=not_after, key_type=key_type) + api_version = "2019-05-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.list_callback_url.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'), + 'workflowName': self._serialize.url("workflow_name", workflow_name, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'triggerName': self._serialize.url("trigger_name", trigger_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + if _parameters is not None: + body_content = self._serialize.body(_parameters, 'GetCallbackUrlParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_callback_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}/triggers/{triggerName}/listCallbackUrl'} diff --git a/src/logic/azext_logic/vendored_sdks/logic/py.typed b/src/logic/azext_logic/vendored_sdks/logic/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/logic/azext_logic/vendored_sdks/logic/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/logic/report.md b/src/logic/report.md new file mode 100644 index 00000000000..249fe951e66 --- /dev/null +++ b/src/logic/report.md @@ -0,0 +1,242 @@ +# Azure CLI Module Creation Report + +### logic integration-account create + +create a logic integration-account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--integration_account_name**|string|The integration account name.|integration_account_name|integration_account_name| +|**--location**|string|The resource location.|location|location| +|**--tags**|dictionary|The resource tags.|tags|tags| +|**--sku**|object|The sku.|sku|sku| +|**--integration_service_environment**|object|The integration service environment.|integration_service_environment|integration_service_environment| +|**--state**|choice|The workflow state.|state|state| +### logic integration-account delete + +delete a logic integration-account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--integration_account_name**|string|The integration account name.|integration_account_name|integration_account_name| +### logic integration-account list + +list a logic integration-account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--top**|integer|The number of items to be included in the result.|top|top| +### logic integration-account list-callback-url + +list-callback-url a logic integration-account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--integration_account_name**|string|The integration account name.|integration_account_name|integration_account_name| +|**--not_after**|date-time|The expiry time.|not_after|not_after| +|**--key_type**|choice|The key type.|key_type|key_type| +### logic integration-account list-key-vault-key + +list-key-vault-key a logic integration-account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--integration_account_name**|string|The integration account name.|integration_account_name|integration_account_name| +|**--key_vault**|object|The key vault reference.|key_vault|key_vault| +|**--skip_token**|string|The skip token.|skip_token|skip_token| +### logic integration-account log-tracking-event + +log-tracking-event a logic integration-account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--integration_account_name**|string|The integration account name.|integration_account_name|integration_account_name| +|**--source_type**|string|The source type.|source_type|source_type| +|**--events**|array|The events.|events|events| +|**--track_events_options**|choice|The track events options.|track_events_options|track_events_options| +### logic integration-account regenerate-access-key + +regenerate-access-key a logic integration-account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--integration_account_name**|string|The integration account name.|integration_account_name|integration_account_name| +|**--key_type**|choice|The key type.|key_type|key_type| +### logic integration-account show + +show a logic integration-account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--integration_account_name**|string|The integration account name.|integration_account_name|integration_account_name| +### logic integration-account update + +update a logic integration-account. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--integration_account_name**|string|The integration account name.|integration_account_name|integration_account_name| +|**--location**|string|The resource location.|location|location| +|**--tags**|dictionary|The resource tags.|tags|tags| +|**--sku**|object|The sku.|sku|sku| +|**--integration_service_environment**|object|The integration service environment.|integration_service_environment|integration_service_environment| +|**--state**|choice|The workflow state.|state|state| +### logic workflow create + +create a logic workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--workflow_name**|string|The workflow name.|workflow_name|workflow_name| +|**--location**|string|The resource location.|location|location| +|**--tags**|dictionary|The resource tags.|tags|tags| +|**--state**|choice|The state.|state|state| +|**--endpoints_configuration**|object|The endpoints configuration.|endpoints_configuration|endpoints_configuration| +|**--integration_account**|object|The integration account.|integration_account|integration_account| +|**--integration_service_environment**|object|The integration service environment.|integration_service_environment|integration_service_environment| +|**--definition**|any|The definition.|definition|definition| +|**--parameters**|dictionary|The parameters.|parameters|parameters| +### logic workflow delete + +delete a logic workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--workflow_name**|string|The workflow name.|workflow_name|workflow_name| +### logic workflow disable + +disable a logic workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--workflow_name**|string|The workflow name.|workflow_name|workflow_name| +### logic workflow enable + +enable a logic workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--workflow_name**|string|The workflow name.|workflow_name|workflow_name| +### logic workflow generate-upgraded-definition + +generate-upgraded-definition a logic workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--workflow_name**|string|The workflow name.|workflow_name|workflow_name| +|**--target_schema_version**|string|The target schema version.|target_schema_version|target_schema_version| +### logic workflow list + +list a logic workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--top**|integer|The number of items to be included in the result.|top|top| +|**--filter**|string|The filter to apply on the operation. Options for filters include: State, Trigger, and ReferencedResourceId.|filter|filter| +### logic workflow list-callback-url + +list-callback-url a logic workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--workflow_name**|string|The workflow name.|workflow_name|workflow_name| +|**--not_after**|date-time|The expiry time.|not_after|not_after| +|**--key_type**|choice|The key type.|key_type|key_type| +### logic workflow list-swagger + +list-swagger a logic workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--workflow_name**|string|The workflow name.|workflow_name|workflow_name| +### logic workflow move + +move a logic workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--workflow_name**|string|The workflow name.|workflow_name|workflow_name| +|**--location**|string|The resource location.|location|location| +|**--tags**|dictionary|The resource tags.|tags|tags| +|**--state**|choice|The state.|state|state| +|**--endpoints_configuration**|object|The endpoints configuration.|endpoints_configuration|endpoints_configuration| +|**--integration_account**|object|The integration account.|integration_account|integration_account| +|**--integration_service_environment**|object|The integration service environment.|integration_service_environment|integration_service_environment| +|**--definition**|any|The definition.|definition|definition| +|**--parameters**|dictionary|The parameters.|parameters|parameters| +### logic workflow regenerate-access-key + +regenerate-access-key a logic workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--workflow_name**|string|The workflow name.|workflow_name|workflow_name| +|**--key_type**|choice|The key type.|key_type|key_type| +### logic workflow show + +show a logic workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--workflow_name**|string|The workflow name.|workflow_name|workflow_name| +### logic workflow update + +update a logic workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--workflow_name**|string|The workflow name.|workflow_name|workflow_name| +|**--location**|string|The resource location.|location|location| +|**--tags**|dictionary|The resource tags.|tags|tags| +|**--state**|choice|The state.|state|state| +|**--endpoints_configuration**|object|The endpoints configuration.|endpoints_configuration|endpoints_configuration| +|**--integration_account**|object|The integration account.|integration_account|integration_account| +|**--integration_service_environment**|object|The integration service environment.|integration_service_environment|integration_service_environment| +|**--definition**|any|The definition.|definition|definition| +|**--parameters**|dictionary|The parameters.|parameters|parameters| +### logic workflow validate-by-location + +validate-by-location a logic workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--location**|string|The workflow location.|location|location| +|**--workflow_name**|string|The workflow name.|workflow_name|workflow_name| +### logic workflow validate-by-resource-group + +validate-by-resource-group a logic workflow. + +|Option|Type|Description|Path (SDK)|Path (swagger)| +|------|----|-----------|----------|--------------| +|**--resource_group_name**|string|The resource group name.|resource_group_name|resource_group_name| +|**--workflow_name**|string|The workflow name.|workflow_name|workflow_name| +|**--location**|string|The resource location.|location|location| +|**--tags**|dictionary|The resource tags.|tags|tags| +|**--state**|choice|The state.|state|state| +|**--endpoints_configuration**|object|The endpoints configuration.|endpoints_configuration|endpoints_configuration| +|**--integration_account**|object|The integration account.|integration_account|integration_account| +|**--integration_service_environment**|object|The integration service environment.|integration_service_environment|integration_service_environment| +|**--definition**|any|The definition.|definition|definition| +|**--parameters**|dictionary|The parameters.|parameters|parameters| \ No newline at end of file diff --git a/src/logic/setup.cfg b/src/logic/setup.cfg new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/logic/setup.py b/src/logic/setup.py new file mode 100644 index 00000000000..4e6f4a49ba5 --- /dev/null +++ b/src/logic/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.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + '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='logic', + version=VERSION, + description='Microsoft Azure Command-Line Tools LogicManagementClient 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_logic': ['azext_metadata.json']}, +) diff --git a/src/portal/HISTORY.rst b/src/portal/HISTORY.rst new file mode 100644 index 00000000000..10e842bc040 --- /dev/null +++ b/src/portal/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.1 +++++++ +* Initial release. diff --git a/src/portal/README.md b/src/portal/README.md new file mode 100644 index 00000000000..8e8c168f4f2 --- /dev/null +++ b/src/portal/README.md @@ -0,0 +1,80 @@ +Microsoft Azure CLI 'portal' Extension +========================================== + +This package is for the 'portal' extension. i.e. 'az portal' +More info on what is [Azure portal](https://docs.microsoft.com/en-us/azure/azure-portal/azure-portal-overview). + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name portal +``` + +### Included Features ### +Manage Azure portal dashboards: [more info](https://docs.microsoft.com/en-us/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) + + +#### Import a portal dashboard #### +You should have a dashboard json template ready before using this operation, the file can be downloaded from Azure portal website. +More info can be found [here](https://docs.microsoft.com/en-us/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) +Example: +``` +az portal dashboard import \ +--name dashboardName \ +--resource-group groupName \ +--input-path "/path/to/dashboard/template/file/directory" +``` +An example dashboard JSON template may look like: +[dashboard.json](https://github.com/Azure/azure-cli-extensions/blob/master/src/portal/azext_portal/tests/latest/dashboard.json) + +#### Create a portal dashboard #### +Example: +``` +az portal dashboard create \ +--location "eastus" \ +--name dashboardName \ +--resource-group groupName \ +--input-path "/path/to/properties/file/directory" +--tags aKey=aValue anotherKey=anotherValue +``` +An example propeties JSON file may look like: +[properties.json](https://github.com/Azure/azure-cli-extensions/blob/master/src/portal/azext_portal/tests/latest/properties.json) + +#### List all portal dashboards #### +Example: +List all dashboards in a resourceGroup +``` +az portal dashboard list \ +--resource-group groupName +``` +List all dashboards in a subscription +``` +az portal dashboard list +``` + +#### Show a portal dashboard details #### +Example: +``` +az portal dashboard show \ +--name dashboardName \ +--resource-group groupName +``` + +#### Update an existing dashboard #### +Example: +``` +az portal dashboard update \ +--name dashboardName \ +--resource-group groupName \ +--input-path "/src/json/properties.json" +``` + +#### Delete a dashboard #### +Example: +``` +az portal dashboard delete \ +--name dashboardName \ +--resource-group groupName \ +``` + +If you have issues, please give feedback by opening an issue at https://github.com/Azure/azure-cli-extensions/issues. \ No newline at end of file diff --git a/src/portal/azext_portal/__init__.py b/src/portal/azext_portal/__init__.py new file mode 100644 index 00000000000..aa06a723e75 --- /dev/null +++ b/src/portal/azext_portal/__init__.py @@ -0,0 +1,31 @@ +# -------------------------------------------------------------------------------------------- +# 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 .generated._help import helps # pylint: disable=unused-import + + +class PortalCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from .generated._client_factory import cf_portal + portal_custom = CliCommandType( + operations_tmpl='azext_portal.custom#{}', + client_factory=cf_portal) + super(PortalCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=portal_custom) + + def load_command_table(self, args): + from .generated.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from .generated._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = PortalCommandsLoader diff --git a/src/portal/azext_portal/action.py b/src/portal/azext_portal/action.py new file mode 100644 index 00000000000..d66d3c5d0d7 --- /dev/null +++ b/src/portal/azext_portal/action.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/portal/azext_portal/azext_metadata.json b/src/portal/azext_portal/azext_metadata.json new file mode 100644 index 00000000000..13025150393 --- /dev/null +++ b/src/portal/azext_portal/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1" +} \ No newline at end of file diff --git a/src/portal/azext_portal/commands.py b/src/portal/azext_portal/commands.py new file mode 100644 index 00000000000..42f0c1a991e --- /dev/null +++ b/src/portal/azext_portal/commands.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.commands import * # noqa: F403 +try: + from .manual.commands import * # noqa: F403 +except ImportError: + pass diff --git a/src/portal/azext_portal/custom.py b/src/portal/azext_portal/custom.py new file mode 100644 index 00000000000..d1fd3543ed0 --- /dev/null +++ b/src/portal/azext_portal/custom.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/portal/azext_portal/generated/__init__.py b/src/portal/azext_portal/generated/__init__.py new file mode 100644 index 00000000000..59333308532 --- /dev/null +++ b/src/portal/azext_portal/generated/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- diff --git a/src/portal/azext_portal/generated/_client_factory.py b/src/portal/azext_portal/generated/_client_factory.py new file mode 100644 index 00000000000..da39dd7f9fb --- /dev/null +++ b/src/portal/azext_portal/generated/_client_factory.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def cf_portal(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from ..vendored_sdks.portal import Portal + return get_mgmt_service_client(cli_ctx, Portal) + + +def cf_dashboard(cli_ctx, *_): + return cf_portal(cli_ctx).dashboard diff --git a/src/portal/azext_portal/generated/_help.py b/src/portal/azext_portal/generated/_help.py new file mode 100644 index 00000000000..e702c567cbc --- /dev/null +++ b/src/portal/azext_portal/generated/_help.py @@ -0,0 +1,75 @@ +# -------------------------------------------------------------------------------------------- +# 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 + +from knack.help_files import helps + + +helps['portal dashboard'] = """ + type: group + short-summary: Manage portal dashboards +""" + +helps['portal dashboard list'] = """ + type: command + short-summary: Lists the dashboards within a subscription or resource group. + examples: + - name: List all dashboards in a resourceGroup + text: |- + az portal dashboard list --resource-group "testRG" + - name: List all dashboards in a subscription + text: |- + az portal dashboard list +""" + +helps['portal dashboard show'] = """ + type: command + short-summary: Gets details for a single dashboard. + examples: + - name: Get a Dashboard + text: |- + az portal dashboard show --name "testDashboard" --resource-group "testRG" +""" + +helps['portal dashboard create'] = """ + type: command + short-summary: Creates or updates a dashboard. + examples: + - name: Create or update a Dashboard + text: |- + az portal dashboard create --location "eastus" --name "testDashboard" \\ + --resource-group "testRG" --input-path "/src/json/properties.json" \\ + --tags aKey=aValue anotherKey=anotherValue +""" + +helps['portal dashboard update'] = """ + type: command + short-summary: Updates an existing dashboard. + examples: + - name: Update a Dashboard + text: |- + az portal dashboard update --name "testDashboard" --resource-group "testRG" \\ + --input-path "/src/json/properties.json" +""" + +helps['portal dashboard delete'] = """ + type: command + short-summary: Deletes a dashboard. + examples: + - name: Delete a Dashboard + text: |- + az portal dashboard delete --name "testDashboard" --resource-group "testRG" +""" + +helps['portal dashboard import'] = """ + type: command + short-summary: Imports a dashboard from a JSON file. + examples: + - name: Import a Dashboard + text: |- + az portal dashboard import --name "testDashboard" --resource-group "testRG" \\ + --input-path "/src/json/dashboard.json" +""" diff --git a/src/portal/azext_portal/generated/_params.py b/src/portal/azext_portal/generated/_params.py new file mode 100644 index 00000000000..e036901b70c --- /dev/null +++ b/src/portal/azext_portal/generated/_params.py @@ -0,0 +1,61 @@ +# -------------------------------------------------------------------------------------------- +# 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 argcomplete.completers import FilesCompleter +from azure.cli.core.commands.parameters import ( + tags_type, + resource_group_name_type, + get_location_type, + file_type +) +from azure.cli.core.commands.validators import get_default_location_from_resource_group + + +def load_arguments(self, _): + + with self.argument_context('portal dashboard list') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The name of the resource group.') + + with self.argument_context('portal dashboard show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('name', options_list=[ + '--name', '-n'], help='The name of the dashboard.') + + with self.argument_context('portal dashboard create') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The name of the resource group.') + c.argument('name', options_list=[ + '--name', '-n'], help='The name of the dashboard.') + c.argument('location', arg_type=get_location_type(self.cli_ctx), + validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + c.argument('input_path', type=file_type, + help='The path to the dashboard properties JSON file.', completer=FilesCompleter()) + + with self.argument_context('portal dashboard update') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The name of the resource group.') + c.argument('name', options_list=[ + '--name', '-n'], help='The name of the dashboard.') + c.argument('input_path', type=file_type, + help='The path to the dashboard properties JSON file.', completer=FilesCompleter()) + + with self.argument_context('portal dashboard delete') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The name of the resource group.') + c.argument('name', options_list=[ + '--name', '-n'], help='The name of the dashboard.') + + with self.argument_context('portal dashboard import') as c: + c.argument('resource_group_name', resource_group_name_type, + help='The name of the resource group.') + c.argument('name', options_list=[ + '--name', '-n'], help='The name of the dashboard.') + c.argument('input_path', type=file_type, + help='The path to the dashboard json file.', completer=FilesCompleter()) diff --git a/src/portal/azext_portal/generated/action.py b/src/portal/azext_portal/generated/action.py new file mode 100644 index 00000000000..d7d2d91da6b --- /dev/null +++ b/src/portal/azext_portal/generated/action.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=protected-access + +import argparse +from knack.util import CLIError + + +class AddMetadata(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.properties_metadata = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = dict(x.split('=', 1) for x in values) + except ValueError: + raise CLIError( + 'usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + v = properties[k] + d[k] = v + return d diff --git a/src/portal/azext_portal/generated/commands.py b/src/portal/azext_portal/generated/commands.py new file mode 100644 index 00000000000..937cd6d167a --- /dev/null +++ b/src/portal/azext_portal/generated/commands.py @@ -0,0 +1,25 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + with self.command_group('portal', is_experimental=True): + pass + + from azext_portal.generated._client_factory import cf_dashboard + portal_dashboard = CliCommandType( + operations_tmpl='azext_portal.vendored_sdks.portal.operations._dashboard_operations#DashboardOperations.{}', + client_factory=cf_dashboard) + with self.command_group('portal dashboard', portal_dashboard, client_factory=cf_dashboard) as g: + g.custom_command('list', 'portal_dashboard_list') + g.custom_show_command('show', 'portal_dashboard_show') + g.custom_command('create', 'portal_dashboard_create') + g.custom_command('update', 'portal_dashboard_update') + g.custom_command('delete', 'portal_dashboard_delete', + confirmation=True) + g.custom_command('import', 'portal_dashboard_import') diff --git a/src/portal/azext_portal/generated/custom.py b/src/portal/azext_portal/generated/custom.py new file mode 100644 index 00000000000..1d4557ac4ab --- /dev/null +++ b/src/portal/azext_portal/generated/custom.py @@ -0,0 +1,100 @@ +# -------------------------------------------------------------------------------------------- +# 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 + +import json +from knack.util import CLIError + + +def portal_dashboard_list(cmd, client, + resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def portal_dashboard_show(cmd, client, + resource_group_name, + name): + return client.get(resource_group_name=resource_group_name, dashboard_name=name) + + +def portal_dashboard_create(cmd, client, + resource_group_name, + name, + input_path, + location=None, + tags=None): + properties_lenses, properties_metadata = parse_properties_json(input_path) + return client.create_or_update(resource_group_name=resource_group_name, dashboard_name=name, location=location, tags=tags, lenses=properties_lenses, metadata=properties_metadata) + + +def portal_dashboard_update(cmd, client, + resource_group_name, + name, + input_path): + properties_lenses, properties_metadata = parse_properties_json(input_path) + return client.update(resource_group_name=resource_group_name, dashboard_name=name, lenses=properties_lenses, metadata=properties_metadata) + + +def portal_dashboard_delete(cmd, client, + resource_group_name, + name): + return client.delete(resource_group_name=resource_group_name, dashboard_name=name) + + +def portal_dashboard_import(cmd, client, + resource_group_name, + input_path, + name=None): + dashboard = parse_dashboard_json(input_path) + return client.dashboard_import(resource_group_name=resource_group_name, dashboard_name=dashboard.get('name', name), dashboard=dashboard) + + +def parse_properties_json(input_path): + try: + with open(input_path) as json_file: + try: + properties = json.load(json_file) + except json.decoder.JSONDecodeError as ex: + raise CLIError( + 'JSON decode error for {}: {}'.format(json_file, str(ex))) + if 'lenses' not in properties: + raise CLIError(str(json_file) + + " does not contain the property 'lenses'") + properties_lenses = properties['lenses'] + if 'metadata' not in properties: + raise CLIError(str(json_file) + + " does not contain the property 'metadata'") + properties_metadata = properties['metadata'] + return properties_lenses, properties_metadata + except FileNotFoundError as ex: + raise CLIError('File not Found: {}'.format(str(ex))) + + +def parse_dashboard_json(input_path): + try: + with open(input_path) as json_file: + try: + dashboard = json.load(json_file) + except json.decoder.JSONDecodeError as ex: + raise CLIError( + 'There was an error decoding the JSON file {}: {}'.format(json_file, str(ex))) + if 'location' not in dashboard: + raise CLIError(str(json_file) + + " does not contain the property 'location'") + if 'properties' not in dashboard: + raise CLIError(str(json_file) + + " does not contain the property 'properties'") + if 'lenses' not in dashboard['properties']: + raise CLIError( + str(json_file) + " does not contain the property 'lenses' in 'properties'") + if 'metadata' not in dashboard['properties']: + raise CLIError( + str(json_file) + " does not contain the property 'metadata' in 'properties'") + return dashboard + except FileNotFoundError as ex: + raise CLIError('File not Found: {}'.format(str(ex))) diff --git a/src/portal/azext_portal/tests/latest/__init__.py b/src/portal/azext_portal/tests/latest/__init__.py new file mode 100644 index 00000000000..34913fb394d --- /dev/null +++ b/src/portal/azext_portal/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/portal/azext_portal/tests/latest/dashboard.json b/src/portal/azext_portal/tests/latest/dashboard.json new file mode 100644 index 00000000000..c05eb79cd5b --- /dev/null +++ b/src/portal/azext_portal/tests/latest/dashboard.json @@ -0,0 +1,60 @@ +{ + "properties": { + "lenses": { + "0": { + "order": 0, + "parts": { + "0": { + "position": { + "x": 0, + "y": 0, + "colSpan": 6, + "rowSpan": 4 + }, + "metadata": { + "inputs": [ + { + "name": "resourceType", + "value": "Microsoft.Resources/subscriptions/resourcegroups", + "isOptional": true + }, + { + "name": "filter", + "isOptional": true + }, + { + "name": "scope", + "isOptional": true + }, + { + "name": "kind", + "isOptional": true + } + ], + "type": "Extension/HubsExtension/PartType/BrowseResourceGroupPinnedPart" + } + } + } + } + }, + "metadata": { + "model": { + "timeRange": { + "value": { + "relative": { + "duration": 24, + "timeUnit": 1 + } + }, + "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" + } + } + } + }, + "name": "7c0464ec-b1cd-4a98-a4a5-1ebe2d980260", + "type": "Microsoft.Portal/dashboards", + "location": "eastus", + "tags": { + "hidden-title": "test dashboard" + } +} \ No newline at end of file diff --git a/src/portal/azext_portal/tests/latest/preparers.py b/src/portal/azext_portal/tests/latest/preparers.py new file mode 100644 index 00000000000..1388cfd22cc --- /dev/null +++ b/src/portal/azext_portal/tests/latest/preparers.py @@ -0,0 +1,111 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +from datetime import datetime +from azure.cli.testsdk.preparers import NoTrafficRecordingPreparer +from azure_devtools.scenario_tests import SingleValueReplacer +from azure.cli.testsdk.exceptions import CliTestError +from azure.cli.testsdk.reverse_dependency import get_dummy_cli + + +KEY_RESOURCE_GROUP = 'rg' +KEY_VIRTUAL_NETWORK = 'vnet' +KEY_VNET_SUBNET = 'subnet' + + +class VirtualNetworkPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.vn', + parameter_name='virtual_network', + resource_group_name=None, + resource_group_key=KEY_RESOURCE_GROUP, + dev_setting_name='AZURE_CLI_TEST_DEV_VIRTUAL_NETWORK_NAME', + random_name_length=24, key=KEY_VIRTUAL_NETWORK): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VirtualNetworkPreparer, self).__init__( + name_prefix, random_name_length) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group_name = resource_group_name + self.resource_group_key = resource_group_key + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **kwargs): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group_name: + self.resource_group_name = self.test_class_instance.kwargs.get( + self.resource_group_key) + if not self.resource_group_name: + raise CliTestError("Error: No resource group configured!") + + tags = {'product': 'azurecli', 'cause': 'automation', + 'date': datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ')} + if 'ENV_JOB_NAME' in os.environ: + tags['job'] = os.environ['ENV_JOB_NAME'] + tags = ' '.join(['{}={}'.format(key, value) + for key, value in tags.items()]) + template = 'az network vnet create --resource-group {} --name {} --tag ' + tags + self.live_only_execute(self.cli_ctx, template.format( + self.resource_group_name, name)) + + self.test_class_instance.kwargs[self.key] = name + return {self.parameter_name: name} + + def remove_resource(self, name, **kwargs): + # delete vnet if test is being recorded and if the vnet is not a dev rg + if not self.dev_setting_name: + self.live_only_execute( + self.cli_ctx, 'az network vnet delete --name {} --resource-group {}'.format(name, self.resource_group_name)) + + +class VnetSubnetPreparer(NoTrafficRecordingPreparer, SingleValueReplacer): + def __init__(self, name_prefix='clitest.vn', + parameter_name='subnet', + resource_group_name=None, + resource_group_key=KEY_RESOURCE_GROUP, + vnet_name=None, + vnet_key=KEY_VIRTUAL_NETWORK, + address_prefixes="11.0.0.0/24", + dev_setting_name='AZURE_CLI_TEST_DEV_VNET_SUBNET_NAME', + random_name_length=24, key=KEY_VNET_SUBNET): + if ' ' in name_prefix: + raise CliTestError( + 'Error: Space character in name prefix \'%s\'' % name_prefix) + super(VnetSubnetPreparer, self).__init__( + name_prefix, random_name_length) + self.cli_ctx = get_dummy_cli() + self.parameter_name = parameter_name + self.key = key + self.resource_group_name = resource_group_name + self.resource_group_key = resource_group_key + self.vnet_name = vnet_name + self.vnet_key = vnet_key + self.address_prefixes = address_prefixes + self.dev_setting_name = os.environ.get(dev_setting_name, None) + + def create_resource(self, name, **kwargs): + if self.dev_setting_name: + return {self.parameter_name: self.dev_setting_name, } + + if not self.resource_group_name: + self.resource_group_name = self.test_class_instance.kwargs.get( + self.resource_group_key) + if not self.resource_group_name: + raise CliTestError("Error: No resource group configured!") + if not self.vnet_name: + self.vnet_name = self.test_class_instance.kwargs.get(self.vnet_key) + if not self.vnet_name: + raise CliTestError("Error: No vnet configured!") + + self.test_class_instance.kwargs[self.key] = 'default' + return {self.parameter_name: name} + + def remove_resource(self, name, **kwargs): + pass diff --git a/src/portal/azext_portal/tests/latest/properties-update.json b/src/portal/azext_portal/tests/latest/properties-update.json new file mode 100644 index 00000000000..2e3e9bd56d4 --- /dev/null +++ b/src/portal/azext_portal/tests/latest/properties-update.json @@ -0,0 +1,35 @@ +{ + "lenses": { + "0": { + "order": 0, + "parts": { + "0": { + "position": { + "x": 6, + "y": 2, + "colSpan": 2, + "rowSpan": 2 + }, + "metadata": { + "inputs": [], + "type": "Extension/HubsExtension/PartType/ClockPart", + "settings": {} + } + } + } + } + }, + "metadata": { + "model": { + "timeRange": { + "value": { + "relative": { + "duration": 12, + "timeUnit": 1 + } + }, + "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" + } + } + } +} \ No newline at end of file diff --git a/src/portal/azext_portal/tests/latest/properties.json b/src/portal/azext_portal/tests/latest/properties.json new file mode 100644 index 00000000000..212a8ead593 --- /dev/null +++ b/src/portal/azext_portal/tests/latest/properties.json @@ -0,0 +1,35 @@ +{ + "lenses": { + "0": { + "order": 0, + "parts": { + "0": { + "position": { + "x": 6, + "y": 2, + "colSpan": 2, + "rowSpan": 2 + }, + "metadata": { + "inputs": [], + "type": "Extension/HubsExtension/PartType/ClockPart", + "settings": {} + } + } + } + } + }, + "metadata": { + "model": { + "timeRange": { + "value": { + "relative": { + "duration": 24, + "timeUnit": 1 + } + }, + "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" + } + } + } +} \ No newline at end of file diff --git a/src/portal/azext_portal/tests/latest/recordings/test_portal.yaml b/src/portal/azext_portal/tests/latest/recordings/test_portal.yaml new file mode 100644 index 00000000000..3cc1fc56007 --- /dev/null +++ b/src/portal/azext_portal/tests/latest/recordings/test_portal.yaml @@ -0,0 +1,474 @@ +interactions: +- request: + body: '{"location": "eastus", "tags": {"aKey": "aValue", "anotherKey": "anotherValue"}, + "properties": {"lenses": {"0": {"order": 0, "parts": {"0": {"position": {"x": + 6, "y": 2, "rowSpan": 2, "colSpan": 2}, "metadata": {"inputs": [], "type": "Extension/HubsExtension/PartType/ClockPart", + "settings": {}}}}}}, "metadata": {"model": {"timeRange": {"value": {"relative": + {"duration": 24, "timeUnit": 1}}, "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - portal dashboard create + Connection: + - keep-alive + Content-Length: + - '466' + Content-Type: + - application/json + ParameterSetName: + - --location --input- --tags --name --resource-group + User-Agent: + - AZURECLI/2.3.1 azsdk-python-core/1.4.0 Python/3.8.1 (Windows-10-10.0.18362-SP0) + azsdk-python-portal/unknown + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Portal/dashboards/cli_test_000002?api-version=2019-01-01-preview + response: + body: + string: '{"properties":{"lenses":{"0":{"order":0,"parts":{"0":{"position":{"x":6,"y":2,"rowSpan":2,"colSpan":2},"metadata":{"inputs":[],"type":"Extension/HubsExtension/PartType/ClockPart","settings":{}}}}}},"metadata":{"model":{"timeRange":{"value":{"relative":{"duration":24,"timeUnit":1}},"type":"MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"}}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Portal/dashboards/cli_test_000002","name":"cli_test_000002","type":"Microsoft.Portal/dashboards","location":"eastus","tags":{"aKey":"aValue","anotherKey":"anotherValue"}}' + headers: + cache-control: + - no-cache + content-length: + - '710' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 24 Apr 2020 02:50:25 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - browserId=83f1c12d-bc20-4970-85d6-f2f21201065e; domain=portal.azure.com; path=/; + secure; HttpOnly + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-dashboard-session: + - 0:-1#2310549 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-ms-version: + - 5.0.303.3324 (production_htfx#4e36611bb5.200415-0501) Signed + x-ua-compatible: + - IE=edge + x-xss-protection: + - 1; mode=block + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - portal dashboard show + Connection: + - keep-alive + ParameterSetName: + - --name --resource-group + User-Agent: + - AZURECLI/2.3.1 azsdk-python-core/1.4.0 Python/3.8.1 (Windows-10-10.0.18362-SP0) + azsdk-python-portal/unknown + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Portal/dashboards/cli_test_000002?api-version=2019-01-01-preview + response: + body: + string: '{"properties":{"lenses":{"0":{"order":0,"parts":{"0":{"position":{"x":6,"y":2,"rowSpan":2,"colSpan":2},"metadata":{"inputs":[],"type":"Extension/HubsExtension/PartType/ClockPart","settings":{}}}}}},"metadata":{"model":{"timeRange":{"value":{"relative":{"duration":24,"timeUnit":1}},"type":"MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"}}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Portal/dashboards/cli_test_000002","name":"cli_test_000002","type":"Microsoft.Portal/dashboards","location":"eastus","tags":{"aKey":"aValue","anotherKey":"anotherValue"}}' + headers: + cache-control: + - no-cache + content-length: + - '710' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 24 Apr 2020 02:50:25 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - browserId=364ac29d-a19d-4ef7-b9ae-d8ae7c54d3de; domain=portal.azure.com; path=/; + secure; HttpOnly + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-version: + - 5.0.303.3324 (production_htfx#4e36611bb5.200415-0501) Signed + x-ua-compatible: + - IE=edge + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - portal dashboard list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.3.1 azsdk-python-core/1.4.0 Python/3.8.1 (Windows-10-10.0.18362-SP0) + azsdk-python-portal/unknown + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Portal/dashboards?api-version=2019-01-01-preview + response: + body: + string: '{"value":[{"properties":{"lenses":{"0":{"order":0,"parts":{"0":{"position":{"x":6,"y":2,"rowSpan":2,"colSpan":2},"metadata":{"inputs":[],"type":"Extension/HubsExtension/PartType/ClockPart","settings":{}}}}}},"metadata":{"model":{"timeRange":{"value":{"relative":{"duration":24,"timeUnit":1}},"type":"MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"}}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Portal/dashboards/cli_test_000002","name":"cli_test_000002","type":"Microsoft.Portal/dashboards","location":"eastus","tags":{"aKey":"aValue","anotherKey":"anotherValue"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '722' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 24 Apr 2020 02:50:25 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - browserId=d2b94eb9-1c67-46fb-aadc-7cdcd6677c72; domain=portal.azure.com; path=/; + secure; HttpOnly + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-version: + - 5.0.303.3324 (production_htfx#4e36611bb5.200415-0501) Signed + x-ua-compatible: + - IE=edge + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - portal dashboard list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.3.1 azsdk-python-core/1.4.0 Python/3.8.1 (Windows-10-10.0.18362-SP0) + azsdk-python-portal/unknown + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Portal/dashboards?api-version=2019-01-01-preview + response: + body: + string: '{"value":[{"properties":{"lenses":{"0":{"order":0,"parts":{"0":{"position":{"x":0,"y":1,"rowSpan":4,"colSpan":6},"metadata":{"inputs":[{"name":"resourceType","value":"Microsoft.Resources/subscriptions/resourcegroups","isOptional":true},{"name":"filter","isOptional":true},{"name":"scope","isOptional":true},{"name":"kind","isOptional":true}],"type":"Extension/HubsExtension/PartType/BrowseResourceGroupPinnedPart"}},"1":{"position":{"x":6,"y":2,"rowSpan":2,"colSpan":2},"metadata":{"inputs":[],"type":"Extension/HubsExtension/PartType/ClockPart","settings":{}}}}}},"metadata":{"model":{"timeRange":{"value":{"relative":{"duration":24,"timeUnit":1}},"type":"MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"}}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yalin-rg/providers/Microsoft.Portal/dashboards/mydashboard","name":"mydashboard","type":"Microsoft.Portal/dashboards","location":"eastus"},{"properties":{"lenses":{"0":{"order":0,"parts":{"0":{"position":{"x":0,"y":0,"rowSpan":4,"colSpan":6},"metadata":{"inputs":[{"name":"resourceType","value":"Microsoft.Resources/subscriptions/resourcegroups","isOptional":true},{"name":"filter","isOptional":true},{"name":"scope","isOptional":true},{"name":"kind","isOptional":true}],"type":"Extension/HubsExtension/PartType/BrowseResourceGroupPinnedPart"}}}}},"metadata":{"model":{"timeRange":{"value":{"relative":{"duration":24,"timeUnit":1}},"type":"MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"}}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yalin-rg/providers/Microsoft.Portal/dashboards/testdashboard","name":"testdashboard","type":"Microsoft.Portal/dashboards","location":"eastus","tags":{"hidden-title":"test + dashboard"}},{"properties":{"lenses":{"0":{"order":0,"parts":{"0":{"position":{"x":6,"y":2,"rowSpan":2,"colSpan":2},"metadata":{"inputs":[],"type":"Extension/HubsExtension/PartType/ClockPart","settings":{}}}}}},"metadata":{"model":{"timeRange":{"value":{"relative":{"duration":24,"timeUnit":1}},"type":"MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"}}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dashboards/providers/Microsoft.Portal/dashboards/testa","name":"testa","type":"Microsoft.Portal/dashboards","location":"eastus"},{"properties":{"lenses":{"0":{"order":0,"parts":{"0":{"position":{"x":0,"y":0,"rowSpan":4,"colSpan":6},"metadata":{"inputs":[{"name":"resourceType","value":"Microsoft.Resources/subscriptions/resourcegroups","isOptional":true},{"name":"filter","isOptional":true},{"name":"scope","isOptional":true},{"name":"kind","isOptional":true}],"type":"Extension/HubsExtension/PartType/BrowseResourceGroupPinnedPart"}}}}},"metadata":{"model":{"timeRange":{"value":{"relative":{"duration":24,"timeUnit":1}},"type":"MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"}}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/yalin-rg/providers/Microsoft.Portal/dashboards/7c0464ec-b1cd-4a98-a4a5-1ebe2d980260","name":"7c0464ec-b1cd-4a98-a4a5-1ebe2d980260","type":"Microsoft.Portal/dashboards","location":"eastus","tags":{"hidden-title":"test + dashboard"}},{"properties":{"lenses":{"0":{"order":0,"parts":{"0":{"position":{"x":6,"y":2,"rowSpan":2,"colSpan":2},"metadata":{"inputs":[],"type":"Extension/HubsExtension/PartType/ClockPart","settings":{}}}}}},"metadata":{"model":{"timeRange":{"value":{"relative":{"duration":24,"timeUnit":1}},"type":"MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"}}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Portal/dashboards/cli_test_000002","name":"cli_test_000002","type":"Microsoft.Portal/dashboards","location":"eastus","tags":{"aKey":"aValue","anotherKey":"anotherValue"}}]}' + headers: + cache-control: + - no-cache + content-length: + - '3887' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 24 Apr 2020 02:50:26 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - browserId=1780b2bd-c6cd-48e7-901c-bd978535696a; domain=portal.azure.com; path=/; + secure; HttpOnly + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-version: + - 5.0.303.3324 (production_htfx#4e36611bb5.200415-0501) Signed + x-ua-compatible: + - IE=edge + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"properties": {"lenses": {"0": {"order": 0, "parts": {"0": {"position": + {"x": 6, "y": 2, "rowSpan": 2, "colSpan": 2}, "metadata": {"inputs": [], "type": + "Extension/HubsExtension/PartType/ClockPart", "settings": {}}}}}}, "metadata": + {"model": {"timeRange": {"value": {"relative": {"duration": 12, "timeUnit": + 1}}, "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - portal dashboard update + Connection: + - keep-alive + Content-Length: + - '386' + Content-Type: + - application/json + ParameterSetName: + - --input-path --name --resource-group + User-Agent: + - AZURECLI/2.3.1 azsdk-python-core/1.4.0 Python/3.8.1 (Windows-10-10.0.18362-SP0) + azsdk-python-portal/unknown + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Portal/dashboards/cli_test_000002?api-version=2019-01-01-preview + response: + body: + string: '{"properties":{"lenses":{"0":{"order":0,"parts":{"0":{"position":{"x":6,"y":2,"rowSpan":2,"colSpan":2},"metadata":{"inputs":[],"type":"Extension/HubsExtension/PartType/ClockPart","settings":{}}}}}},"metadata":{"model":{"timeRange":{"value":{"relative":{"duration":12,"timeUnit":1}},"type":"MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"}}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Portal/dashboards/cli_test_000002","name":"cli_test_000002","type":"Microsoft.Portal/dashboards","location":"eastus","tags":{"aKey":"aValue","anotherKey":"anotherValue"}}' + headers: + cache-control: + - no-cache + content-length: + - '710' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 24 Apr 2020 02:50:27 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - browserId=b2d167fe-014c-4a1b-a700-dee719204b4b; domain=portal.azure.com; path=/; + secure; HttpOnly + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-dashboard-session: + - 0:-1#2310550 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-ms-version: + - 5.0.303.3324 (production_htfx#4e36611bb5.200415-0501) Signed + x-ua-compatible: + - IE=edge + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - portal dashboard delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name --resource-group --y + User-Agent: + - AZURECLI/2.3.1 azsdk-python-core/1.4.0 Python/3.8.1 (Windows-10-10.0.18362-SP0) + azsdk-python-portal/unknown + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Portal/dashboards/cli_test_000002?api-version=2019-01-01-preview + response: + body: + string: 'null' + headers: + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 24 Apr 2020 02:50:28 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - browserId=7f645dd7-79f7-4ac8-81ef-dd59a2c9cc42; domain=portal.azure.com; path=/; + secure; HttpOnly + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-dashboard-session: + - 0:-1#2310551 + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-ms-version: + - 5.0.303.3324 (production_htfx#4e36611bb5.200415-0501) Signed + x-ua-compatible: + - IE=edge + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - portal dashboard list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - AZURECLI/2.3.1 azsdk-python-core/1.4.0 Python/3.8.1 (Windows-10-10.0.18362-SP0) + azsdk-python-portal/unknown + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Portal/dashboards?api-version=2019-01-01-preview + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 24 Apr 2020 02:50:29 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - browserId=3f42a1ee-b7e4-481d-a4bf-e1c935fea3d1; domain=portal.azure.com; path=/; + secure; HttpOnly + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-version: + - 5.0.303.3324 (production_htfx#4e36611bb5.200415-0501) Signed + x-ua-compatible: + - IE=edge + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus", "tags": {"hidden-title": "test dashboard"}, "properties": + {"lenses": {"0": {"order": 0, "parts": {"0": {"position": {"x": 0, "y": 0, "rowSpan": + 4, "colSpan": 6}, "metadata": {"inputs": [{"name": "resourceType", "value": + "Microsoft.Resources/subscriptions/resourcegroups", "isOptional": true}, {"name": + "filter", "isOptional": true}, {"name": "scope", "isOptional": true}, {"name": + "kind", "isOptional": true}], "type": "Extension/HubsExtension/PartType/BrowseResourceGroupPinnedPart"}}}}}, + "metadata": {"model": {"timeRange": {"value": {"relative": {"duration": 24, + "timeUnit": 1}}, "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"}}}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - portal dashboard import + Connection: + - keep-alive + Content-Length: + - '678' + Content-Type: + - application/json + ParameterSetName: + - --input-path --name --resource-group + User-Agent: + - AZURECLI/2.3.1 azsdk-python-core/1.4.0 Python/3.8.1 (Windows-10-10.0.18362-SP0) + azsdk-python-portal/unknown + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Portal/dashboards/7c0464ec-b1cd-4a98-a4a5-1ebe2d980260?api-version=2019-01-01-preview + response: + body: + string: '{"properties":{"lenses":{"0":{"order":0,"parts":{"0":{"position":{"x":0,"y":0,"rowSpan":4,"colSpan":6},"metadata":{"inputs":[{"name":"resourceType","value":"Microsoft.Resources/subscriptions/resourcegroups","isOptional":true},{"name":"filter","isOptional":true},{"name":"scope","isOptional":true},{"name":"kind","isOptional":true}],"type":"Extension/HubsExtension/PartType/BrowseResourceGroupPinnedPart"}}}}},"metadata":{"model":{"timeRange":{"value":{"relative":{"duration":24,"timeUnit":1}},"type":"MsPortalFx.Composition.Configuration.ValueTypes.TimeRange"}}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_000001/providers/Microsoft.Portal/dashboards/7c0464ec-b1cd-4a98-a4a5-1ebe2d980260","name":"7c0464ec-b1cd-4a98-a4a5-1ebe2d980260","type":"Microsoft.Portal/dashboards","location":"eastus","tags":{"hidden-title":"test + dashboard"}}' + headers: + cache-control: + - no-cache + content-length: + - '933' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 24 Apr 2020 02:50:29 GMT + expires: + - '-1' + pragma: + - no-cache + set-cookie: + - browserId=9a1cc8f4-5d86-4be9-a931-fcb526b59b17; domain=portal.azure.com; path=/; + secure; HttpOnly + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-dashboard-session: + - 0:-1#2310552 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-ms-version: + - 5.0.303.3324 (production_htfx#4e36611bb5.200415-0501) Signed + x-ua-compatible: + - IE=edge + x-xss-protection: + - 1; mode=block + status: + code: 201 + message: Created +version: 1 diff --git a/src/portal/azext_portal/tests/latest/test_portal_scenario.py b/src/portal/azext_portal/tests/latest/test_portal_scenario.py new file mode 100644 index 00000000000..314740bbbe6 --- /dev/null +++ b/src/portal/azext_portal/tests/latest/test_portal_scenario.py @@ -0,0 +1,111 @@ +# -------------------------------------------------------------------------------------------- +# 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 JMESPathCheck +from azure.cli.testsdk import JMESPathCheckExists +from azure.cli.testsdk import NoneCheck +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class PortalScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_portal_testRG'[:9], key='rg') + def test_portal(self, resource_group): + + self.kwargs.update({ + 'testDashboard': self.create_random_name(prefix='cli_test_dashboards'[:9], length=24) + }) + + self.cmd('az portal dashboard create ' + '--location "eastus" ' + '--input- "src/portal/azext_portal/tests/latest/properties.json" ' + '--tags aKey=aValue anotherKey=anotherValue ' + '--name "{testDashboard}" ' + '--resource-group "{rg}"', + checks=[JMESPathCheck('name', self.kwargs.get('testDashboard', ''))]) + + self.cmd('az portal dashboard show ' + '--name "{testDashboard}" ' + '--resource-group "{rg}"', + checks=[ + JMESPathCheck('name', self.kwargs.get( + 'testDashboard', '')), + JMESPathCheck('resourceGroup', self.kwargs.get('rg', '')), + JMESPathCheck( + 'tags', '{\'aKey\': \'aValue\', \'anotherKey\': \'anotherValue\'}'), + JMESPathCheck('lenses', '{\'0\': {\'metadata\': None, \'order\': 0, \'parts\': ' + '{\'0\': {\'metadata\': {\'inputs\': [], \'settings\': {}, \'type\': ' + '\'Extension/HubsExtension/PartType/ClockPart\'}, \'position\': {\'colSpan\': 2, ' + '\'metadata\': None, \'rowSpan\': 2, \'x\': 6, \'y\': 2}}}}}'), + JMESPathCheck('metadata', '{\'model\': {\'timeRange\': {\'type\': ' + '\'MsPortalFx.Composition.Configuration.ValueTypes.TimeRange\', \'value\': ' + '{\'relative\': {\'duration\': 24, \'timeUnit\': 1}}}}}')]) + + self.cmd('az portal dashboard list ' + '--resource-group "{rg}"', + checks=[JMESPathCheckExists('[?name==\'{}\']'.format(self.kwargs.get('testDashboard', '')))]) + + self.cmd('az portal dashboard list ' + '--resource-group=', + checks=[JMESPathCheckExists('[?name==\'{}\']'.format(self.kwargs.get('testDashboard', '')))]) + + self.cmd('az portal dashboard update ' + '--input-path "src/portal/azext_portal/tests/latest/properties-update.json" ' + '--name "{testDashboard}" ' + '--resource-group "{rg}"', + checks=[ + JMESPathCheck('name', self.kwargs.get( + 'testDashboard', '')), + JMESPathCheck('resourceGroup', self.kwargs.get('rg', '')), + JMESPathCheck( + 'tags', '{\'aKey\': \'aValue\', \'anotherKey\': \'anotherValue\'}'), + JMESPathCheck('lenses', '{\'0\': {\'metadata\': None, \'order\': 0, \'parts\': ' + '{\'0\': {\'metadata\': {\'inputs\': [], \'settings\': {}, \'type\': ' + '\'Extension/HubsExtension/PartType/ClockPart\'}, \'position\': {\'colSpan\': 2, ' + '\'metadata\': None, \'rowSpan\': 2, \'x\': 6, \'y\': 2}}}}}'), + JMESPathCheck('metadata', '{\'model\': {\'timeRange\': {\'type\': ' + '\'MsPortalFx.Composition.Configuration.ValueTypes.TimeRange\', \'value\': ' + '{\'relative\': {\'duration\': 12, \'timeUnit\': 1}}}}}')]) + + self.cmd('az portal dashboard delete ' + '--name "{testDashboard}" ' + '--resource-group "{rg}" ' + '--y', + checks=[]) + + self.cmd('az portal dashboard list ' + '--resource-group "{rg}"', + checks=[NoneCheck()]) + + self.cmd('az portal dashboard import ' + '--input-path "src/portal/azext_portal/tests/latest/dashboard.json" ' + '--name "{testDashboard}" ' + '--resource-group "{rg}"', + checks=[ + JMESPathCheck( + 'name', '7c0464ec-b1cd-4a98-a4a5-1ebe2d980260'), + JMESPathCheck('resourceGroup', self.kwargs.get('rg', '')), + JMESPathCheck('location', 'eastus'), + JMESPathCheck('type', 'Microsoft.Portal/dashboards'), + JMESPathCheck( + 'tags', '{\'hidden-title\': \'test dashboard\'}'), + JMESPathCheck('lenses', '{\'0\': {\'metadata\': None, \'order\': 0, \'parts\': ' + '{\'0\': {\'metadata\': {\'inputs\': [{\'isOptional\': True, \'name\': ' + '\'resourceType\', \'value\': \'Microsoft.Resources/subscriptions/resourcegroups\'},' + ' {\'isOptional\': True, \'name\': \'filter\'}, {\'isOptional\': True, \'name\':' + ' \'scope\'}, {\'isOptional\': True, \'name\': \'kind\'}], \'type\': ' + '\'Extension/HubsExtension/PartType/BrowseResourceGroupPinnedPart\'}, \'position\': ' + '{\'colSpan\': 6, \'metadata\': None, \'rowSpan\': 4, \'x\': 0, \'y\': 0}}}}}'), + JMESPathCheck('metadata', '{\'model\': {\'timeRange\': {\'type\': ' + '\'MsPortalFx.Composition.Configuration.ValueTypes.TimeRange\', \'value\': ' + '{\'relative\': {\'duration\': 24, \'timeUnit\': 1}}}}}')]) diff --git a/src/portal/azext_portal/vendored_sdks/__init__.py b/src/portal/azext_portal/vendored_sdks/__init__.py new file mode 100644 index 00000000000..be1a152630c --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/src/portal/azext_portal/vendored_sdks/portal/__init__.py b/src/portal/azext_portal/vendored_sdks/portal/__init__.py new file mode 100644 index 00000000000..a2795e0ed3f --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/portal/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._portal import Portal +__all__ = ['Portal'] diff --git a/src/portal/azext_portal/vendored_sdks/portal/_configuration.py b/src/portal/azext_portal/vendored_sdks/portal/_configuration.py new file mode 100644 index 00000000000..69420dd4e61 --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/portal/_configuration.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +VERSION = "unknown" + +class PortalConfiguration(Configuration): + """Configuration for Portal + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(PortalConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2019-01-01-preview" + self._configure(**kwargs) + self.user_agent_policy.add_user_agent('azsdk-python-portal/{}'.format(VERSION)) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, **kwargs) diff --git a/src/portal/azext_portal/vendored_sdks/portal/_portal.py b/src/portal/azext_portal/vendored_sdks/portal/_portal.py new file mode 100644 index 00000000000..1ca59444489 --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/portal/_portal.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.core import PipelineClient +from msrest import Deserializer, Serializer + +from ._configuration import PortalConfiguration +from .operations import OperationOperations +from .operations import DashboardOperations +from . import models + + +class Portal(object): + """Allows creation and deletion of Azure Shared Dashboards. + + :ivar operation: OperationOperations operations + :vartype operation: portal.operations.OperationOperations + :ivar dashboard: DashboardOperations operations + :vartype dashboard: portal.operations.DashboardOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = PortalConfiguration(credential, subscription_id, **kwargs) + self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dashboard = DashboardOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> Portal + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/portal/azext_portal/vendored_sdks/portal/aio/__init__.py b/src/portal/azext_portal/vendored_sdks/portal/aio/__init__.py new file mode 100644 index 00000000000..508cf5a4695 --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/portal/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._portal_async import Portal +__all__ = ['Portal'] diff --git a/src/portal/azext_portal/vendored_sdks/portal/aio/_configuration_async.py b/src/portal/azext_portal/vendored_sdks/portal/aio/_configuration_async.py new file mode 100644 index 00000000000..f696a3c65d2 --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/portal/aio/_configuration_async.py @@ -0,0 +1,58 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +VERSION = "unknown" + +class PortalConfiguration(Configuration): + """Configuration for Portal + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(PortalConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2019-01-01-preview" + self._configure(**kwargs) + self.user_agent_policy.add_user_agent('azsdk-python-portal/{}'.format(VERSION)) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, **kwargs) diff --git a/src/portal/azext_portal/vendored_sdks/portal/aio/_portal_async.py b/src/portal/azext_portal/vendored_sdks/portal/aio/_portal_async.py new file mode 100644 index 00000000000..878f1ca00ae --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/portal/aio/_portal_async.py @@ -0,0 +1,63 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.core import AsyncPipelineClient +from msrest import Deserializer, Serializer + +from ._configuration_async import PortalConfiguration +from .operations_async import OperationOperations +from .operations_async import DashboardOperations +from .. import models + + +class Portal(object): + """Allows creation and deletion of Azure Shared Dashboards. + + :ivar operation: OperationOperations operations + :vartype operation: portal.aio.operations_async.OperationOperations + :ivar dashboard: DashboardOperations operations + :vartype dashboard: portal.aio.operations_async.DashboardOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: azure.core.credentials.TokenCredential + :param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = PortalConfiguration(credential, subscription_id, **kwargs) + self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operation = OperationOperations( + self._client, self._config, self._serialize, self._deserialize) + self.dashboard = DashboardOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "Portal": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/portal/azext_portal/vendored_sdks/portal/aio/operations_async/__init__.py b/src/portal/azext_portal/vendored_sdks/portal/aio/operations_async/__init__.py new file mode 100644 index 00000000000..1511df6e3b9 --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/portal/aio/operations_async/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operation_operations_async import OperationOperations +from ._dashboard_operations_async import DashboardOperations + +__all__ = [ + 'OperationOperations', + 'DashboardOperations', +] diff --git a/src/portal/azext_portal/vendored_sdks/portal/aio/operations_async/_dashboard_operations_async.py b/src/portal/azext_portal/vendored_sdks/portal/aio/operations_async/_dashboard_operations_async.py new file mode 100644 index 00000000000..000cbf46828 --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/portal/aio/operations_async/_dashboard_operations_async.py @@ -0,0 +1,422 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DashboardOperations: + """DashboardOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~portal.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def create_or_update( + self, + resource_group_name: str, + dashboard_name: str, + location: str, + tags: Optional[Dict[str, str]] = None, + lenses: Optional[Dict[str, "DashboardLens"]] = None, + metadata: Optional[Dict[str, object]] = None, + **kwargs + ) -> "models.Dashboard": + """Creates or updates a Dashboard. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dashboard_name: The name of the dashboard. + :type dashboard_name: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param lenses: The dashboard lenses. + :type lenses: dict[str, ~portal.models.DashboardLens] + :param metadata: The dashboard metadata. + :type metadata: dict[str, object] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Dashboard or Dashboard or the result of cls(response) + :rtype: ~portal.models.Dashboard or ~portal.models.Dashboard + :raises: ~portal.models.ErrorResponseException: + """ + cls: ClsType["models.Dashboard"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + + dashboard = models.Dashboard(location=location, tags=tags, lenses=lenses, metadata=metadata) + api_version = "2019-01-01-preview" + + # 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'), + 'dashboardName': self._serialize.url("dashboard_name", dashboard_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(dashboard, 'Dashboard') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Dashboard', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Dashboard', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}'} + + async def delete( + self, + resource_group_name: str, + dashboard_name: str, + **kwargs + ) -> None: + """Deletes the Dashboard. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dashboard_name: The name of the dashboard. + :type dashboard_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~portal.models.ErrorResponseException: + """ + cls: ClsType[None] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-01-01-preview" + + # 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'), + 'dashboardName': self._serialize.url("dashboard_name", dashboard_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}'} + + async def get( + self, + resource_group_name: str, + dashboard_name: str, + **kwargs + ) -> "models.Dashboard": + """Gets the Dashboard. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dashboard_name: The name of the dashboard. + :type dashboard_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Dashboard or the result of cls(response) + :rtype: ~portal.models.Dashboard + :raises: ~portal.models.ErrorResponseException: + """ + cls: ClsType["models.Dashboard"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-01-01-preview" + + # 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'), + 'dashboardName': self._serialize.url("dashboard_name", dashboard_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + deserialized = self._deserialize('Dashboard', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}'} + + async def update( + self, + resource_group_name: str, + dashboard_name: str, + tags: Optional[Dict[str, str]] = None, + lenses: Optional[Dict[str, "DashboardLens"]] = None, + metadata: Optional[Dict[str, object]] = None, + **kwargs + ) -> "models.Dashboard": + """Updates an existing Dashboard. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dashboard_name: The name of the dashboard. + :type dashboard_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param lenses: The dashboard lenses. + :type lenses: dict[str, ~portal.models.DashboardLens] + :param metadata: The dashboard metadata. + :type metadata: dict[str, object] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Dashboard or the result of cls(response) + :rtype: ~portal.models.Dashboard + :raises: ~portal.models.ErrorResponseException: + """ + cls: ClsType["models.Dashboard"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + + dashboard = models.PatchableDashboard(tags=tags, lenses=lenses, metadata=metadata) + api_version = "2019-01-01-preview" + + # 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'), + 'dashboardName': self._serialize.url("dashboard_name", dashboard_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(dashboard, 'PatchableDashboard') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + deserialized = self._deserialize('Dashboard', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}'} + + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs + ) -> "models.DashboardListResult": + """Gets all the Dashboards within a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DashboardListResult or the result of cls(response) + :rtype: ~portal.models.DashboardListResult + :raises: ~portal.models.ErrorResponseException: + """ + cls: ClsType["models.DashboardListResult"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-01-01-preview" + + def prepare_request(next_link=None): + if not next_link: + # 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'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DashboardListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards'} + + def list_by_subscription( + self, + **kwargs + ) -> "models.DashboardListResult": + """Gets all the dashboards within a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DashboardListResult or the result of cls(response) + :rtype: ~portal.models.DashboardListResult + :raises: ~portal.models.ErrorResponseException: + """ + cls: ClsType["models.DashboardListResult"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-01-01-preview" + + def prepare_request(next_link=None): + if not next_link: + # 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) + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('DashboardListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Portal/dashboards'} diff --git a/src/portal/azext_portal/vendored_sdks/portal/aio/operations_async/_operation_operations_async.py b/src/portal/azext_portal/vendored_sdks/portal/aio/operations_async/_operation_operations_async.py new file mode 100644 index 00000000000..aebe6bdf31d --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/portal/aio/operations_async/_operation_operations_async.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations: + """OperationOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~portal.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs + ) -> "models.ResourceProviderOperationList": + """The Microsoft Portal operations API. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceProviderOperationList or the result of cls(response) + :rtype: ~portal.models.ResourceProviderOperationList + :raises: ~portal.models.ErrorResponseException: + """ + cls: ClsType["models.ResourceProviderOperationList"] = kwargs.pop('cls', None ) + error_map = kwargs.pop('error_map', {}) + api_version = "2019-01-01-preview" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters: Dict[str, Any] = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters: Dict[str, Any] = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Portal/operations'} diff --git a/src/portal/azext_portal/vendored_sdks/portal/models/__init__.py b/src/portal/azext_portal/vendored_sdks/portal/models/__init__.py new file mode 100644 index 00000000000..84909621e71 --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/portal/models/__init__.py @@ -0,0 +1,49 @@ +# 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 Dashboard + from ._models_py3 import DashboardLens + from ._models_py3 import DashboardListResult + from ._models_py3 import DashboardParts + from ._models_py3 import DashboardPartsPosition + from ._models_py3 import DashboardProperties + from ._models_py3 import ErrorDefinition + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import PatchableDashboard + from ._models_py3 import ResourceProviderOperation + from ._models_py3 import ResourceProviderOperationDisplay + from ._models_py3 import ResourceProviderOperationList +except (SyntaxError, ImportError): + from ._models import Dashboard # type: ignore + from ._models import DashboardLens # type: ignore + from ._models import DashboardListResult # type: ignore + from ._models import DashboardParts # type: ignore + from ._models import DashboardPartsPosition # type: ignore + from ._models import DashboardProperties # type: ignore + from ._models import ErrorDefinition # type: ignore + from ._models import ErrorResponse, ErrorResponseException # type: ignore + from ._models import PatchableDashboard # type: ignore + from ._models import ResourceProviderOperation # type: ignore + from ._models import ResourceProviderOperationDisplay # type: ignore + from ._models import ResourceProviderOperationList # type: ignore + +__all__ = [ + 'Dashboard', + 'DashboardLens', + 'DashboardListResult', + 'DashboardParts', + 'DashboardPartsPosition', + 'DashboardProperties', + 'ErrorDefinition', + 'ErrorResponse', 'ErrorResponseException', + 'PatchableDashboard', + 'ResourceProviderOperation', + 'ResourceProviderOperationDisplay', + 'ResourceProviderOperationList', +] diff --git a/src/portal/azext_portal/vendored_sdks/portal/models/_models.py b/src/portal/azext_portal/vendored_sdks/portal/models/_models.py new file mode 100644 index 00000000000..bc70d849819 --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/portal/models/_models.py @@ -0,0 +1,405 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Dashboard(msrest.serialization.Model): + """The shared dashboard resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param lenses: The dashboard lenses. + :type lenses: dict[str, ~portal.models.DashboardLens] + :param metadata: The dashboard metadata. + :type metadata: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + 'lenses': {'key': 'properties.lenses', 'type': '{DashboardLens}'}, + 'metadata': {'key': 'properties.metadata', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(Dashboard, 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.lenses = kwargs.get('lenses', None) + self.metadata = kwargs.get('metadata', None) + + +class DashboardLens(msrest.serialization.Model): + """A dashboard lens. + + All required parameters must be populated in order to send to Azure. + + :param order: Required. The lens order. + :type order: int + :param parts: Required. The dashboard parts. + :type parts: dict[str, ~portal.models.DashboardParts] + :param metadata: The dashboard len's metadata. + :type metadata: dict[str, object] + """ + + _validation = { + 'order': {'required': True}, + 'parts': {'required': True}, + } + + _attribute_map = { + 'order': {'key': 'order', 'type': 'int'}, + 'parts': {'key': 'parts', 'type': '{DashboardParts}'}, + 'metadata': {'key': 'metadata', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(DashboardLens, self).__init__(**kwargs) + self.order = kwargs.get('order', None) + self.parts = kwargs.get('parts', None) + self.metadata = kwargs.get('metadata', None) + + +class DashboardListResult(msrest.serialization.Model): + """List of dashboards. + + :param value: The array of custom resource provider manifests. + :type value: list[~portal.models.Dashboard] + :param next_link: The URL to use for getting the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Dashboard]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DashboardListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class DashboardParts(msrest.serialization.Model): + """A dashboard part. + + All required parameters must be populated in order to send to Azure. + + :param position: Required. The dashboard's part position. + :type position: ~portal.models.DashboardPartsPosition + :param metadata: The dashboard part's metadata. + :type metadata: dict[str, object] + """ + + _validation = { + 'position': {'required': True}, + } + + _attribute_map = { + 'position': {'key': 'position', 'type': 'DashboardPartsPosition'}, + 'metadata': {'key': 'metadata', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(DashboardParts, self).__init__(**kwargs) + self.position = kwargs.get('position', None) + self.metadata = kwargs.get('metadata', None) + + +class DashboardPartsPosition(msrest.serialization.Model): + """The dashboard's part position. + + All required parameters must be populated in order to send to Azure. + + :param x: Required. The dashboard's part x coordinate. + :type x: int + :param y: Required. The dashboard's part y coordinate. + :type y: int + :param row_span: Required. The dashboard's part row span. + :type row_span: int + :param col_span: Required. The dashboard's part column span. + :type col_span: int + :param metadata: The dashboard part's metadata. + :type metadata: dict[str, object] + """ + + _validation = { + 'x': {'required': True}, + 'y': {'required': True}, + 'row_span': {'required': True}, + 'col_span': {'required': True}, + } + + _attribute_map = { + 'x': {'key': 'x', 'type': 'int'}, + 'y': {'key': 'y', 'type': 'int'}, + 'row_span': {'key': 'rowSpan', 'type': 'int'}, + 'col_span': {'key': 'colSpan', 'type': 'int'}, + 'metadata': {'key': 'metadata', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(DashboardPartsPosition, self).__init__(**kwargs) + self.x = kwargs.get('x', None) + self.y = kwargs.get('y', None) + self.row_span = kwargs.get('row_span', None) + self.col_span = kwargs.get('col_span', None) + self.metadata = kwargs.get('metadata', None) + + +class DashboardProperties(msrest.serialization.Model): + """The shared dashboard properties. + + :param lenses: The dashboard lenses. + :type lenses: dict[str, ~portal.models.DashboardLens] + :param metadata: The dashboard metadata. + :type metadata: dict[str, object] + """ + + _attribute_map = { + 'lenses': {'key': 'lenses', 'type': '{DashboardLens}'}, + 'metadata': {'key': 'metadata', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(DashboardProperties, self).__init__(**kwargs) + self.lenses = kwargs.get('lenses', None) + self.metadata = kwargs.get('metadata', None) + + +class ErrorDefinition(msrest.serialization.Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Service specific error code which serves as the substatus for the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: list[~portal.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None + + +class ErrorResponseException(HttpResponseError): + """Server responded with exception of type: 'ErrorResponse'. + + :param response: Server response to be deserialized. + :param error_model: A deserialized model of the response body as model. + """ + + def __init__(self, response, error_model): + self.error = error_model + super(ErrorResponseException, self).__init__(response=response, error_model=error_model) + + @classmethod + def from_response(cls, response, deserialize): + """Deserialize this response as this exception, or a subclass of this exception. + + :param response: Server response to be deserialized. + :param deserialize: A deserializer + """ + model_name = 'ErrorResponse' + error = deserialize(model_name, response) + if error is None: + error = deserialize.dependencies[model_name]() + return error._EXCEPTION_TYPE(response, error) + + +class ErrorResponse(msrest.serialization.Model): + """Error response. + + :param error: Error definition. + :type error: ~portal.models.ErrorDefinition + """ + _EXCEPTION_TYPE = ErrorResponseException + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class PatchableDashboard(msrest.serialization.Model): + """The shared dashboard resource definition. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param lenses: The dashboard lenses. + :type lenses: dict[str, ~portal.models.DashboardLens] + :param metadata: The dashboard metadata. + :type metadata: dict[str, object] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'lenses': {'key': 'properties.lenses', 'type': '{DashboardLens}'}, + 'metadata': {'key': 'properties.metadata', 'type': '{object}'}, + } + + def __init__( + self, + **kwargs + ): + super(PatchableDashboard, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.lenses = kwargs.get('lenses', None) + self.metadata = kwargs.get('metadata', None) + + +class ResourceProviderOperation(msrest.serialization.Model): + """Supported operations of this resource provider. + + :param name: Operation name, in format of {provider}/{resource}/{operation}. + :type name: str + :param is_data_action: Indicates whether the operation applies to data-plane. + :type is_data_action: str + :param display: Display metadata associated with the operation. + :type display: ~portal.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + + +class ResourceProviderOperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft Custom Providers. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ResourceProviderOperationList(msrest.serialization.Model): + """Results of the request to list operations. + + :param value: List of operations supported by this resource provider. + :type value: list[~portal.models.ResourceProviderOperation] + :param next_link: The URL to use for getting the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) diff --git a/src/portal/azext_portal/vendored_sdks/portal/models/_models_py3.py b/src/portal/azext_portal/vendored_sdks/portal/models/_models_py3.py new file mode 100644 index 00000000000..47507e86168 --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/portal/models/_models_py3.py @@ -0,0 +1,449 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Dict, List, Optional + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Dashboard(msrest.serialization.Model): + """The shared dashboard resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param lenses: The dashboard lenses. + :type lenses: dict[str, ~portal.models.DashboardLens] + :param metadata: The dashboard metadata. + :type metadata: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + 'lenses': {'key': 'properties.lenses', 'type': '{DashboardLens}'}, + 'metadata': {'key': 'properties.metadata', 'type': '{object}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + lenses: Optional[Dict[str, "DashboardLens"]] = None, + metadata: Optional[Dict[str, object]] = None, + **kwargs + ): + super(Dashboard, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.lenses = lenses + self.metadata = metadata + + +class DashboardLens(msrest.serialization.Model): + """A dashboard lens. + + All required parameters must be populated in order to send to Azure. + + :param order: Required. The lens order. + :type order: int + :param parts: Required. The dashboard parts. + :type parts: dict[str, ~portal.models.DashboardParts] + :param metadata: The dashboard len's metadata. + :type metadata: dict[str, object] + """ + + _validation = { + 'order': {'required': True}, + 'parts': {'required': True}, + } + + _attribute_map = { + 'order': {'key': 'order', 'type': 'int'}, + 'parts': {'key': 'parts', 'type': '{DashboardParts}'}, + 'metadata': {'key': 'metadata', 'type': '{object}'}, + } + + def __init__( + self, + *, + order: int, + parts: Dict[str, "DashboardParts"], + metadata: Optional[Dict[str, object]] = None, + **kwargs + ): + super(DashboardLens, self).__init__(**kwargs) + self.order = order + self.parts = parts + self.metadata = metadata + + +class DashboardListResult(msrest.serialization.Model): + """List of dashboards. + + :param value: The array of custom resource provider manifests. + :type value: list[~portal.models.Dashboard] + :param next_link: The URL to use for getting the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Dashboard]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Dashboard"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(DashboardListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class DashboardParts(msrest.serialization.Model): + """A dashboard part. + + All required parameters must be populated in order to send to Azure. + + :param position: Required. The dashboard's part position. + :type position: ~portal.models.DashboardPartsPosition + :param metadata: The dashboard part's metadata. + :type metadata: dict[str, object] + """ + + _validation = { + 'position': {'required': True}, + } + + _attribute_map = { + 'position': {'key': 'position', 'type': 'DashboardPartsPosition'}, + 'metadata': {'key': 'metadata', 'type': '{object}'}, + } + + def __init__( + self, + *, + position: "DashboardPartsPosition", + metadata: Optional[Dict[str, object]] = None, + **kwargs + ): + super(DashboardParts, self).__init__(**kwargs) + self.position = position + self.metadata = metadata + + +class DashboardPartsPosition(msrest.serialization.Model): + """The dashboard's part position. + + All required parameters must be populated in order to send to Azure. + + :param x: Required. The dashboard's part x coordinate. + :type x: int + :param y: Required. The dashboard's part y coordinate. + :type y: int + :param row_span: Required. The dashboard's part row span. + :type row_span: int + :param col_span: Required. The dashboard's part column span. + :type col_span: int + :param metadata: The dashboard part's metadata. + :type metadata: dict[str, object] + """ + + _validation = { + 'x': {'required': True}, + 'y': {'required': True}, + 'row_span': {'required': True}, + 'col_span': {'required': True}, + } + + _attribute_map = { + 'x': {'key': 'x', 'type': 'int'}, + 'y': {'key': 'y', 'type': 'int'}, + 'row_span': {'key': 'rowSpan', 'type': 'int'}, + 'col_span': {'key': 'colSpan', 'type': 'int'}, + 'metadata': {'key': 'metadata', 'type': '{object}'}, + } + + def __init__( + self, + *, + x: int, + y: int, + row_span: int, + col_span: int, + metadata: Optional[Dict[str, object]] = None, + **kwargs + ): + super(DashboardPartsPosition, self).__init__(**kwargs) + self.x = x + self.y = y + self.row_span = row_span + self.col_span = col_span + self.metadata = metadata + + +class DashboardProperties(msrest.serialization.Model): + """The shared dashboard properties. + + :param lenses: The dashboard lenses. + :type lenses: dict[str, ~portal.models.DashboardLens] + :param metadata: The dashboard metadata. + :type metadata: dict[str, object] + """ + + _attribute_map = { + 'lenses': {'key': 'lenses', 'type': '{DashboardLens}'}, + 'metadata': {'key': 'metadata', 'type': '{object}'}, + } + + def __init__( + self, + *, + lenses: Optional[Dict[str, "DashboardLens"]] = None, + metadata: Optional[Dict[str, object]] = None, + **kwargs + ): + super(DashboardProperties, self).__init__(**kwargs) + self.lenses = lenses + self.metadata = metadata + + +class ErrorDefinition(msrest.serialization.Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Service specific error code which serves as the substatus for the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar details: Internal error details. + :vartype details: list[~portal.models.ErrorDefinition] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None + + +class ErrorResponseException(HttpResponseError): + """Server responded with exception of type: 'ErrorResponse'. + + :param response: Server response to be deserialized. + :param error_model: A deserialized model of the response body as model. + """ + + def __init__(self, response, error_model): + self.error = error_model + super(ErrorResponseException, self).__init__(response=response, error_model=error_model) + + @classmethod + def from_response(cls, response, deserialize): + """Deserialize this response as this exception, or a subclass of this exception. + + :param response: Server response to be deserialized. + :param deserialize: A deserializer + """ + model_name = 'ErrorResponse' + error = deserialize(model_name, response) + if error is None: + error = deserialize.dependencies[model_name]() + return error._EXCEPTION_TYPE(response, error) + + +class ErrorResponse(msrest.serialization.Model): + """Error response. + + :param error: Error definition. + :type error: ~portal.models.ErrorDefinition + """ + _EXCEPTION_TYPE = ErrorResponseException + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDefinition"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class PatchableDashboard(msrest.serialization.Model): + """The shared dashboard resource definition. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param lenses: The dashboard lenses. + :type lenses: dict[str, ~portal.models.DashboardLens] + :param metadata: The dashboard metadata. + :type metadata: dict[str, object] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'lenses': {'key': 'properties.lenses', 'type': '{DashboardLens}'}, + 'metadata': {'key': 'properties.metadata', 'type': '{object}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + lenses: Optional[Dict[str, "DashboardLens"]] = None, + metadata: Optional[Dict[str, object]] = None, + **kwargs + ): + super(PatchableDashboard, self).__init__(**kwargs) + self.tags = tags + self.lenses = lenses + self.metadata = metadata + + +class ResourceProviderOperation(msrest.serialization.Model): + """Supported operations of this resource provider. + + :param name: Operation name, in format of {provider}/{resource}/{operation}. + :type name: str + :param is_data_action: Indicates whether the operation applies to data-plane. + :type is_data_action: str + :param display: Display metadata associated with the operation. + :type display: ~portal.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + is_data_action: Optional[str] = None, + display: Optional["ResourceProviderOperationDisplay"] = None, + **kwargs + ): + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + + +class ResourceProviderOperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft Custom Providers. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ResourceProviderOperationList(msrest.serialization.Model): + """Results of the request to list operations. + + :param value: List of operations supported by this resource provider. + :type value: list[~portal.models.ResourceProviderOperation] + :param next_link: The URL to use for getting the next set of results. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ResourceProviderOperation"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = value + self.next_link = next_link diff --git a/src/portal/azext_portal/vendored_sdks/portal/operations/__init__.py b/src/portal/azext_portal/vendored_sdks/portal/operations/__init__.py new file mode 100644 index 00000000000..9bffae3d64c --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/portal/operations/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operation_operations import OperationOperations +from ._dashboard_operations import DashboardOperations + +__all__ = [ + 'OperationOperations', + 'DashboardOperations', +] diff --git a/src/portal/azext_portal/vendored_sdks/portal/operations/_dashboard_operations.py b/src/portal/azext_portal/vendored_sdks/portal/operations/_dashboard_operations.py new file mode 100644 index 00000000000..403f882f8a6 --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/portal/operations/_dashboard_operations.py @@ -0,0 +1,540 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[ + PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + + +class DashboardOperations(object): + """DashboardOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~portal.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def create_or_update( + self, + resource_group_name, # type: str + dashboard_name, # type: str + location, # type: str + tags=None, # type: Optional[Dict[str, str]] + lenses=None, # type: Optional[Dict[str, "DashboardLens"]] + metadata=None, # type: Optional[Dict[str, object]] + **kwargs # type: Any + ): + # type: (...) -> "models.Dashboard" + """Creates or updates a Dashboard. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dashboard_name: The name of the dashboard. + :type dashboard_name: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param lenses: The dashboard lenses. + :type lenses: dict[str, ~portal.models.DashboardLens] + :param metadata: The dashboard metadata. + :type metadata: dict[str, object] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Dashboard or Dashboard or the result of cls(response) + :rtype: ~portal.models.Dashboard or ~portal.models.Dashboard + :raises: ~portal.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Dashboard"] + error_map = kwargs.pop('error_map', {}) + + dashboard = models.Dashboard( + location=location, tags=tags, lenses=lenses, metadata=metadata) + api_version = "2019-01-01-preview" + + # 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'), + 'dashboardName': self._serialize.url("dashboard_name", dashboard_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query( + "api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(dashboard, 'Dashboard') + + # Construct and send request + request = self._client.put( + url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, + response=response, error_map=error_map) + raise models.ErrorResponseException.from_response( + response, self._deserialize) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Dashboard', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Dashboard', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = { + 'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}'} + + def delete( + self, + resource_group_name, # type: str + dashboard_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the Dashboard. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dashboard_name: The name of the dashboard. + :type dashboard_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises: ~portal.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-01-01-preview" + + # 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'), + 'dashboardName': self._serialize.url("dashboard_name", dashboard_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query( + "api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, + response=response, error_map=error_map) + raise models.ErrorResponseException.from_response( + response, self._deserialize) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = { + 'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}'} + + def get( + self, + resource_group_name, # type: str + dashboard_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.Dashboard" + """Gets the Dashboard. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dashboard_name: The name of the dashboard. + :type dashboard_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Dashboard or the result of cls(response) + :rtype: ~portal.models.Dashboard + :raises: ~portal.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Dashboard"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-01-01-preview" + + # 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'), + 'dashboardName': self._serialize.url("dashboard_name", dashboard_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query( + "api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, + response=response, error_map=error_map) + raise models.ErrorResponseException.from_response( + response, self._deserialize) + + deserialized = self._deserialize('Dashboard', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = { + 'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}'} + + def update( + self, + resource_group_name, # type: str + dashboard_name, # type: str + lenses=None, # type: Optional[Dict[str, "DashboardLens"]] + metadata=None, # type: Optional[Dict[str, object]] + **kwargs # type: Any + ): + # type: (...) -> "models.Dashboard" + """Updates an existing Dashboard. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dashboard_name: The name of the dashboard. + :type dashboard_name: str + :param lenses: The dashboard lenses. + :type lenses: dict[str, ~portal.models.DashboardLens] + :param metadata: The dashboard metadata. + :type metadata: dict[str, object] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Dashboard or the result of cls(response) + :rtype: ~portal.models.Dashboard + :raises: ~portal.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Dashboard"] + error_map = kwargs.pop('error_map', {}) + + dashboard = models.PatchableDashboard(lenses=lenses, metadata=metadata) + api_version = "2019-01-01-preview" + + # 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'), + 'dashboardName': self._serialize.url("dashboard_name", dashboard_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query( + "api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(dashboard, 'PatchableDashboard') + + # Construct and send request + request = self._client.patch( + url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, + response=response, error_map=error_map) + raise models.ErrorResponseException.from_response( + response, self._deserialize) + + deserialized = self._deserialize('Dashboard', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = { + 'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}'} + + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.DashboardListResult" + """Gets all the Dashboards within a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DashboardListResult or the result of cls(response) + :rtype: ~portal.models.DashboardListResult + :raises: ~portal.models.ErrorResponseException: + """ + cls = kwargs.pop( + 'cls', None) # type: ClsType["models.DashboardListResult"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-01-01-preview" + + def prepare_request(next_link=None): + if not next_link: + # 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'), + } + url = self._client.format_url(url, **path_format_arguments) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query( + "api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get( + url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + 'DashboardListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, + response=response, error_map=error_map) + raise models.ErrorResponseException.from_response( + response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = { + 'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards'} + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.DashboardListResult" + """Gets all the dashboards within a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DashboardListResult or the result of cls(response) + :rtype: ~portal.models.DashboardListResult + :raises: ~portal.models.ErrorResponseException: + """ + cls = kwargs.pop( + 'cls', None) # type: ClsType["models.DashboardListResult"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-01-01-preview" + + def prepare_request(next_link=None): + if not next_link: + # 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) + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query( + "api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get( + url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + 'DashboardListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, + response=response, error_map=error_map) + raise models.ErrorResponseException.from_response( + response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = { + 'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Portal/dashboards'} + + def dashboard_import( + self, + resource_group_name, # type: str + dashboard_name, # type: str + dashboard, # type: "models.Dashboard" + **kwargs # type: Any + ): + # type: (...) -> "models.Dashboard" + """Creates or updates a Dashboard. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dashboard_name: The name of the dashboard. + :type dashboard_name: str + :param dashboard: The parameters required to create or update a dashboard. + :type dashboard: ~portal.models.Dashboard + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Dashboard or Dashboard or the result of cls(response) + :rtype: ~portal.models.Dashboard or ~portal.models.Dashboard + :raises: ~portal.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Dashboard"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-01-01-preview" + + # 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'), + 'dashboardName': self._serialize.url("dashboard_name", dashboard_name, 'str', max_length=64, min_length=3), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query( + "api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json' + + # Construct body + body_content = self._serialize.body(dashboard, 'Dashboard') + + # Construct and send request + request = self._client.put( + url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run( + request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, + response=response, error_map=error_map) + raise models.ErrorResponseException.from_response( + response, self._deserialize) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Dashboard', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Dashboard', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = { + 'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Portal/dashboards/{dashboardName}'} diff --git a/src/portal/azext_portal/vendored_sdks/portal/operations/_operation_operations.py b/src/portal/azext_portal/vendored_sdks/portal/operations/_operation_operations.py new file mode 100644 index 00000000000..59145766d1b --- /dev/null +++ b/src/portal/azext_portal/vendored_sdks/portal/operations/_operation_operations.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from .. import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationOperations(object): + """OperationOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~portal.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.ResourceProviderOperationList" + """The Microsoft Portal operations API. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ResourceProviderOperationList or the result of cls(response) + :rtype: ~portal.models.ResourceProviderOperationList + :raises: ~portal.models.ErrorResponseException: + """ + cls = kwargs.pop('cls', None ) # type: ClsType["models.ResourceProviderOperationList"] + error_map = kwargs.pop('error_map', {}) + api_version = "2019-01-01-preview" + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + else: + url = next_link + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ResourceProviderOperationList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.ErrorResponseException.from_response(response, self._deserialize) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Portal/operations'} diff --git a/src/portal/setup.cfg b/src/portal/setup.cfg new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/portal/setup.py b/src/portal/setup.py new file mode 100644 index 00000000000..32e97984c49 --- /dev/null +++ b/src/portal/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.1' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +# 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='portal', + version=VERSION, + description='Microsoft Azure Command-Line Tools Portal 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_portal': ['azext_metadata.json']}, +) diff --git a/src/resource-graph/README.md b/src/resource-graph/README.md index d370888f8e6..4a2d8843f97 100644 --- a/src/resource-graph/README.md +++ b/src/resource-graph/README.md @@ -1,4 +1,4 @@ -# Azure CLI blueprint Extension # +# Azure CLI Resource Graph Extension # This package is for the 'resource-graph' extension, i.e. 'az graph'. diff --git a/src/spring-cloud/HISTORY.rst b/src/spring-cloud/HISTORY.md similarity index 78% rename from src/spring-cloud/HISTORY.rst rename to src/spring-cloud/HISTORY.md index fb8dea2f498..719bc65fc83 100644 --- a/src/spring-cloud/HISTORY.rst +++ b/src/spring-cloud/HISTORY.md @@ -1,28 +1,30 @@ -.. :changelog: - -Release History -=============== - -0.2.2 -++++++ -* Remove the limitation of max compatible cli core version - -0.2.1 -++++++ -* Add command "az spring-cloud app logs" to replace "az spring-cloud app log tail" for log streaming. -* "az spring-cloud app log tail" will be deprecated in a future release -* Fix Python 3 and Python 2 compatible issues. - -0.2.0 -++++++ -* Support the log streaming feature. -* Add command for log streaming: az spring-cloud app log tail. - -0.1.1 -++++++ -* Improve the verbosity for the long running commands. -* Refine the descriptions and error messages for the command. - -0.1.0 -++++++ +Release History +=============== + +0.2.3 +----- +* Add command "az spring-cloud app custom-domain" and "az spring-cloud certificate" to support Custom Domain feature. + +0.2.2 +----- +* Remove the limitation of max compatible cli core version + +0.2.1 +----- +* Add command "az spring-cloud app logs" to replace "az spring-cloud app log tail" for log streaming. +* "az spring-cloud app log tail" will be deprecated in a future release +* Fix Python 3 and Python 2 compatible issues. + +0.2.0 +----- +* Support the log streaming feature. +* Add command for log streaming: az spring-cloud app log tail. + +0.1.1 +----- +* Improve the verbosity for the long running commands. +* Refine the descriptions and error messages for the command. + +0.1.0 +----- * Initial release. \ No newline at end of file diff --git a/src/spring-cloud/README.md b/src/spring-cloud/README.md new file mode 100644 index 00000000000..e1668577131 --- /dev/null +++ b/src/spring-cloud/README.md @@ -0,0 +1,21 @@ +Microsoft Azure CLI 'spring-cloud' Extension +========================================== + +This package is for the 'spring-cloud' extension. +i.e. 'az spring-cloud' + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name spring-cloud +``` + +### Sample Commands ### +Create a service and not wait +``` +az spring-cloud create -n --no-wait +``` +Create a green deployment with default configuration +``` +az spring-cloud app deployment create --app -n --jar-path +``` \ No newline at end of file diff --git a/src/spring-cloud/README.rst b/src/spring-cloud/README.rst deleted file mode 100644 index 0e0f83afb00..00000000000 --- a/src/spring-cloud/README.rst +++ /dev/null @@ -1,5 +0,0 @@ -Microsoft Azure CLI 'spring-cloud' Extension -========================================== - -This package is for the 'spring-cloud' extension. -i.e. 'az spring-cloud' \ No newline at end of file diff --git a/src/spring-cloud/azext_spring_cloud/_client_factory.py b/src/spring-cloud/azext_spring_cloud/_client_factory.py index fa531ebad22..77ce5e7669c 100644 --- a/src/spring-cloud/azext_spring_cloud/_client_factory.py +++ b/src/spring-cloud/azext_spring_cloud/_client_factory.py @@ -30,3 +30,11 @@ def cf_deployments(cli_ctx, *_): def cf_bindings(cli_ctx, *_): return cf_spring_cloud(cli_ctx).bindings + + +def cf_certificates(cli_ctx, *_): + return cf_spring_cloud(cli_ctx).certificates + + +def cf_custom_domains(cli_ctx, *_): + return cf_spring_cloud(cli_ctx).custom_domains diff --git a/src/spring-cloud/azext_spring_cloud/_help.py b/src/spring-cloud/azext_spring_cloud/_help.py index 806266638dc..3fde2366504 100644 --- a/src/spring-cloud/azext_spring_cloud/_help.py +++ b/src/spring-cloud/azext_spring_cloud/_help.py @@ -147,37 +147,6 @@ short-summary: Show logs of an app instance, logs will be streamed when setting '-f/--follow'. """ -helps['spring-cloud app identity'] = """ - type: group - short-summary: Manage an app's managed service identity. -""" - -helps['spring-cloud app identity assign'] = """ - type: command - short-summary: Enable managed service identity on an app. - examples: - - name: Enable the system assigned identity. - text: az spring-cloud app identity assign -n MyApp -s MyCluster -g MyResourceGroup - - name: Enable the system assigned identity on an app with the 'Reader' role. - text: az spring-cloud app identity assign -n MyApp -s MyCluster -g MyResourceGroup --role Reader --scope /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxxx/providers/Microsoft.KeyVault/vaults/xxxxx -""" - -helps['spring-cloud app identity remove'] = """ - type: command - short-summary: Remove managed service identity from an app. - examples: - - name: Remove the system assigned identity from an app. - text: az spring-cloud app identity remove -n MyApp -s MyCluster -g MyResourceGroup -""" - -helps['spring-cloud app identity show'] = """ - type: command - short-summary: Display app's managed identity info. - examples: - - name: Display an app's managed identity info. - text: az spring-cloud app identity show -n MyApp -s MyCluster -g MyResourceGroup -""" - helps['spring-cloud app set-deployment'] = """ type: command short-summary: Set production deployment of an app. @@ -347,3 +316,73 @@ type: command short-summary: Update an Azure Cache for Redis service binding of the app. """ + +helps['spring-cloud certificate'] = """ + type: group + short-summary: Commands to manage certificates. +""" + +helps['spring-cloud certificate add'] = """ + type: command + short-summary: Add a certificate in Azure Spring Cloud. + examples: + - name: Import certificate from key vault. + text: az spring-cloud certificate add --name MyCertName --vault-uri MyKeyVaultUri --vault-certificate-name MyKeyVaultCertName --service MyCluster --resource-group MyResourceGroup +""" + +helps['spring-cloud certificate show'] = """ + type: command + short-summary: Show a certificate in Azure Spring Cloud. +""" + +helps['spring-cloud certificate list'] = """ + type: command + short-summary: List all certificates in Azure Spring Cloud. + examples: + - name: List all certificates in spring cloud service. + text: az spring-cloud certificate list --service MyCluster --resource-group MyResourceGroup -o table +""" + +helps['spring-cloud certificate remove'] = """ + type: command + short-summary: Remove a certificate in Azure Spring Cloud. +""" + +helps['spring-cloud app custom-domain'] = """ + type: group + short-summary: Commands to manage custom domains. +""" + +helps['spring-cloud app custom-domain bind'] = """ + type: command + short-summary: Bind a custom domain with the app. + examples: + - name: Bind a custom domain to app. + text: az spring-cloud app custom-domain bind --domain-name MyDomainName --certificate MyCertName --app MyAppName --service MyCluster --resource-group MyResourceGroup +""" + +helps['spring-cloud app custom-domain show'] = """ + type: command + short-summary: Show details of a custom domain. +""" + +helps['spring-cloud app custom-domain list'] = """ + type: command + short-summary: List all custom domains of the app. + examples: + - name: List all custom domains of the app. + text: az spring-cloud app custom-domain list --app MyAppName --service MyCluster --resource-group MyResourceGroup -o table +""" + +helps['spring-cloud app custom-domain update'] = """ + type: command + short-summary: Update a custom domain of the app. + examples: + - name: Bind custom domain with a specified certificate. + text: az spring-cloud app custom-domain update --domain-name MyDomainName --certificate MCertName --app MyAppName --service MyCluster --resource-group MyResourceGroup +""" + +helps['spring-cloud app custom-domain unbind'] = """ + type: command + short-summary: Unbind a custom-domain of the app. +""" diff --git a/src/spring-cloud/azext_spring_cloud/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index 07c508f915b..e3c57b5063c 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -45,22 +45,16 @@ def load_arguments(self, _): with self.argument_context('spring-cloud app create') as c: c.argument( 'is_public', arg_type=get_three_state_flag(), help='If true, assign public domain', default=False) - c.argument('assign_identity', arg_type=get_three_state_flag(), - help='If true, assign managed service identity.') with self.argument_context('spring-cloud app update') as c: - c.argument('is_public', arg_type=get_three_state_flag(), - help='If true, assign public domain') + c.argument('is_public', arg_type=get_three_state_flag(), help='If true, assign endpoint') + c.argument('https_only', arg_type=get_three_state_flag(), help='If true, access app via https', default=False) for scope in ['spring-cloud app update', 'spring-cloud app start', 'spring-cloud app stop', 'spring-cloud app restart', 'spring-cloud app deploy', 'spring-cloud app scale', 'spring-cloud app set-deployment', 'spring-cloud app show-deploy-log']: with self.argument_context(scope) as c: c.argument('deployment', options_list=[ '--deployment', '-d'], help='Name of an existing deployment of the app. Default to the production deployment if not specified.', validator=validate_deployment_name) - with self.argument_context('spring-cloud app identity assign') as c: - c.argument('scope', help="The scope the managed identity has access to") - c.argument('role', help="Role name or id the managed identity will be assigned") - with self.argument_context('spring-cloud app logs') as c: c.argument('instance', options_list=['--instance', '-i'], help='Name of an existing instance of the deployment.') c.argument('lines', type=int, help='Number of lines to show. Maximum is 10000', validator=validate_log_lines) @@ -196,3 +190,22 @@ def load_arguments(self, _): validator=validate_app_name) c.argument('deployment', options_list=[ '--deployment', '-d'], help='Name of an existing deployment of the app. Default to the production deployment if not specified.', validator=validate_deployment_name) + + with self.argument_context('spring-cloud certificate') as c: + c.argument('service', service_name_type) + c.argument('name', name_type, help='Name of certificate.') + + with self.argument_context('spring-cloud certificate add') as c: + c.argument('vault_uri', help='The key vault uri where store the certificate') + c.argument('vault_certificate_name', help='The certificate name in key vault') + + with self.argument_context('spring-cloud app custom-domain') as c: + c.argument('service', service_name_type) + c.argument('app', app_name_type, help='Name of app.', validator=validate_app_name) + c.argument('domain_name', help='Name of custom domain.') + + with self.argument_context('spring-cloud app custom-domain bind') as c: + c.argument('certificate', type=str, help='Certificate name in Azure Spring Cloud.') + + with self.argument_context('spring-cloud app custom-domain update') as c: + c.argument('certificate', help='Certificate name in Azure Spring Cloud.') diff --git a/src/spring-cloud/azext_spring_cloud/_transformers.py b/src/spring-cloud/azext_spring_cloud/_transformers.py index c18153bbd69..c9ac8bbfb7b 100644 --- a/src/spring-cloud/azext_spring_cloud/_transformers.py +++ b/src/spring-cloud/azext_spring_cloud/_transformers.py @@ -76,3 +76,35 @@ def transform_spring_cloud_deployment_output(result): item['Registered Instance'] = "{}/{}".format(up_number, instance_count) if isStarted else "Stopped" return result if is_list else result[0] + + +def transform_spring_cloud_certificate_output(result): + is_list = isinstance(result, list) + + if not is_list: + result = [result] + + for item in result: + item['Certificate Name'] = item['properties']['keyVaultCertName'] + item['Thumbprint'] = item['properties']['thumbprint'] + item['Activate Date'] = item['properties']['activateDate'].split("T")[0] + item['Certificate Version'] = item['properties']['certVersion'] + item['DNS Names'] = item['properties']['dnsNames'] + item['Expiration Date'] = item['properties']['expirationDate'].split("T")[0] + item['Key Vault Uri'] = item['properties']['vaultUri'] + + return result if is_list else result[0] + + +def transform_spring_cloud_custom_domain_output(result): + is_list = isinstance(result, list) + + if not is_list: + result = [result] + + for item in result: + item['App Name'] = item['properties']["appName"] + item['Certificate Name'] = item['properties']['certName'] + item['Thumbprint'] = item['properties']['thumbprint'] + + return result if is_list else result[0] diff --git a/src/spring-cloud/azext_spring_cloud/commands.py b/src/spring-cloud/azext_spring_cloud/commands.py index f351fd1e263..b1080757170 100644 --- a/src/spring-cloud/azext_spring_cloud/commands.py +++ b/src/spring-cloud/azext_spring_cloud/commands.py @@ -6,7 +6,10 @@ # pylint: disable=line-too-long from ._client_factory import (cf_app_services, cf_spring_cloud, cf_bindings) from ._transformers import (transform_spring_cloud_table_output, - transform_app_table_output, transform_spring_cloud_deployment_output) + transform_app_table_output, + transform_spring_cloud_deployment_output, + transform_spring_cloud_certificate_output, + transform_spring_cloud_custom_domain_output) # pylint: disable=too-many-statements @@ -58,11 +61,6 @@ def load_command_table(self, _): g.custom_command('restart', 'app_restart', supports_no_wait=True) g.custom_command('logs', 'app_tail_log') - with self.command_group('spring-cloud app identity', client_factory=cf_spring_cloud) as g: - g.custom_command('assign', 'app_identity_assign') - g.custom_command('remove', 'app_identity_remove') - g.custom_show_command('show', 'app_identity_show') - with self.command_group('spring-cloud app log', client_factory=cf_spring_cloud, deprecate_info=g.deprecate(redirect='az spring-cloud app logs', hide=True)) as g: g.custom_command('tail', 'app_tail_log') @@ -86,5 +84,18 @@ def load_command_table(self, _): g.custom_command('redis update', 'binding_redis_update') g.custom_show_command('remove', 'binding_remove') + with self.command_group('spring-cloud certificate', client_factory=cf_spring_cloud) as g: + g.custom_command('add', 'certificate_add') + g.custom_show_command('show', 'certificate_show', table_transformer=transform_spring_cloud_certificate_output) + g.custom_command('list', 'certificate_list', table_transformer=transform_spring_cloud_certificate_output) + g.custom_command('remove', 'certificate_remove') + + with self.command_group('spring-cloud app custom-domain', client_factory=cf_spring_cloud) as g: + g.custom_command('bind', 'domain_bind') + g.custom_show_command('show', 'domain_show', table_transformer=transform_spring_cloud_custom_domain_output) + g.custom_command('list', 'domain_list', table_transformer=transform_spring_cloud_custom_domain_output) + g.custom_command('update', 'domain_update') + g.custom_command('unbind', 'domain_unbind') + with self.command_group('spring-cloud', is_preview=True): pass diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 8a98ab96aed..a9862f333af 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -16,7 +16,6 @@ from knack.log import get_logger from .azure_storage_file import FileService from azure.cli.core.util import sdk_no_wait -from azure.cli.core.profiles import ResourceType, get_sdk from ast import literal_eval from azure.cli.core.commands import cached_put from ._utils import _get_rg_location @@ -101,8 +100,7 @@ def app_create(cmd, client, resource_group, service, name, runtime_version=None, jvm_options=None, env=None, - enable_persistent_storage=None, - assign_identity=None): + enable_persistent_storage=None): apps = _get_all_apps(client, resource_group, service) if name in apps: raise CLIError("App '{}' already exists.".format(name)) @@ -121,14 +119,8 @@ def app_create(cmd, client, resource_group, service, name, resource = client.services.get(resource_group, service) location = resource.location - app_resource = models.AppResource() - app_resource.properties = properties - app_resource.location = location - if assign_identity is True: - app_resource.identity = models.ManagedIdentityProperties(type="systemassigned") - poller = client.apps.create_or_update( - resource_group, service, name, app_resource) + resource_group, service, name, properties, location) while poller.done() is False: sleep(APP_CREATE_OR_UPDATE_SLEEP_INTERVAL) @@ -155,10 +147,7 @@ def app_create(cmd, client, resource_group, service, name, properties = models.AppResourceProperties( active_deployment_name=DEFAULT_DEPLOYMENT_NAME, public=is_public) - app_resource.properties = properties - app_resource.location = location - - app_poller = client.apps.update(resource_group, service, name, app_resource) + app_poller = client.apps.update(resource_group, service, name, properties, location) logger.warning( "[4/4] Updating app '{}' (this operation can take a while to complete)".format(name)) while not poller.done() or not app_poller.done(): @@ -178,8 +167,9 @@ def app_update(cmd, client, resource_group, service, name, runtime_version=None, jvm_options=None, env=None, - enable_persistent_storage=None): - properties = models.AppResourceProperties(public=is_public) + enable_persistent_storage=None, + https_only=None): + properties = models.AppResourceProperties(public=is_public, https_only=https_only) if enable_persistent_storage is True: properties.persistent_disk = models.PersistentDisk( size_in_gb=50, mount_path="/persistent") @@ -189,13 +179,9 @@ def app_update(cmd, client, resource_group, service, name, resource = client.services.get(resource_group, service) location = resource.location - app_resource = models.AppResource() - app_resource.properties = properties - app_resource.location = location - logger.warning("[1/2] updating app '{}'".format(name)) poller = client.apps.update( - resource_group, service, name, app_resource) + resource_group, service, name, properties, location) while poller.done() is False: sleep(APP_CREATE_OR_UPDATE_SLEEP_INTERVAL) @@ -440,69 +426,6 @@ def app_tail_log(cmd, client, resource_group, service, name, instance=None, foll raise exceptions[0] -def app_identity_assign(cmd, client, resource_group, service, name, role=None, scope=None): - app_resource = models.AppResource() - identity = models.ManagedIdentityProperties(type="systemassigned") - properties = models.AppResourceProperties() - resource = client.services.get(resource_group, service) - location = resource.location - - app_resource.identity = identity - app_resource.properties = properties - app_resource.location = location - client.apps.update(resource_group, service, name, app_resource) - app = client.apps.get(resource_group, service, name) - if role: - principal_id = app.identity.principal_id - - from azure.cli.core.commands import arm as _arm - identity_role_id = _arm.resolve_role_id(cmd.cli_ctx, role, scope) - from azure.cli.core.commands.client_factory import get_mgmt_service_client - assignments_client = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_AUTHORIZATION).role_assignments - RoleAssignmentCreateParameters = get_sdk(cmd.cli_ctx, ResourceType.MGMT_AUTHORIZATION, - 'RoleAssignmentCreateParameters', mod='models', - operation_group='role_assignments') - parameters = RoleAssignmentCreateParameters(role_definition_id=identity_role_id, principal_id=principal_id) - logger.info("Creating an assignment with a role '%s' on the scope of '%s'", identity_role_id, scope) - retry_times = 36 - assignment_name = _arm._gen_guid() - for l in range(0, retry_times): - try: - assignments_client.create(scope=scope, role_assignment_name=assignment_name, - parameters=parameters) - break - except CloudError as ex: - if 'role assignment already exists' in ex.message: - logger.info('Role assignment already exists') - break - elif l < retry_times and ' does not exist in the directory ' in ex.message: - sleep(APP_CREATE_OR_UPDATE_SLEEP_INTERVAL) - logger.warning('Retrying role assignment creation: %s/%s', l + 1, - retry_times) - continue - else: - raise - return app - - -def app_identity_remove(cmd, client, resource_group, service, name): - app_resource = models.AppResource() - identity = models.ManagedIdentityProperties(type="none") - properties = models.AppResourceProperties() - resource = client.services.get(resource_group, service) - location = resource.location - - app_resource.identity = identity - app_resource.properties = properties - app_resource.location = location - return client.apps.update(resource_group, service, name, app_resource) - - -def app_identity_show(cmd, client, resource_group, service, name): - app = client.apps.get(resource_group, service, name) - return app.identity - - def app_set_deployment(cmd, client, resource_group, service, name, deployment): deployments = _get_all_deployments(client, resource_group, service, name) active_deployment = client.apps.get( @@ -519,11 +442,7 @@ def app_set_deployment(cmd, client, resource_group, service, name, deployment): resource = client.services.get(resource_group, service) location = resource.location - app_resource = models.AppResource() - app_resource.properties = properties - app_resource.location = location - - return client.apps.update(resource_group, service, name, app_resource) + return client.apps.update(resource_group, service, name, properties, location) def deployment_create(cmd, client, resource_group, service, app, name, @@ -1169,3 +1088,63 @@ def stream(self, amt=2 ** 16, decode_content=None): response.release_conn() except CLIError as e: exceptions.append(e) + + +def certificate_add(cmd, client, resource_group, service, name, vault_uri, vault_certificate_name): + properties = models.CertificateProperties( + vault_uri=vault_uri, + key_vault_cert_name=vault_certificate_name + ) + return client.certificates.create_or_update(resource_group, service, name, properties) + + +def certificate_show(cmd, client, resource_group, service, name): + return client.certificates.get(resource_group, service, name) + + +def certificate_list(cmd, client, resource_group, service): + return client.certificates.list(resource_group, service) + + +def certificate_remove(cmd, client, resource_group, service, name): + client.certificates.get(resource_group, service, name) + return client.certificates.delete(resource_group, service, name) + + +def domain_bind(cmd, client, resource_group, service, app, + domain_name, + certificate=None): + properties = models.CustomDomainProperties() + if certificate is not None: + certificate_response = client.certificates.get(resource_group, service, certificate) + properties = models.CustomDomainProperties( + thumbprint=certificate_response.properties.thumbprint, + cert_name=certificate + ) + return client.custom_domains.create_or_update(resource_group, service, app, domain_name, properties) + + +def domain_show(cmd, client, resource_group, service, app, domain_name): + return client.custom_domains.get(resource_group, service, app, domain_name) + + +def domain_list(cmd, client, resource_group, service, app): + return client.custom_domains.list(resource_group, service, app) + + +def domain_update(cmd, client, resource_group, service, app, + domain_name, + certificate=None): + properties = models.CustomDomainProperties() + if certificate is not None: + certificate_response = client.certificates.get(resource_group, service, certificate) + properties = models.CustomDomainProperties( + thumbprint=certificate_response.properties.thumbprint, + cert_name=certificate + ) + return client.custom_domains.create_or_update(resource_group, service, app, domain_name, properties) + + +def domain_unbind(cmd, client, resource_group, service, app, domain_name): + client.custom_domains.get(resource_group, service, app, domain_name) + return client.custom_domains.delete(resource_group, service, app, domain_name) diff --git a/src/spring-cloud/azext_spring_cloud/tests/latest/recordings/test_bind_cert_to_domain.yaml b/src/spring-cloud/azext_spring_cloud/tests/latest/recordings/test_bind_cert_to_domain.yaml new file mode 100644 index 00000000000..836cff0af32 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/tests/latest/recordings/test_bind_cert_to_domain.yaml @@ -0,0 +1,728 @@ +interactions: +- request: + body: '{"properties": {"vaultUri": "https://integration-test-prod.vault.azure.net/", + "keyVaultCertName": "cli-unittest"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud certificate add + Connection: + - keep-alive + Content-Length: + - '114' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --name --vault-uri --vault-certificate-name -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","vaultUri":"https://integration-test-prod.vault.azure.net/","keyVaultCertName":"cli-unittest","certVersion":"210525ac4b3d4a0d8431ab7e64cd11f8","issuer":"*.asc-test.net","expirationDate":"2021-05-08T04:54:02.000+0000","activateDate":"2020-05-08T04:44:02.000+0000","subjectName":"CN=*.asc-test.net","dnsNames":["cli.asc-test.net"]},"type":"Microsoft.AppPlatform/Spring/certificates","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert","name":"test-cert"}' + headers: + cache-control: + - no-cache + content-length: + - '624' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:37 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud certificate show + Connection: + - keep-alive + ParameterSetName: + - --name -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","vaultUri":"https://integration-test-prod.vault.azure.net/","keyVaultCertName":"cli-unittest","certVersion":"210525ac4b3d4a0d8431ab7e64cd11f8","issuer":"*.asc-test.net","expirationDate":"2021-05-08T04:54:02.000+0000","activateDate":"2020-05-08T04:44:02.000+0000","subjectName":"CN=*.asc-test.net","dnsNames":["cli.asc-test.net"]},"type":"Microsoft.AppPlatform/Spring/certificates","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert","name":"test-cert"}' + headers: + cache-control: + - no-cache + content-length: + - '624' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:39 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud certificate list + Connection: + - keep-alive + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates?api-version=2019-05-01-preview + response: + body: + string: '{"value":[{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","vaultUri":"https://integration-test-prod.vault.azure.net/","keyVaultCertName":"cli-unittest","certVersion":"210525ac4b3d4a0d8431ab7e64cd11f8","issuer":"*.asc-test.net","expirationDate":"2021-05-08T04:54:02.000+0000","activateDate":"2020-05-08T04:44:02.000+0000","subjectName":"CN=*.asc-test.net","dnsNames":["cli.asc-test.net"]},"type":"Microsoft.AppPlatform/Spring/certificates","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert","name":"test-cert"}]}' + headers: + cache-control: + - no-cache + content-length: + - '636' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:41 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: '{"properties": {}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain bind + Connection: + - keep-alive + Content-Length: + - '18' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --domain-name --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"appName":"test-app"},"type":"Microsoft.AppPlatform/Spring/apps/domains","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net","name":"cli.asc-test.net"}' + headers: + cache-control: + - no-cache + content-length: + - '283' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain show + Connection: + - keep-alive + ParameterSetName: + - --domain-name --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"appName":"test-app"},"type":"Microsoft.AppPlatform/Spring/apps/domains","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net","name":"cli.asc-test.net"}' + headers: + cache-control: + - no-cache + content-length: + - '283' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain list + Connection: + - keep-alive + ParameterSetName: + - --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains?api-version=2019-05-01-preview + response: + body: + string: '{"value":[{"properties":{"appName":"test-app"},"type":"Microsoft.AppPlatform/Spring/apps/domains","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net","name":"cli.asc-test.net"}]}' + headers: + cache-control: + - no-cache + content-length: + - '295' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:46 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain update + Connection: + - keep-alive + ParameterSetName: + - --domain-name --certificate --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","vaultUri":"https://integration-test-prod.vault.azure.net/","keyVaultCertName":"cli-unittest","certVersion":"210525ac4b3d4a0d8431ab7e64cd11f8","issuer":"*.asc-test.net","expirationDate":"2021-05-08T04:54:02.000+0000","activateDate":"2020-05-08T04:44:02.000+0000","subjectName":"CN=*.asc-test.net","dnsNames":["cli.asc-test.net"]},"type":"Microsoft.AppPlatform/Spring/certificates","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert","name":"test-cert"}' + headers: + cache-control: + - no-cache + content-length: + - '624' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: '{"properties": {"thumbprint": "839dbe007ebc9aeb7150d58b1474dd955e684f18", + "certName": "test-cert"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain update + Connection: + - keep-alive + Content-Length: + - '99' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --domain-name --certificate --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","appName":"test-app","certName":"test-cert"},"type":"Microsoft.AppPlatform/Spring/apps/domains","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net","name":"cli.asc-test.net"}' + headers: + cache-control: + - no-cache + content-length: + - '362' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:49 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain unbind + Connection: + - keep-alive + ParameterSetName: + - --domain-name --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","appName":"test-app","certName":"test-cert"},"type":"Microsoft.AppPlatform/Spring/apps/domains","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net","name":"cli.asc-test.net"}' + headers: + cache-control: + - no-cache + content-length: + - '362' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:50 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain unbind + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --domain-name --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Fri, 08 May 2020 05:02:50 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain show + Connection: + - keep-alive + ParameterSetName: + - --domain-name --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + response: + body: + string: '{"error":{"code":"EntityNotFound","message":"CustomDomain with name + ''cli.asc-test.net'' not found","target":null,"details":null}}' + headers: + cache-control: + - no-cache + content-length: + - '128' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:52 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud certificate remove + Connection: + - keep-alive + ParameterSetName: + - --name -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","vaultUri":"https://integration-test-prod.vault.azure.net/","keyVaultCertName":"cli-unittest","certVersion":"210525ac4b3d4a0d8431ab7e64cd11f8","issuer":"*.asc-test.net","expirationDate":"2021-05-08T04:54:02.000+0000","activateDate":"2020-05-08T04:44:02.000+0000","subjectName":"CN=*.asc-test.net","dnsNames":["cli.asc-test.net"]},"type":"Microsoft.AppPlatform/Spring/certificates","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert","name":"test-cert"}' + headers: + cache-control: + - no-cache + content-length: + - '624' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:53 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud certificate remove + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Fri, 08 May 2020 05:02:53 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud certificate show + Connection: + - keep-alive + ParameterSetName: + - --name -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + response: + body: + string: '{"error":{"code":"EntityNotFound","message":"CertificateName ''test-cert'' + not found","target":null,"details":null}}' + headers: + cache-control: + - no-cache + content-length: + - '114' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 404 + message: Not Found +version: 1 diff --git a/src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_scenario.py b/src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_scenario.py index eb45ceb0a72..1a3ba0d6a89 100644 --- a/src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_scenario.py +++ b/src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_scenario.py @@ -6,8 +6,61 @@ import os import unittest +from knack.util import CLIError from azure_devtools.scenario_tests import AllowLargeResponse -from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) +from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, record_only) +# pylint: disable=line-too-long +# pylint: disable=too-many-lines TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +@record_only() +class CustomDomainTests(ScenarioTest): + + def test_bind_cert_to_domain(self): + self.kwargs.update({ + 'cert': 'test-cert', + 'keyVaultUri': 'https://integration-test-prod.vault.azure.net/', + 'KeyVaultCertName': 'cli-unittest', + 'domain': 'cli.asc-test.net', + 'app': 'test-app', + 'serviceName': 'cli-unittest', + 'rg': 'cli' + }) + + self.cmd('spring-cloud certificate add --name {cert} --vault-uri {keyVaultUri} --vault-certificate-name {KeyVaultCertName} -g {rg} -s {serviceName}', checks=[ + self.check('name', '{cert}') + ]) + + self.cmd('spring-cloud certificate show --name {cert} -g {rg} -s {serviceName}', checks=[ + self.check('name', '{cert}') + ]) + + result = self.cmd('spring-cloud certificate list -g {rg} -s {serviceName}').get_output_in_json() + self.assertTrue(len(result) > 0) + + self.cmd('spring-cloud app custom-domain bind --domain-name {domain} --app {app} -g {rg} -s {serviceName}', checks=[ + self.check('name', '{domain}') + ]) + + self.cmd('spring-cloud app custom-domain show --domain-name {domain} --app {app} -g {rg} -s {serviceName}', checks=[ + self.check('name', '{domain}'), + self.check('properties.appName', '{app}') + ]) + + result = self.cmd('spring-cloud app custom-domain list --app {app} -g {rg} -s {serviceName}').get_output_in_json() + self.assertTrue(len(result) > 0) + + self.cmd('spring-cloud app custom-domain update --domain-name {domain} --certificate {cert} --app {app} -g {rg} -s {serviceName}', checks=[ + self.check('name', '{domain}'), + self.check('properties.appName', '{app}'), + self.check('properties.certName', '{cert}') + ]) + + self.cmd('spring-cloud app custom-domain unbind --domain-name {domain} --app {app} -g {rg} -s {serviceName}') + self.cmd('spring-cloud app custom-domain show --domain-name {domain} --app {app} -g {rg} -s {serviceName}', expect_failure=True) + + self.cmd('spring-cloud certificate remove --name {cert} -g {rg} -s {serviceName}') + self.cmd('spring-cloud certificate show --name {cert} -g {rg} -s {serviceName}', expect_failure=True) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/__init__.py index 7183870ee56..0260537a02b 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/__init__.py @@ -1,6 +1 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - __path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/_app_platform_management_client.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/_app_platform_management_client.py index 176133a5f29..6081e8e91e6 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/_app_platform_management_client.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/_app_platform_management_client.py @@ -16,6 +16,8 @@ from .operations import ServicesOperations from .operations import AppsOperations from .operations import BindingsOperations +from .operations import CertificatesOperations +from .operations import CustomDomainsOperations from .operations import DeploymentsOperations from .operations import Operations from . import models @@ -33,6 +35,10 @@ class AppPlatformManagementClient(SDKClient): :vartype apps: azure.mgmt.appplatform.operations.AppsOperations :ivar bindings: Bindings operations :vartype bindings: azure.mgmt.appplatform.operations.BindingsOperations + :ivar certificates: Certificates operations + :vartype certificates: azure.mgmt.appplatform.operations.CertificatesOperations + :ivar custom_domains: CustomDomains operations + :vartype custom_domains: azure.mgmt.appplatform.operations.CustomDomainsOperations :ivar deployments: Deployments operations :vartype deployments: azure.mgmt.appplatform.operations.DeploymentsOperations :ivar operations: Operations operations @@ -65,6 +71,10 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.bindings = BindingsOperations( self._client, self.config, self._serialize, self._deserialize) + self.certificates = CertificatesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.custom_domains = CustomDomainsOperations( + self._client, self.config, self._serialize, self._deserialize) self.deployments = DeploymentsOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/__init__.py index aaaceb0bcf2..128d3f0f9e5 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/__init__.py @@ -14,10 +14,16 @@ from ._models_py3 import AppResourceProperties from ._models_py3 import BindingResource from ._models_py3 import BindingResourceProperties + from ._models_py3 import CertificateProperties + from ._models_py3 import CertificateResource from ._models_py3 import ClusterResourceProperties from ._models_py3 import ConfigServerGitProperty from ._models_py3 import ConfigServerProperties from ._models_py3 import ConfigServerSettings + from ._models_py3 import CustomDomainProperties + from ._models_py3 import CustomDomainResource + from ._models_py3 import CustomDomainValidatePayload + from ._models_py3 import CustomDomainValidateResult from ._models_py3 import DeploymentInstance from ._models_py3 import DeploymentResource from ._models_py3 import DeploymentResourceProperties @@ -26,7 +32,6 @@ from ._models_py3 import GitPatternRepository from ._models_py3 import LogFileUrlResponse from ._models_py3 import LogSpecification - from ._models_py3 import ManagedIdentityProperties from ._models_py3 import MetricDimension from ._models_py3 import MetricSpecification from ._models_py3 import NameAvailability @@ -51,10 +56,16 @@ from ._models import AppResourceProperties from ._models import BindingResource from ._models import BindingResourceProperties + from ._models import CertificateProperties + from ._models import CertificateResource from ._models import ClusterResourceProperties from ._models import ConfigServerGitProperty from ._models import ConfigServerProperties from ._models import ConfigServerSettings + from ._models import CustomDomainProperties + from ._models import CustomDomainResource + from ._models import CustomDomainValidatePayload + from ._models import CustomDomainValidateResult from ._models import DeploymentInstance from ._models import DeploymentResource from ._models import DeploymentResourceProperties @@ -63,7 +74,6 @@ from ._models import GitPatternRepository from ._models import LogFileUrlResponse from ._models import LogSpecification - from ._models import ManagedIdentityProperties from ._models import MetricDimension from ._models import MetricSpecification from ._models import NameAvailability @@ -85,6 +95,8 @@ from ._models import UserSourceInfo from ._paged_models import AppResourcePaged from ._paged_models import BindingResourcePaged +from ._paged_models import CertificateResourcePaged +from ._paged_models import CustomDomainResourcePaged from ._paged_models import DeploymentResourcePaged from ._paged_models import OperationDetailPaged from ._paged_models import ServiceResourcePaged @@ -92,7 +104,6 @@ ProvisioningState, ConfigServerState, TraceProxyState, - ManagedIdentityType, TestKeyType, AppResourceProvisioningState, UserSourceType, @@ -106,10 +117,16 @@ 'AppResourceProperties', 'BindingResource', 'BindingResourceProperties', + 'CertificateProperties', + 'CertificateResource', 'ClusterResourceProperties', 'ConfigServerGitProperty', 'ConfigServerProperties', 'ConfigServerSettings', + 'CustomDomainProperties', + 'CustomDomainResource', + 'CustomDomainValidatePayload', + 'CustomDomainValidateResult', 'DeploymentInstance', 'DeploymentResource', 'DeploymentResourceProperties', @@ -118,7 +135,6 @@ 'GitPatternRepository', 'LogFileUrlResponse', 'LogSpecification', - 'ManagedIdentityProperties', 'MetricDimension', 'MetricSpecification', 'NameAvailability', @@ -141,12 +157,13 @@ 'ServiceResourcePaged', 'AppResourcePaged', 'BindingResourcePaged', + 'CertificateResourcePaged', + 'CustomDomainResourcePaged', 'DeploymentResourcePaged', 'OperationDetailPaged', 'ProvisioningState', 'ConfigServerState', 'TraceProxyState', - 'ManagedIdentityType', 'TestKeyType', 'AppResourceProvisioningState', 'UserSourceType', diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_app_platform_management_client_enums.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_app_platform_management_client_enums.py index c4b4fd4c440..2978170fb08 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_app_platform_management_client_enums.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_app_platform_management_client_enums.py @@ -42,14 +42,6 @@ class TraceProxyState(str, Enum): updating = "Updating" -class ManagedIdentityType(str, Enum): - - none = "None" - system_assigned = "SystemAssigned" - user_assigned = "UserAssigned" - system_assigned_user_assigned = "SystemAssigned,UserAssigned" - - class TestKeyType(str, Enum): primary = "Primary" diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models.py index 62e040c706a..7fee53fad61 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models.py @@ -91,8 +91,6 @@ class AppResource(ProxyResource): :vartype type: str :param properties: Properties of the App resource :type properties: ~azure.mgmt.appplatform.models.AppResourceProperties - :param identity: The Managed Identity type of the app resource - :type identity: ~azure.mgmt.appplatform.models.ManagedIdentityProperties :param location: The GEO location of the application, always the same with its parent resource :type location: str @@ -109,14 +107,12 @@ class AppResource(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'AppResourceProperties'}, - 'identity': {'key': 'identity', 'type': 'ManagedIdentityProperties'}, 'location': {'key': 'location', 'type': 'str'}, } def __init__(self, **kwargs): super(AppResource, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) - self.identity = kwargs.get('identity', None) self.location = kwargs.get('location', None) @@ -136,6 +132,10 @@ class AppResourceProperties(Model): ~azure.mgmt.appplatform.models.AppResourceProvisioningState :param active_deployment_name: Name of the active deployment of the App :type active_deployment_name: str + :param fqdn: Fully qualified dns Name. + :type fqdn: str + :param https_only: Indicate if only https is allowed. + :type https_only: bool :ivar created_time: Date time when the resource is created :vartype created_time: datetime :param temporary_disk: Temporary disk settings @@ -155,6 +155,8 @@ class AppResourceProperties(Model): 'url': {'key': 'url', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'active_deployment_name': {'key': 'activeDeploymentName', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'https_only': {'key': 'httpsOnly', 'type': 'bool'}, 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, 'temporary_disk': {'key': 'temporaryDisk', 'type': 'TemporaryDisk'}, 'persistent_disk': {'key': 'persistentDisk', 'type': 'PersistentDisk'}, @@ -166,6 +168,8 @@ def __init__(self, **kwargs): self.url = None self.provisioning_state = None self.active_deployment_name = kwargs.get('active_deployment_name', None) + self.fqdn = kwargs.get('fqdn', None) + self.https_only = kwargs.get('https_only', None) self.created_time = None self.temporary_disk = kwargs.get('temporary_disk', None) self.persistent_disk = kwargs.get('persistent_disk', None) @@ -260,6 +264,99 @@ def __init__(self, **kwargs): self.updated_at = None +class CertificateProperties(Model): + """Certificate resource payload. + + All required parameters must be populated in order to send to Azure. + + :param thumbprint: The thumbprint of certificate. + :type thumbprint: str + :param vault_uri: Required. The vault uri of user key vault. + :type vault_uri: str + :param key_vault_cert_name: Required. The certificate name of key vault. + :type key_vault_cert_name: str + :param cert_version: The certificate version of key vault. + :type cert_version: str + :param issuer: The issuer of certificate. + :type issuer: str + :param issued_date: The issue date of certificate. + :type issued_date: str + :param expiration_date: The expiration date of certificate. + :type expiration_date: str + :param activate_date: The activate date of certificate. + :type activate_date: str + :param subject_name: The subject name of certificate. + :type subject_name: str + :param dns_names: The domain list of certificate. + :type dns_names: list[str] + """ + + _validation = { + 'vault_uri': {'required': True}, + 'key_vault_cert_name': {'required': True}, + } + + _attribute_map = { + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'vault_uri': {'key': 'vaultUri', 'type': 'str'}, + 'key_vault_cert_name': {'key': 'keyVaultCertName', 'type': 'str'}, + 'cert_version': {'key': 'certVersion', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'issued_date': {'key': 'issuedDate', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'activate_date': {'key': 'activateDate', 'type': 'str'}, + 'subject_name': {'key': 'subjectName', 'type': 'str'}, + 'dns_names': {'key': 'dnsNames', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(CertificateProperties, self).__init__(**kwargs) + self.thumbprint = kwargs.get('thumbprint', None) + self.vault_uri = kwargs.get('vault_uri', None) + self.key_vault_cert_name = kwargs.get('key_vault_cert_name', None) + self.cert_version = kwargs.get('cert_version', None) + self.issuer = kwargs.get('issuer', None) + self.issued_date = kwargs.get('issued_date', None) + self.expiration_date = kwargs.get('expiration_date', None) + self.activate_date = kwargs.get('activate_date', None) + self.subject_name = kwargs.get('subject_name', None) + self.dns_names = kwargs.get('dns_names', None) + + +class CertificateResource(ProxyResource): + """Certificate resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the certificate resource payload. + :type properties: ~azure.mgmt.appplatform.models.CertificateProperties + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'CertificateProperties'}, + } + + def __init__(self, **kwargs): + super(CertificateResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + class CloudError(Model): """An error response from the service. @@ -473,6 +570,106 @@ def __init__(self, **kwargs): self.git_property = kwargs.get('git_property', None) +class CustomDomainProperties(Model): + """Custom domain of app resource payload. + + :param thumbprint: The thumbprint of bound certificate. + :type thumbprint: str + :param app_name: The app name of domain. + :type app_name: str + :param cert_name: The bound certificate name of domain. + :type cert_name: str + """ + + _attribute_map = { + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'app_name': {'key': 'appName', 'type': 'str'}, + 'cert_name': {'key': 'certName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomDomainProperties, self).__init__(**kwargs) + self.thumbprint = kwargs.get('thumbprint', None) + self.app_name = kwargs.get('app_name', None) + self.cert_name = kwargs.get('cert_name', None) + + +class CustomDomainResource(ProxyResource): + """Custom domain resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the custom domain resource. + :type properties: ~azure.mgmt.appplatform.models.CustomDomainProperties + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'CustomDomainProperties'}, + } + + def __init__(self, **kwargs): + super(CustomDomainResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class CustomDomainValidatePayload(Model): + """Custom domain validate payload. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name to be validated + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomDomainValidatePayload, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class CustomDomainValidateResult(Model): + """Validation result for custom domain. + + :param is_valid: Indicates if domain name is valid. + :type is_valid: bool + :param message: Message of why domain name is invalid. + :type message: str + """ + + _attribute_map = { + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomDomainValidateResult, self).__init__(**kwargs) + self.is_valid = kwargs.get('is_valid', None) + self.message = kwargs.get('message', None) + + class DeploymentInstance(Model): """Deployment instance payload. @@ -782,31 +979,6 @@ def __init__(self, **kwargs): self.blob_duration = kwargs.get('blob_duration', None) -class ManagedIdentityProperties(Model): - """Managed identity properties retrieved from ARM request headers. - - :param type: Possible values include: 'None', 'SystemAssigned', - 'UserAssigned', 'SystemAssigned,UserAssigned' - :type type: str or ~azure.mgmt.appplatform.models.ManagedIdentityType - :param principal_id: - :type principal_id: str - :param tenant_id: - :type tenant_id: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ManagedIdentityProperties, self).__init__(**kwargs) - self.type = kwargs.get('type', None) - self.principal_id = kwargs.get('principal_id', None) - self.tenant_id = kwargs.get('tenant_id', None) - - class MetricDimension(Model): """Specifications of the Dimension of metrics. diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py index 0e84315de2d..f15bff32d6f 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py @@ -91,8 +91,6 @@ class AppResource(ProxyResource): :vartype type: str :param properties: Properties of the App resource :type properties: ~azure.mgmt.appplatform.models.AppResourceProperties - :param identity: The Managed Identity type of the app resource - :type identity: ~azure.mgmt.appplatform.models.ManagedIdentityProperties :param location: The GEO location of the application, always the same with its parent resource :type location: str @@ -109,14 +107,12 @@ class AppResource(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'AppResourceProperties'}, - 'identity': {'key': 'identity', 'type': 'ManagedIdentityProperties'}, 'location': {'key': 'location', 'type': 'str'}, } - def __init__(self, *, properties=None, identity=None, location: str=None, **kwargs) -> None: + def __init__(self, *, properties=None, location: str=None, **kwargs) -> None: super(AppResource, self).__init__(**kwargs) self.properties = properties - self.identity = identity self.location = location @@ -136,6 +132,10 @@ class AppResourceProperties(Model): ~azure.mgmt.appplatform.models.AppResourceProvisioningState :param active_deployment_name: Name of the active deployment of the App :type active_deployment_name: str + :param fqdn: Fully qualified dns Name. + :type fqdn: str + :param https_only: Indicate if only https is allowed. + :type https_only: bool :ivar created_time: Date time when the resource is created :vartype created_time: datetime :param temporary_disk: Temporary disk settings @@ -155,17 +155,21 @@ class AppResourceProperties(Model): 'url': {'key': 'url', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'active_deployment_name': {'key': 'activeDeploymentName', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'https_only': {'key': 'httpsOnly', 'type': 'bool'}, 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, 'temporary_disk': {'key': 'temporaryDisk', 'type': 'TemporaryDisk'}, 'persistent_disk': {'key': 'persistentDisk', 'type': 'PersistentDisk'}, } - def __init__(self, *, public: bool=None, active_deployment_name: str=None, temporary_disk=None, persistent_disk=None, **kwargs) -> None: + def __init__(self, *, public: bool=None, active_deployment_name: str=None, fqdn: str=None, https_only: bool=None, temporary_disk=None, persistent_disk=None, **kwargs) -> None: super(AppResourceProperties, self).__init__(**kwargs) self.public = public self.url = None self.provisioning_state = None self.active_deployment_name = active_deployment_name + self.fqdn = fqdn + self.https_only = https_only self.created_time = None self.temporary_disk = temporary_disk self.persistent_disk = persistent_disk @@ -260,6 +264,99 @@ def __init__(self, *, resource_name: str=None, resource_type: str=None, resource self.updated_at = None +class CertificateProperties(Model): + """Certificate resource payload. + + All required parameters must be populated in order to send to Azure. + + :param thumbprint: The thumbprint of certificate. + :type thumbprint: str + :param vault_uri: Required. The vault uri of user key vault. + :type vault_uri: str + :param key_vault_cert_name: Required. The certificate name of key vault. + :type key_vault_cert_name: str + :param cert_version: The certificate version of key vault. + :type cert_version: str + :param issuer: The issuer of certificate. + :type issuer: str + :param issued_date: The issue date of certificate. + :type issued_date: str + :param expiration_date: The expiration date of certificate. + :type expiration_date: str + :param activate_date: The activate date of certificate. + :type activate_date: str + :param subject_name: The subject name of certificate. + :type subject_name: str + :param dns_names: The domain list of certificate. + :type dns_names: list[str] + """ + + _validation = { + 'vault_uri': {'required': True}, + 'key_vault_cert_name': {'required': True}, + } + + _attribute_map = { + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'vault_uri': {'key': 'vaultUri', 'type': 'str'}, + 'key_vault_cert_name': {'key': 'keyVaultCertName', 'type': 'str'}, + 'cert_version': {'key': 'certVersion', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'issued_date': {'key': 'issuedDate', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'activate_date': {'key': 'activateDate', 'type': 'str'}, + 'subject_name': {'key': 'subjectName', 'type': 'str'}, + 'dns_names': {'key': 'dnsNames', 'type': '[str]'}, + } + + def __init__(self, *, vault_uri: str, key_vault_cert_name: str, thumbprint: str=None, cert_version: str=None, issuer: str=None, issued_date: str=None, expiration_date: str=None, activate_date: str=None, subject_name: str=None, dns_names=None, **kwargs) -> None: + super(CertificateProperties, self).__init__(**kwargs) + self.thumbprint = thumbprint + self.vault_uri = vault_uri + self.key_vault_cert_name = key_vault_cert_name + self.cert_version = cert_version + self.issuer = issuer + self.issued_date = issued_date + self.expiration_date = expiration_date + self.activate_date = activate_date + self.subject_name = subject_name + self.dns_names = dns_names + + +class CertificateResource(ProxyResource): + """Certificate resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the certificate resource payload. + :type properties: ~azure.mgmt.appplatform.models.CertificateProperties + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'CertificateProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(CertificateResource, self).__init__(**kwargs) + self.properties = properties + + class CloudError(Model): """An error response from the service. @@ -473,6 +570,106 @@ def __init__(self, *, git_property=None, **kwargs) -> None: self.git_property = git_property +class CustomDomainProperties(Model): + """Custom domain of app resource payload. + + :param thumbprint: The thumbprint of bound certificate. + :type thumbprint: str + :param app_name: The app name of domain. + :type app_name: str + :param cert_name: The bound certificate name of domain. + :type cert_name: str + """ + + _attribute_map = { + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'app_name': {'key': 'appName', 'type': 'str'}, + 'cert_name': {'key': 'certName', 'type': 'str'}, + } + + def __init__(self, *, thumbprint: str=None, app_name: str=None, cert_name: str=None, **kwargs) -> None: + super(CustomDomainProperties, self).__init__(**kwargs) + self.thumbprint = thumbprint + self.app_name = app_name + self.cert_name = cert_name + + +class CustomDomainResource(ProxyResource): + """Custom domain resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the custom domain resource. + :type properties: ~azure.mgmt.appplatform.models.CustomDomainProperties + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'CustomDomainProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(CustomDomainResource, self).__init__(**kwargs) + self.properties = properties + + +class CustomDomainValidatePayload(Model): + """Custom domain validate payload. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name to be validated + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(CustomDomainValidatePayload, self).__init__(**kwargs) + self.name = name + + +class CustomDomainValidateResult(Model): + """Validation result for custom domain. + + :param is_valid: Indicates if domain name is valid. + :type is_valid: bool + :param message: Message of why domain name is invalid. + :type message: str + """ + + _attribute_map = { + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, is_valid: bool=None, message: str=None, **kwargs) -> None: + super(CustomDomainValidateResult, self).__init__(**kwargs) + self.is_valid = is_valid + self.message = message + + class DeploymentInstance(Model): """Deployment instance payload. @@ -782,31 +979,6 @@ def __init__(self, *, name: str=None, display_name: str=None, blob_duration: str self.blob_duration = blob_duration -class ManagedIdentityProperties(Model): - """Managed identity properties retrieved from ARM request headers. - - :param type: Possible values include: 'None', 'SystemAssigned', - 'UserAssigned', 'SystemAssigned,UserAssigned' - :type type: str or ~azure.mgmt.appplatform.models.ManagedIdentityType - :param principal_id: - :type principal_id: str - :param tenant_id: - :type tenant_id: str - """ - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - } - - def __init__(self, *, type=None, principal_id: str=None, tenant_id: str=None, **kwargs) -> None: - super(ManagedIdentityProperties, self).__init__(**kwargs) - self.type = type - self.principal_id = principal_id - self.tenant_id = tenant_id - - class MetricDimension(Model): """Specifications of the Dimension of metrics. diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_paged_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_paged_models.py index 248668eb6cb..63c872c720b 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_paged_models.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_paged_models.py @@ -51,6 +51,32 @@ class BindingResourcePaged(Paged): def __init__(self, *args, **kwargs): super(BindingResourcePaged, self).__init__(*args, **kwargs) +class CertificateResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`CertificateResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CertificateResource]'} + } + + def __init__(self, *args, **kwargs): + + super(CertificateResourcePaged, self).__init__(*args, **kwargs) +class CustomDomainResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`CustomDomainResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CustomDomainResource]'} + } + + def __init__(self, *args, **kwargs): + + super(CustomDomainResourcePaged, self).__init__(*args, **kwargs) class DeploymentResourcePaged(Paged): """ A paging container for iterating over a list of :class:`DeploymentResource ` object diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py index caf4e58455d..e6ebd5353e7 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py @@ -12,6 +12,8 @@ from ._services_operations import ServicesOperations from ._apps_operations import AppsOperations from ._bindings_operations import BindingsOperations +from ._certificates_operations import CertificatesOperations +from ._custom_domains_operations import CustomDomainsOperations from ._deployments_operations import DeploymentsOperations from ._operations import Operations @@ -19,6 +21,8 @@ 'ServicesOperations', 'AppsOperations', 'BindingsOperations', + 'CertificatesOperations', + 'CustomDomainsOperations', 'DeploymentsOperations', 'Operations', ] diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_apps_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_apps_operations.py index 4b8a5e5d58c..482213a628a 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_apps_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_apps_operations.py @@ -113,7 +113,9 @@ def get( def _create_or_update_initial( - self, resource_group_name, service_name, app_name, app_resource, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, app_name, properties=None, location=None, custom_headers=None, raw=False, **operation_config): + app_resource = models.AppResource(properties=properties, location=location) + # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -165,7 +167,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, service_name, app_name, app_resource, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, service_name, app_name, properties=None, location=None, custom_headers=None, raw=False, polling=True, **operation_config): """Create a new App or update an exiting App. :param resource_group_name: The name of the resource group that @@ -176,8 +178,11 @@ def create_or_update( :type service_name: str :param app_name: The name of the App resource. :type app_name: str - :param app_resource: Parameters for the create or update operation - :type app_resource: ~azure.mgmt.appplatform.models.AppResource + :param properties: Properties of the App resource + :type properties: ~azure.mgmt.appplatform.models.AppResourceProperties + :param location: The GEO location of the application, always the same + with its parent resource + :type location: 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 @@ -195,7 +200,8 @@ def create_or_update( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, - app_resource=app_resource, + properties=properties, + location=location, custom_headers=custom_headers, raw=True, **operation_config @@ -279,7 +285,9 @@ def delete( def _update_initial( - self, resource_group_name, service_name, app_name, app_resource, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, app_name, properties=None, location=None, custom_headers=None, raw=False, **operation_config): + app_resource = models.AppResource(properties=properties, location=location) + # Construct URL url = self.update.metadata['url'] path_format_arguments = { @@ -331,7 +339,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, service_name, app_name, app_resource, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, service_name, app_name, properties=None, location=None, custom_headers=None, raw=False, polling=True, **operation_config): """Operation to update an exiting App. :param resource_group_name: The name of the resource group that @@ -342,8 +350,11 @@ def update( :type service_name: str :param app_name: The name of the App resource. :type app_name: str - :param app_resource: Parameters for the update operation - :type app_resource: ~azure.mgmt.appplatform.models.AppResource + :param properties: Properties of the App resource + :type properties: ~azure.mgmt.appplatform.models.AppResourceProperties + :param location: The GEO location of the application, always the same + with its parent resource + :type location: 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 @@ -361,7 +372,8 @@ def update( resource_group_name=resource_group_name, service_name=service_name, app_name=app_name, - app_resource=app_resource, + properties=properties, + location=location, custom_headers=custom_headers, raw=True, **operation_config diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_certificates_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_certificates_operations.py new file mode 100644 index 00000000000..00428016758 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_certificates_operations.py @@ -0,0 +1,312 @@ +# 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 CertificatesOperations(object): + """CertificatesOperations 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: "2019-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-05-01-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, certificate_name, custom_headers=None, raw=False, **operation_config): + """Get the certificate resource. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param certificate_name: The name of the certificate resource. + :type certificate_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: CertificateResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.models.CertificateResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CertificateResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}'} + + def create_or_update( + self, resource_group_name, service_name, certificate_name, properties=None, custom_headers=None, raw=False, **operation_config): + """Create or update certificate resource. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param certificate_name: The name of the certificate resource. + :type certificate_name: str + :param properties: Properties of the certificate resource payload. + :type properties: ~azure.mgmt.appplatform.models.CertificateProperties + :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: CertificateResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.models.CertificateResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + certificate_resource = models.CertificateResource(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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_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(certificate_resource, 'CertificateResource') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CertificateResource', 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.AppPlatform/Spring/{serviceName}/certificates/{certificateName}'} + + def delete( + self, resource_group_name, service_name, certificate_name, custom_headers=None, raw=False, **operation_config): + """Delete the certificate resource. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param certificate_name: The name of the certificate resource. + :type certificate_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:`CloudError` + """ + # 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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}'} + + def list( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """List all the certificates of one user. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_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: An iterator like instance of CertificateResource + :rtype: + ~azure.mgmt.appplatform.models.CertificateResourcePaged[~azure.mgmt.appplatform.models.CertificateResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'serviceName': self._serialize.url("service_name", service_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') + + 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.CertificateResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates'} diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py new file mode 100644 index 00000000000..f7f88db69a4 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py @@ -0,0 +1,477 @@ +# 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 CustomDomainsOperations(object): + """CustomDomainsOperations 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: "2019-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-05-01-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, app_name, domain_name, custom_headers=None, raw=False, **operation_config): + """Get the custom domain of one lifecycle application. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param domain_name: The name of the custom domain resource. + :type domain_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: CustomDomainResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.models.CustomDomainResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CustomDomainResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} + + def create_or_update( + self, resource_group_name, service_name, app_name, domain_name, properties=None, custom_headers=None, raw=False, **operation_config): + """Create or update custom domain of one lifecycle application. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param domain_name: The name of the custom domain resource. + :type domain_name: str + :param properties: Properties of the custom domain resource. + :type properties: + ~azure.mgmt.appplatform.models.CustomDomainProperties + :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: CustomDomainResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.models.CustomDomainResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + domain_resource = models.CustomDomainResource(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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_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(domain_resource, 'CustomDomainResource') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CustomDomainResource', 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.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} + + def delete( + self, resource_group_name, service_name, app_name, domain_name, custom_headers=None, raw=False, **operation_config): + """Delete the custom domain of one lifecycle application. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param domain_name: The name of the custom domain resource. + :type domain_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:`CloudError` + """ + # 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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} + + def patch( + self, resource_group_name, service_name, app_name, domain_name, properties=None, custom_headers=None, raw=False, **operation_config): + """Update custom domain of one lifecycle application. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param domain_name: The name of the custom domain resource. + :type domain_name: str + :param properties: Properties of the custom domain resource. + :type properties: + ~azure.mgmt.appplatform.models.CustomDomainProperties + :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: CustomDomainResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.models.CustomDomainResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + domain_resource = models.CustomDomainResource(properties=properties) + + # Construct URL + url = self.patch.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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_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(domain_resource, 'CustomDomainResource') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CustomDomainResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} + + def list( + self, resource_group_name, service_name, app_name, custom_headers=None, raw=False, **operation_config): + """List the custom domains of one lifecycle application. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_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: An iterator like instance of CustomDomainResource + :rtype: + ~azure.mgmt.appplatform.models.CustomDomainResourcePaged[~azure.mgmt.appplatform.models.CustomDomainResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_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') + + 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.CustomDomainResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains'} + + def validate( + self, resource_group_name, service_name, app_name, name, custom_headers=None, raw=False, **operation_config): + """Check the resource name is valid as well as not in use. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param name: Name to be validated + :type 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: CustomDomainValidateResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.models.CustomDomainValidateResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + validate_payload = models.CustomDomainValidatePayload(name=name) + + # Construct URL + url = self.validate.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'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_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(validate_payload, 'CustomDomainValidatePayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CustomDomainValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/validate'} diff --git a/src/spring-cloud/setup.py b/src/spring-cloud/setup.py index b48b4feadd9..712fedee78a 100644 --- a/src/spring-cloud/setup.py +++ b/src/spring-cloud/setup.py @@ -16,7 +16,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.2.2' +VERSION = '0.2.3' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -37,9 +37,9 @@ # TODO: Add any additional SDK dependencies here DEPENDENCIES = [] -with open('README.rst', 'r', encoding='utf-8') as f: +with open('README.md', 'r', encoding='utf-8') as f: README = f.read() -with open('HISTORY.rst', 'r', encoding='utf-8') as f: +with open('HISTORY.md', 'r', encoding='utf-8') as f: HISTORY = f.read() setup( diff --git a/src/storage-or-preview/HISTORY.rst b/src/storage-or-preview/HISTORY.rst new file mode 100644 index 00000000000..ccd7553f641 --- /dev/null +++ b/src/storage-or-preview/HISTORY.rst @@ -0,0 +1,21 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. + +0.2.0 +++++++ +* Support --min-creation-time for ORS filter. + +0.3.0 +++++++ +* Rename `az storage account ors-policy` to `az storage account or-policy`. +* Default to `--account-name` for `--destination-account` when creating policy in destination account. + +0.4.0 +++++++ +* Rename the extension to `storage-or-policy`. \ No newline at end of file diff --git a/src/storage-or-preview/README.md b/src/storage-or-preview/README.md new file mode 100644 index 00000000000..db9a1b37441 --- /dev/null +++ b/src/storage-or-preview/README.md @@ -0,0 +1,177 @@ +# Azure CLI storage-or-preview Extension # +This is an extension for storage-or-preview features. + +### How to use ### +Install this extension using the below CLI command after release: +``` +az extension add -n storage-or-preview +``` + +### Prepare +1. Prepare general purpose v2 storage account +``` +az storage account create -n storageaccount -g groupName --kind StorageV2 +``` + +2. Enable Versioning for both source and destination storage accounts +``` +az storage account blob-service-properties update --enable-versioning --account-name srcAccountName +``` +Note: +- `--enable-versioning` is supported in [azure cli 2.3.0](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest#install), which will be officially release at 2020/03/31. +- Another option to enable Versioning in azure cli is as follows: +``` +az storage account blob-service-properties update --account-name srcAccountName --set is_versioning_enabled=True +``` + +3. Enable ChangeFeed for source storage account +``` +az storage account blob-service-properties update --enable-change-feed --account-name srcAccountName +``` + +### Included Features +#### ORS Policy: +Manage data policy rules associated with a storage account: [more info](https://docs.microsoft.com/azure/storage/common/storage-lifecycle-managment-concepts)\ + +*Examples:* + +##### Create ORS Policy on destination storage account +1. Using JSON file or JSON string. +``` +az storage account or-policy create \ + --account-name destAccountName \ + --resource-group groupName \ + --properties @{path} +``` +2. Using command parameters. +``` +az storage account or-policy create \ + --account-name destAccountName \ + --resource-group groupName \ + --source-account srcAccountName \ + --destination-account destAccountName \ + --source-container srcContainer \ + --destination-container destContainer \ +``` +``` +az storage account or-policy create \ + --account-name destAccountName \ + --resource-group groupName \ + --source-account srcAccountName \ + --destination-account destAccountName \ + --source-container srcContainer \ + --min-creation-time '2020-02-19T16:05:00Z' \ + --prefix-match blobA blobB +``` + +3. Create Object Replication Policy to source storage account through policy associated with destination storage account. +``` +az storage account or-policy show -g groupName -n destAccountName --policy-id "3496e652-4cea-4581-b2f7-c86b3971ba92" | az storage account or-policy create -g ResourceGroupName -n srcAccountName -p "@-" +``` + +To save the policyId/ruleId in PowerShell Scripts, you can use: + +`$policyId = (az storage account or-policy create --account-name accountName --resource-group groupName --properties @{path}) --query policyId)` + +`$ruleId = (az storage account or-policy create --account-name accountName --resource-group groupName --properties @{path}) --query rules.ruleId)` + +##### List OR Policies on storage account +``` +az storage account or-policy list \ + --account-name accountName \ + --resource-group groupName +``` + +##### Show OR Policy on storage account +``` +az storage account or-policy show \ + --policy-id $policyId \ + --account-name accountName \ + --resource-group groupName +``` + +##### Update OR Policy on storage account +Change source storage account name of existing OR policy. +``` +az storage account or-policy update \ + --policy-id $policyId \ + --account-name destAccountName \ + --resource-group groupName \ + -s newSourceAccount +``` + +Update existing OR policy through json file. +``` +az storage account or-policy update \ + --policy @policy.json \ + --account-name destAccountName \ + --resource-group groupName \ +``` +##### Add rule to existing OR Policy +``` +az storage account or-policy rule add \ + --policy-id $policyId \ + --account-name accountName \ + --resource-group groupName \ + --destination-container destContainer \ + --source-container srcContainer \ + --prefix-match blobA blobB \ + --min-creation-time '2020-02-19T16:05:00Z' +``` + +##### List rules for OR Policy +``` +az storage account or-policy rule list \ + --policy-id $policyId \ + --account-name accountName \ + --resource-group groupName +``` + +##### Show properties of specific rule in OR Policy +``` +az storage account or-policy rule show \ + --rule-id $ruleId \ + --policy-id $policyId \ + --account-name accountName \ + --resource-group groupName +``` + +##### Update properties for specific OR Policy Rule +Change prefix match filter properties. +``` +az storage account or-policy rule update \ + --rule-id $ruleId \ + --policy-id $policyId \ + --account-name accountName \ + --resource-group groupName \ + --prefix-match blobA +``` + +Change min creation time in filter properties. +``` +az storage account or-policy rule update \ + --rule-id $ruleId \ + --policy-id $policyId \ + --account-name accountName \ + --resource-group groupName \ + --min-creation-time '2020-02-19T16:05:00Z' +``` +##### Remove the specified rule in existing OR Policy +``` +az storage account or-policy rule remove \ + --rule-id $ruleId \ + --policy-id $policyId \ + --account-name accountName \ + --resource-group groupName +``` + +##### Delete the specified OR Policy for storage account +``` +az storage account or-policy delete \ + --policy-id $policyId \ + --account-name accountName \ + --resource-group groupName +``` + + +If you have issues, please give feedback by opening an issue at https://github.com/Azure/azure-cli-extensions/issues. diff --git a/src/storage-or-preview/__init__.py b/src/storage-or-preview/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/storage-or-preview/azext_storage_or_preview/__init__.py b/src/storage-or-preview/azext_storage_or_preview/__init__.py new file mode 100644 index 00000000000..e3bafc20138 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/__init__.py @@ -0,0 +1,37 @@ +# -------------------------------------------------------------------------------------------- +# 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 azure.cli.core.profiles import register_resource_type + +from ._help import helps # pylint: disable=unused-import +from .profiles import CUSTOM_MGMT_STORAGE_ORS + + +class StorageCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + + register_resource_type('latest', CUSTOM_MGMT_STORAGE_ORS, '2019-06-01') + storage_custom = CliCommandType(operations_tmpl='azext_storage_or_preview.custom#{}') + + super(StorageCommandsLoader, self).__init__(cli_ctx=cli_ctx, + resource_type=CUSTOM_MGMT_STORAGE_ORS, + custom_command_type=storage_custom) + + def load_command_table(self, args): + super(StorageCommandsLoader, self).load_command_table(args) + from .commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + super(StorageCommandsLoader, self).load_arguments(command) + from ._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = StorageCommandsLoader diff --git a/src/storage-or-preview/azext_storage_or_preview/_client_factory.py b/src/storage-or-preview/azext_storage_or_preview/_client_factory.py new file mode 100644 index 00000000000..3a47c499dd4 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/_client_factory.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core.commands.client_factory import get_mgmt_service_client + +from .profiles import CUSTOM_MGMT_STORAGE_ORS + + +def storage_client_factory(cli_ctx, **_): + return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_STORAGE_ORS) + + +def cf_sa(cli_ctx, _): + return storage_client_factory(cli_ctx).storage_accounts + + +def cf_or_policy(cli_ctx, _): + return storage_client_factory(cli_ctx).object_replication_policies diff --git a/src/storage-or-preview/azext_storage_or_preview/_help.py b/src/storage-or-preview/azext_storage_or_preview/_help.py new file mode 100644 index 00000000000..34de39d029b --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/_help.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.help_files import helps # pylint: disable=unused-import + + +helps['storage account or-policy'] = """ +type: group +short-summary: Manage storage account Object Replication Policy. +""" + +helps['storage account or-policy create'] = """ +type: command +short-summary: Create Object Replication Service Policy for storage account. +examples: + - name: Create Object Replication Service Policy for storage account. + text: az storage account or-policy create -g ResourceGroupName -n storageAccountName -d destAccountName -s srcAccountName --destination-container dcont --source-container scont + - name: Create Object Replication Service Policy trough json file for storage account. + text: az storage account or-policy create -g ResourceGroupName -n storageAccountName --policy @policy.json + - name: Create Object Replication Service Policy to source storage account through policy associated with destination storage account. + text: az storage account or-policy show -g ResourceGroupName -n destAccountName --policy-id "3496e652-4cea-4581-b2f7-c86b3971ba92" | az storage account or-policy create -g ResourceGroupName -n srcAccountName -p "@-" +""" + +helps['storage account or-policy list'] = """ +type: command +short-summary: List Object Replication Service Policies associated with the specified storage account. +examples: + - name: List Object Replication Service Policies associated with the specified storage account. + text: az storage account or-policy list -g ResourceGroupName -n StorageAccountName +""" + +helps['storage account or-policy delete'] = """ +type: command +short-summary: Delete specified Object Replication Service Policy associated with the specified storage account. +examples: + - name: Delete Object Replication Service Policy associated with the specified storage account. + text: az storage account or-policy delete -g ResourceGroupName -n StorageAccountName --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8" +""" + +helps['storage account or-policy show'] = """ +type: command +short-summary: Show the properties of specified Object Replication Service Policy for storage account. +examples: + - name: Show the properties of specified Object Replication Service Policy for storage account. + text: az storage account or-policy show -g ResourceGroupName -n StorageAccountName --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8" +""" + +helps['storage account or-policy update'] = """ +type: command +short-summary: Update Object Replication Service Policy properties for storage account. +examples: + - name: Update source storage account in Object Replication Service Policy. + text: az storage account or-policy update -g ResourceGroupName -n StorageAccountName --source-account newSourceAccount --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8" + - name: Update Object Replication Service Policy through json file. + text: az storage account or-policy update -g ResourceGroupName -n StorageAccountName -p @policy.json +""" + +helps['storage account or-policy rule'] = """ +type: group +short-summary: Manage Object Replication Service Policy Rules. +""" + +helps['storage account or-policy rule add'] = """ +type: command +short-summary: Add rule to the specified Object Replication Service Policy. +examples: + - name: Add rule to the specified Object Replication Service Policy. + text: az storage account or-policy rule add -g ResourceGroupName -n StorageAccountName --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8" -d destContainer -s srcContainer +""" + +helps['storage account or-policy rule list'] = """ +type: command +short-summary: List all the rules in the specified Object Replication Service Policy. +examples: + - name: List all the rules in the specified Object Replication Service Policy. + text: az storage account or-policy rule list -g ResourceGroupName -n StorageAccountName --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8" +""" + +helps['storage account or-policy rule remove'] = """ +type: command +short-summary: Remove the specified rule from the specified Object Replication Service Policy. +examples: + - name: Remove the specified rule from the specified Object Replication Service Policy. + text: az storage account or-policy rule remove -g ResourceGroupName -n StorageAccountName --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8" --rule-id "78746d86-d3b7-4397-a99c-0837e6741332" +""" + +helps['storage account or-policy rule show'] = """ +type: command +short-summary: Show the properties of specified rule in Object Replication Service Policy. +examples: + - name: Show the properties of specified rule in Object Replication Service Policy. + text: az storage account or-policy rule show -g ResourceGroupName -n StorageAccountName --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8" --rule-id "78746d86-d3b7-4397-a99c-0837e6741332" +""" + +helps['storage account or-policy rule update'] = """ +type: command +short-summary: Update rule properties to Object Replication Service Policy. +examples: + - name: Update rule properties to Object Replication Service Policy. + text: az storage account or-policy rule update -g ResourceGroupName -n StorageAccountName --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8" --rule-id "78746d86-d3b7-4397-a99c-0837e6741332" --prefix-match blobA blobB +""" diff --git a/src/storage-or-preview/azext_storage_or_preview/_params.py b/src/storage-or-preview/azext_storage_or_preview/_params.py new file mode 100644 index 00000000000..2c49c7cbaec --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/_params.py @@ -0,0 +1,74 @@ +# -------------------------------------------------------------------------------------------- +# 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 + +from knack.arguments import CLIArgumentType +from ._validators import get_datetime_type + + +def load_arguments(self, _): + + from azure.cli.core.commands.parameters import get_resource_name_completion_list + + acct_name_type = CLIArgumentType(options_list=['--account-name', '-n'], help='The storage account name.', + id_part='name', + completer=get_resource_name_completion_list('Microsoft.Storage/storageAccounts')) + or_policy_type = CLIArgumentType( + options_list=['--policy', '-p'], + help='The object replication policy definition between two storage accounts, in JSON format. ' + 'Multiple rules can be defined in one policy.' + ) + policy_id_type = CLIArgumentType( + options_list=['--policy-id'], + help='The ID of object replication policy or "default" if the policy ID is unknown.' + ) + rule_id_type = CLIArgumentType( + options_list=['--rule-id', '-r'], + help='Rule Id is auto-generated for each new rule on destination account. It is required ' + 'for put policy on source account.' + ) + prefix_math_type = CLIArgumentType( + nargs='+', arg_group='Filters', + help='Optional. Filter the results to replicate only blobs whose names begin with the specified ' + 'prefix.' + ) + min_creation_time_type = CLIArgumentType( + options_list=['--min-creation-time', '-t'], arg_group='Filters', type=get_datetime_type(True), + help="Blobs created after the time will be replicated to the destination. It must be in datetime format " + "'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z") + + with self.argument_context('storage account or-policy') as c: + c.argument('account_name', acct_name_type, id_part=None) + c.argument('object_replication_policy_id', policy_id_type) + c.argument('policy_id', policy_id_type) + c.argument('source_account', options_list=['--source-account', '-s'], + help='The source storage account name. Required when no --policy provided.') + c.argument('destination_account', options_list=['--destination-account', '-d'], + help='The destination storage account name. Required when no --policy provided.') + c.argument('properties', or_policy_type) + c.argument('prefix_match', prefix_math_type) + c.argument('min_creation_time', min_creation_time_type) + + for item in ['create', 'update']: + with self.argument_context('storage account or-policy {}'.format(item), + arg_group="Object Replication Policy Rule") as c: + c.argument('rule_id', help='Rule Id is auto-generated for each new rule on destination account. It is ' + 'required for put policy on source account.') + c.argument('source_container', options_list=['--source-container'], + help='The source storage container name. Required when no --policy provided.') + c.argument('destination_container', options_list=['--destination-container'], + help='The destination storage container name. Required when no --policy provided.') + + with self.argument_context('storage account or-policy update') as c: + c.argument('account_name', acct_name_type, id_part=None) + c.argument('properties', or_policy_type) + + with self.argument_context('storage account or-policy rule') as c: + c.argument('policy_id', policy_id_type) + c.argument('source_container', options_list=['--source-container', '-s'], + help='The source storage container name.') + c.argument('destination_container', options_list=['--destination-container', '-d'], + help='The destination storage container name.') + c.argument('rule_id', rule_id_type) diff --git a/src/storage-or-preview/azext_storage_or_preview/_validators.py b/src/storage-or-preview/azext_storage_or_preview/_validators.py new file mode 100644 index 00000000000..05f3575fef2 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/_validators.py @@ -0,0 +1,75 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +import os +from azure.cli.core.util import get_file_json, shell_safe_json_parse + + +def validate_or_policy(namespace): + error_elements = [] + if namespace.properties is None: + error_msg = "Please provide --policy in JSON format or the following arguments: " + if namespace.source_account is None: + error_elements.append("--source-account") + + if namespace.destination_account is None: + namespace.destination_account = namespace.account_name + + if error_elements: + error_msg += ", ".join(error_elements) + error_msg += " to initialize or Policy for storage account." + raise ValueError(error_msg) + else: + if os.path.exists(namespace.properties): + or_policy = get_file_json(namespace.properties) + else: + or_policy = shell_safe_json_parse(namespace.properties) + + try: + namespace.source_account = or_policy["sourceAccount"] + except KeyError: + namespace.source_account = or_policy["source_account"] + if namespace.source_account is None: + error_elements.append("source_account") + + try: + namespace.destination_account = or_policy["destinationAccount"] + except KeyError: + namespace.destination_account = or_policy["destination_account"] + + if "rules" not in or_policy.keys() or not or_policy["rules"]: + error_elements.append("rules") + error_msg = "Missing input parameters: " + if error_elements: + error_msg += ", ".join(error_elements) + error_msg += " in properties to initialize or Policy for storage account." + raise ValueError(error_msg) + namespace.properties = or_policy + + if "policyId" in or_policy.keys() and or_policy["policyId"]: + namespace.policy_id = or_policy['policyId'] + + +def get_datetime_type(to_string): + """ Validates UTC datetime. Examples of accepted forms: + 2017-12-31T01:11:59Z,2017-12-31T01:11Z or 2017-12-31T01Z or 2017-12-31 """ + from datetime import datetime + + def datetime_type(string): + """ Validates UTC datetime. Examples of accepted forms: + 2017-12-31T01:11:59Z,2017-12-31T01:11Z or 2017-12-31T01Z or 2017-12-31 """ + accepted_date_formats = ['%Y-%m-%dT%H:%M:%SZ', '%Y-%m-%dT%H:%MZ', + '%Y-%m-%dT%HZ', '%Y-%m-%d'] + target_format = '%Y-%m-%dT%H:%M:%SZ' + for form in accepted_date_formats: + try: + if to_string: + return datetime.strptime(string, form).strftime(target_format) + + return datetime.strptime(string, form) + except ValueError: + continue + raise ValueError("Input '{}' not valid. Valid example: 2000-12-31T12:59:59Z".format(string)) + + return datetime_type diff --git a/src/storage-or-preview/azext_storage_or_preview/azext_metadata.json b/src/storage-or-preview/azext_storage_or_preview/azext_metadata.json new file mode 100644 index 00000000000..55c81bf3328 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.67" +} \ No newline at end of file diff --git a/src/storage-or-preview/azext_storage_or_preview/commands.py b/src/storage-or-preview/azext_storage_or_preview/commands.py new file mode 100644 index 00000000000..97e74a70be4 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/commands.py @@ -0,0 +1,42 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core.commands import CliCommandType + +from ._client_factory import cf_or_policy +from .profiles import CUSTOM_MGMT_STORAGE_ORS +from ._validators import validate_or_policy + + +def load_command_table(self, _): + + or_policy_sdk = CliCommandType( + operations_tmpl='azext_storage_or_preview.vendored_sdks.azure_mgmt_storage.operations' + '#ObjectReplicationPoliciesOperations.{}', + client_factory=cf_or_policy, + resource_type=CUSTOM_MGMT_STORAGE_ORS + ) + + or_policy_custom_type = CliCommandType( + operations_tmpl='azext_storage_or_preview.operations.account#{}', + client_factory=cf_or_policy) + + with self.command_group('storage account or-policy', or_policy_sdk, is_preview=True, + resource_type=CUSTOM_MGMT_STORAGE_ORS, min_api='2019-06-01', + custom_command_type=or_policy_custom_type) as g: + g.show_command('show', 'get') + g.command('list', 'list') + g.custom_command('create', 'create_or_policy', validator=validate_or_policy) + g.generic_update_command('update', setter_name='update_or_policy', setter_type=or_policy_custom_type) + g.command('delete', 'delete') + + with self.command_group('storage account or-policy rule', or_policy_sdk, is_preview=True, + resource_type=CUSTOM_MGMT_STORAGE_ORS, min_api='2019-06-01', + custom_command_type=or_policy_custom_type) as g: + g.custom_show_command('show', 'get_or_rule') + g.custom_command('list', 'list_or_rules') + g.custom_command('add', 'add_or_rule') + g.custom_command('update', 'update_or_rule') + g.custom_command('remove', 'remove_or_rule') diff --git a/src/storage-or-preview/azext_storage_or_preview/operations/__init__.py b/src/storage-or-preview/azext_storage_or_preview/operations/__init__.py new file mode 100644 index 00000000000..34913fb394d --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/operations/__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/storage-or-preview/azext_storage_or_preview/operations/account.py b/src/storage-or-preview/azext_storage_or_preview/operations/account.py new file mode 100644 index 00000000000..ff361b6a5ce --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/operations/account.py @@ -0,0 +1,130 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +"""Custom operations for storage account commands""" + +from azure.cli.core.util import find_child_item + +from knack.log import get_logger +from knack.util import CLIError + +logger = get_logger(__name__) + + +def create_or_policy(cmd, client, resource_group_name, account_name, properties=None, source_account=None, + destination_account=None, policy_id="default", rule_id=None, source_container=None, + destination_container=None, min_creation_time=None, prefix_match=None): + + ObjectReplicationPolicy = cmd.get_models('ObjectReplicationPolicy') + + if properties is None: + rules = [] + ObjectReplicationPolicyRule, ObjectReplicationPolicyFilter = \ + cmd.get_models('ObjectReplicationPolicyRule', 'ObjectReplicationPolicyFilter') + if source_container and destination_container: + rule = ObjectReplicationPolicyRule( + rule_id=rule_id, + source_container=source_container, + destination_container=destination_container, + filters=ObjectReplicationPolicyFilter(prefix_match=prefix_match, min_creation_time=min_creation_time) + ) + rules.append(rule) + or_policy = ObjectReplicationPolicy(source_account=source_account, + destination_account=destination_account, + rules=rules) + else: + or_policy = properties + + return client.create_or_update(resource_group_name=resource_group_name, account_name=account_name, + object_replication_policy_id=policy_id, properties=or_policy) + + +def update_or_policy(client, parameters, resource_group_name, account_name, object_replication_policy_id=None, + properties=None, source_account=None, destination_account=None, ): + + if source_account is not None: + parameters.source_account = source_account + if destination_account is not None: + parameters.destination_account = destination_account + + if properties is not None: + parameters = properties + if "policyId" in properties.keys() and properties["policyId"]: + object_replication_policy_id = properties["policyId"] + + return client.create_or_update(resource_group_name=resource_group_name, account_name=account_name, + object_replication_policy_id=object_replication_policy_id, properties=parameters) + + +def get_or_policy(client, resource_group_name, account_name, policy_id='default'): + return client.get(resource_group_name=resource_group_name, account_name=account_name, + object_replication_policy_id=policy_id) + + +def add_or_rule(cmd, client, resource_group_name, account_name, policy_id, + source_container, destination_container, min_creation_time=None, prefix_match=None): + + """ + Initialize rule for or policy + """ + policy_properties = client.get(resource_group_name, account_name, policy_id) + + ObjectReplicationPolicyRule, ObjectReplicationPolicyFilter = \ + cmd.get_models('ObjectReplicationPolicyRule', 'ObjectReplicationPolicyFilter') + new_or_rule = ObjectReplicationPolicyRule( + source_container=source_container, + destination_container=destination_container, + filters=ObjectReplicationPolicyFilter(prefix_match=prefix_match, min_creation_time=min_creation_time) + ) + policy_properties.rules.append(new_or_rule) + return client.create_or_update(resource_group_name, account_name, policy_id, policy_properties) + + +def remove_or_rule(client, resource_group_name, account_name, policy_id, rule_id): + + or_policy = client.get(resource_group_name=resource_group_name, + account_name=account_name, + object_replication_policy_id=policy_id) + + rule = find_child_item(or_policy, rule_id, path='rules', key_path='rule_id') + or_policy.rules.remove(rule) + + return client.create_or_update(resource_group_name, account_name, policy_id, or_policy) + + +def get_or_rule(client, resource_group_name, account_name, policy_id, rule_id): + policy_properties = client.get(resource_group_name, account_name, policy_id) + for rule in policy_properties.rules: + if rule.rule_id == rule_id: + return rule + raise CLIError("{} does not exist.".format(rule_id)) + + +def list_or_rules(client, resource_group_name, account_name, policy_id): + policy_properties = client.get(resource_group_name, account_name, policy_id) + return policy_properties.rules + + +def update_or_rule(client, resource_group_name, account_name, policy_id, rule_id, source_container=None, + destination_container=None, min_creation_time=None, prefix_match=None): + + policy_properties = client.get(resource_group_name, account_name, policy_id) + + for i, rule in enumerate(policy_properties.rules): + if rule.rule_id == rule_id: + if destination_container is not None: + policy_properties.rules[i].destination_container = destination_container + if source_container is not None: + policy_properties.rules[i].source_container = source_container + if min_creation_time is not None: + policy_properties.rules[i].filters.min_creation_time = min_creation_time + if prefix_match is not None: + policy_properties.rules[i].filters.prefix_match = prefix_match + + client.create_or_update(resource_group_name=resource_group_name, account_name=account_name, + object_replication_policy_id=policy_id, properties=policy_properties) + + return get_or_rule(client, resource_group_name=resource_group_name, account_name=account_name, + policy_id=policy_id, rule_id=rule_id) diff --git a/src/storage-or-preview/azext_storage_or_preview/profiles.py b/src/storage-or-preview/azext_storage_or_preview/profiles.py new file mode 100644 index 00000000000..4d027a29e6e --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/profiles.py @@ -0,0 +1,9 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core.profiles import CustomResourceType + +CUSTOM_MGMT_STORAGE_ORS = CustomResourceType('azext_storage_or_preview.vendored_sdks.azure_mgmt_storage', + 'StorageManagementClient') diff --git a/src/storage-or-preview/azext_storage_or_preview/tests/__init__.py b/src/storage-or-preview/azext_storage_or_preview/tests/__init__.py new file mode 100644 index 00000000000..99c0f28cd71 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/tests/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# 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/storage-or-preview/azext_storage_or_preview/tests/latest/__init__.py b/src/storage-or-preview/azext_storage_or_preview/tests/latest/__init__.py new file mode 100644 index 00000000000..5ddb01ff351 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/tests/latest/__init__.py @@ -0,0 +1,8 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -----------------------------------------------------------------------------\ +from azure.cli.core.profiles import register_resource_type +from ...profiles import CUSTOM_MGMT_STORAGE_ORS +register_resource_type('latest', CUSTOM_MGMT_STORAGE_ORS, '2019-06-01') diff --git a/src/storage-or-preview/azext_storage_or_preview/tests/latest/recordings/test_storage_account_ors.yaml b/src/storage-or-preview/azext_storage_or_preview/tests/latest/recordings/test_storage_account_ors.yaml new file mode 100644 index 00000000000..832d8bda9bb --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/tests/latest/recordings/test_storage_account_ors.yaml @@ -0,0 +1,1693 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account keys list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g --query -o + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2019-06-01 + response: + body: + string: '{"keys":[{"keyName":"key1","value":"veryFakedStorageAccountKey==","permissions":"FULL"},{"keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:41:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - Azure-Storage/2.0.0-2.0.1 (Python CPython 3.7.4; Windows 10) AZURECLI/2.5.1 + x-ms-date: + - Thu, 30 Apr 2020 15:41:45 GMT + x-ms-version: + - '2018-11-09' + method: PUT + uri: https://clitest000002.blob.core.windows.net/cont000005?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Thu, 30 Apr 2020 15:41:48 GMT + etag: + - '"0x8D7ED1CFF3E5F7E"' + last-modified: + - Thu, 30 Apr 2020 15:41:49 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2018-11-09' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account keys list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -n -g --query -o + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/listKeys?api-version=2019-06-01 + response: + body: + string: '{"keys":[{"keyName":"key1","value":"veryFakedStorageAccountKey==","permissions":"FULL"},{"keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:41:51 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - Azure-Storage/2.0.0-2.0.1 (Python CPython 3.7.4; Windows 10) AZURECLI/2.5.1 + x-ms-date: + - Thu, 30 Apr 2020 15:41:53 GMT + x-ms-version: + - '2018-11-09' + method: PUT + uri: https://clitest000003.blob.core.windows.net/cont000006?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Thu, 30 Apr 2020 15:41:57 GMT + etag: + - '"0x8D7ED1D046CB3C5"' + last-modified: + - Thu, 30 Apr 2020 15:41:58 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2018-11-09' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account blob-service-properties update + Connection: + - keep-alive + ParameterSetName: + - -n -g --enable-change-feed + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000002/blobServices/default?api-version=2019-06-01 + response: + body: + string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000002/blobServices/default","name":"default","type":"Microsoft.Storage/storageAccounts/blobServices","properties":{"cors":{"corsRules":[]},"deleteRetentionPolicy":{"enabled":false}}}' + headers: + cache-control: + - no-cache + content-length: + - '443' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:00 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"cors": {"corsRules": []}, "deleteRetentionPolicy": {"enabled": + false}, "changeFeed": {"enabled": true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account blob-service-properties update + Connection: + - keep-alive + Content-Length: + - '121' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -n -g --enable-change-feed + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000002/blobServices/default?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000002/blobServices/default","name":"default","type":"Microsoft.Storage/storageAccounts/blobServices","properties":{"changeFeed":{"enabled":true},"cors":{"corsRules":[]},"deleteRetentionPolicy":{"enabled":false}}}' + headers: + cache-control: + - no-cache + content-length: + - '425' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:03 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account blob-service-properties update + Connection: + - keep-alive + ParameterSetName: + - -n -g --enable-versioning + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000002/blobServices/default?api-version=2019-06-01 + response: + body: + string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000002/blobServices/default","name":"default","type":"Microsoft.Storage/storageAccounts/blobServices","properties":{"changeFeed":{"enabled":true},"cors":{"corsRules":[]},"deleteRetentionPolicy":{"enabled":false}}}' + headers: + cache-control: + - no-cache + content-length: + - '473' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"cors": {"corsRules": []}, "deleteRetentionPolicy": {"enabled": + false}, "isVersioningEnabled": true, "changeFeed": {"enabled": true}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account blob-service-properties update + Connection: + - keep-alive + Content-Length: + - '150' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -n -g --enable-versioning + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000002/blobServices/default?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000002/blobServices/default","name":"default","type":"Microsoft.Storage/storageAccounts/blobServices","properties":{"changeFeed":{"enabled":true},"cors":{"corsRules":[]},"deleteRetentionPolicy":{"enabled":false},"isVersioningEnabled":true}}' + headers: + cache-control: + - no-cache + content-length: + - '452' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account blob-service-properties update + Connection: + - keep-alive + ParameterSetName: + - -n -g --enable-versioning + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/blobServices/default?api-version=2019-06-01 + response: + body: + string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/blobServices/default","name":"default","type":"Microsoft.Storage/storageAccounts/blobServices","properties":{"cors":{"corsRules":[]},"deleteRetentionPolicy":{"enabled":false}}}' + headers: + cache-control: + - no-cache + content-length: + - '443' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:09 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"cors": {"corsRules": []}, "deleteRetentionPolicy": {"enabled": + false}, "isVersioningEnabled": true}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account blob-service-properties update + Connection: + - keep-alive + Content-Length: + - '117' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -n -g --enable-versioning + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/blobServices/default?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/blobServices/default","name":"default","type":"Microsoft.Storage/storageAccounts/blobServices","properties":{"cors":{"corsRules":[]},"deleteRetentionPolicy":{"enabled":false},"isVersioningEnabled":true}}' + headers: + cache-control: + - no-cache + content-length: + - '422' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: 'b''b\''{"properties": {"sourceAccount": "clitest000002", "destinationAccount": + "clitest000003", "rules": [{"sourceContainer": "cont000005", "destinationContainer": + "cont000006", "filters": {"minCreationTime": "2020-02-19T16:05:00Z"}}]}}\''''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy create + Connection: + - keep-alive + Content-Length: + - '279' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -s --destination-container --source-container -t + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/default?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy show + Connection: + - keep-alive + ParameterSetName: + - -g -n --policy-id + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:18 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - Azure-Storage/2.0.0-2.0.1 (Python CPython 3.7.4; Windows 10) AZURECLI/2.5.1 + x-ms-date: + - Thu, 30 Apr 2020 15:42:20 GMT + x-ms-version: + - '2018-11-09' + method: PUT + uri: https://clitest000002.blob.core.windows.net/cont000007?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Thu, 30 Apr 2020 15:42:21 GMT + etag: + - '"0x8D7ED1D12BF8259"' + last-modified: + - Thu, 30 Apr 2020 15:42:22 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2018-11-09' + status: + code: 201 + message: Created +- request: + body: null + headers: + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - Azure-Storage/2.0.0-2.0.1 (Python CPython 3.7.4; Windows 10) AZURECLI/2.5.1 + x-ms-date: + - Thu, 30 Apr 2020 15:42:23 GMT + x-ms-version: + - '2018-11-09' + method: PUT + uri: https://clitest000003.blob.core.windows.net/cont000008?restype=container + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Thu, 30 Apr 2020 15:42:24 GMT + etag: + - '"0x8D7ED1D14CD4CC6"' + last-modified: + - Thu, 30 Apr 2020 15:42:25 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-version: + - '2018-11-09' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy rule list + Connection: + - keep-alive + ParameterSetName: + - -g -n --policy-id + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy rule show + Connection: + - keep-alive + ParameterSetName: + - -g -n --rule-id --policy-id + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:31 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy rule add + Connection: + - keep-alive + ParameterSetName: + - -g -n --policy-id -d -s -t + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:34 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: 'b''b\''{"properties": {"sourceAccount": "clitest000002", "destinationAccount": + "clitest000003", "rules": [{"ruleId": "e11cc19c-45ca-4dbd-9961-9b41a8f06ad6", + "sourceContainer": "cont000005", "destinationContainer": "cont000006", "filters": + {"minCreationTime": "2020-02-19T16:05:00Z"}}, {"sourceContainer": "cont000007", + "destinationContainer": "cont000008", "filters": {"minCreationTime": "2020-02-19T16:05:00Z"}}]}}\''''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy rule add + Connection: + - keep-alive + Content-Length: + - '486' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --policy-id -d -s -t + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}},{"ruleId":"495766dc-2e99-44de-aba0-ada1a8a6677b","sourceContainer":"cont000007","destinationContainer":"cont000008","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '960' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:35 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy rule list + Connection: + - keep-alive + ParameterSetName: + - -g -n --policy-id + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}},{"ruleId":"495766dc-2e99-44de-aba0-ada1a8a6677b","sourceContainer":"cont000007","destinationContainer":"cont000008","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '960' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:38 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy rule update + Connection: + - keep-alive + ParameterSetName: + - -g -n --policy-id --rule-id --prefix-match -t + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}},{"ruleId":"495766dc-2e99-44de-aba0-ada1a8a6677b","sourceContainer":"cont000007","destinationContainer":"cont000008","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '960' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:42 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: 'b''b\''{"properties": {"sourceAccount": "clitest000002", "destinationAccount": + "clitest000003", "rules": [{"ruleId": "e11cc19c-45ca-4dbd-9961-9b41a8f06ad6", + "sourceContainer": "cont000005", "destinationContainer": "cont000006", "filters": + {"minCreationTime": "2020-02-19T16:05:00Z"}}, {"ruleId": "495766dc-2e99-44de-aba0-ada1a8a6677b", + "sourceContainer": "cont000007", "destinationContainer": "cont000008", "filters": + {"prefixMatch": ["blobA", "blobB"], "minCreationTime": "2020-02-20T16:05:00Z"}}]}}\''''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy rule update + Connection: + - keep-alive + Content-Length: + - '571' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --policy-id --rule-id --prefix-match -t + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}},{"ruleId":"495766dc-2e99-44de-aba0-ada1a8a6677b","sourceContainer":"cont000007","destinationContainer":"cont000008","filters":{"prefixMatch":["blobA","blobB"],"minCreationTime":"2020-02-20T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '992' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy rule update + Connection: + - keep-alive + ParameterSetName: + - -g -n --policy-id --rule-id --prefix-match -t + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}},{"ruleId":"495766dc-2e99-44de-aba0-ada1a8a6677b","sourceContainer":"cont000007","destinationContainer":"cont000008","filters":{"prefixMatch":["blobA","blobB"],"minCreationTime":"2020-02-20T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '992' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy rule show + Connection: + - keep-alive + ParameterSetName: + - -g -n --policy-id --rule-id + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}},{"ruleId":"495766dc-2e99-44de-aba0-ada1a8a6677b","sourceContainer":"cont000007","destinationContainer":"cont000008","filters":{"prefixMatch":["blobA","blobB"],"minCreationTime":"2020-02-20T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '992' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:47 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy rule remove + Connection: + - keep-alive + ParameterSetName: + - -g -n --policy-id --rule-id + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}},{"ruleId":"495766dc-2e99-44de-aba0-ada1a8a6677b","sourceContainer":"cont000007","destinationContainer":"cont000008","filters":{"prefixMatch":["blobA","blobB"],"minCreationTime":"2020-02-20T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '992' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:50 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: 'b''b\''{"properties": {"sourceAccount": "clitest000002", "destinationAccount": + "clitest000003", "rules": [{"ruleId": "e11cc19c-45ca-4dbd-9961-9b41a8f06ad6", + "sourceContainer": "cont000005", "destinationContainer": "cont000006", "filters": + {"minCreationTime": "2020-02-19T16:05:00Z"}}]}}\''''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy rule remove + Connection: + - keep-alive + Content-Length: + - '329' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --policy-id --rule-id + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:51 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy rule list + Connection: + - keep-alive + ParameterSetName: + - -g -n --policy-id + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:53 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy show + Connection: + - keep-alive + ParameterSetName: + - -g -n --policy-id + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:42:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: 'b''b\''{"properties": {"sourceAccount": "clitest000002", "destinationAccount": + "clitest000003", "rules": [{"ruleId": "e11cc19c-45ca-4dbd-9961-9b41a8f06ad6", + "sourceContainer": "cont000005", "destinationContainer": "cont000006", "filters": + {"minCreationTime": "2020-02-19T16:05:00Z"}}]}}\''''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy create + Connection: + - keep-alive + Content-Length: + - '329' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n -p + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000002/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000002/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","enabledTime":"2020-04-30T15:43:00.0096489Z","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '807' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:43:00 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy update + Connection: + - keep-alive + ParameterSetName: + - -g -n --policy-id --source-account + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000002","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:43:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: 'b''b\''{"properties": {"sourceAccount": "clitest000004", "destinationAccount": + "clitest000003", "rules": [{"ruleId": "e11cc19c-45ca-4dbd-9961-9b41a8f06ad6", + "sourceContainer": "cont000005", "destinationContainer": "cont000006", "filters": + {"minCreationTime": "2020-02-19T16:05:00Z"}}]}}\''''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy update + Connection: + - keep-alive + Content-Length: + - '329' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --policy-id --source-account + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1","name":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","type":"Microsoft.Storage/storageAccounts/objectReplicationPolicies","properties":{"policyId":"4999e5a2-a572-408d-be0c-3fa7f6729eb1","sourceAccount":"clitest000004","destinationAccount":"clitest000003","rules":[{"ruleId":"e11cc19c-45ca-4dbd-9961-9b41a8f06ad6","sourceContainer":"cont000005","destinationContainer":"cont000006","filters":{"minCreationTime":"2020-02-19T16:05:00Z"}}]}}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:43:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --policy-id + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000002/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + content-type: + - text/plain; charset=utf-8 + date: + - Thu, 30 Apr 2020 15:43:07 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy list + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000002/objectReplicationPolicies?api-version=2019-06-01 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:43:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --policy-id + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies/4999e5a2-a572-408d-be0c-3fa7f6729eb1?api-version=2019-06-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + content-type: + - text/plain; charset=utf-8 + date: + - Thu, 30 Apr 2020 15:43:14 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account or-policy list + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.7.4 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/7.1.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_storage_account_ors000001/providers/Microsoft.Storage/storageAccounts/clitest000003/objectReplicationPolicies?api-version=2019-06-01 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json + date: + - Thu, 30 Apr 2020 15:43:18 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/storage-or-preview/azext_storage_or_preview/tests/latest/test_storage_account_ors_scenario.py b/src/storage-or-preview/azext_storage_or_preview/tests/latest/test_storage_account_ors_scenario.py new file mode 100644 index 00000000000..0e04f07cf10 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/tests/latest/test_storage_account_ors_scenario.py @@ -0,0 +1,133 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os + +from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer, + JMESPathCheck, api_version_constraint) +from ..storage_test_util import StorageScenarioMixin +from ...profiles import CUSTOM_MGMT_STORAGE_ORS + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class StorageAccountORSScenarioTest(StorageScenarioMixin, ScenarioTest): + @api_version_constraint(CUSTOM_MGMT_STORAGE_ORS, min_api='2019-06-01') + @ResourceGroupPreparer(name_prefix='cli_test_storage_account_ors', location='eastus2euap') + @StorageAccountPreparer(parameter_name='source_account', location='eastus2euap', kind='StorageV2') + @StorageAccountPreparer(parameter_name='destination_account', location='eastus2euap', kind='StorageV2') + @StorageAccountPreparer(parameter_name='new_account', location='eastus2euap', kind='StorageV2') + def test_storage_account_ors(self, resource_group, source_account, destination_account, new_account): + src_account_info = self.get_account_info(resource_group, source_account) + src_container = self.create_container(src_account_info) + dest_account_info = self.get_account_info(resource_group, destination_account) + dest_container = self.create_container(dest_account_info) + self.kwargs.update({ + 'rg': resource_group, + 'src_sc': source_account, + 'dest_sc': destination_account, + 'new_sc': new_account, + 'scont': src_container, + 'dcont': dest_container, + }) + + # Enable ChangeFeed for Source Storage Accounts + self.cmd('storage account blob-service-properties update -n {src_sc} -g {rg} --enable-change-feed', checks=[ + JMESPathCheck('changeFeed.enabled', True)]) + + # Enable Versioning for two Storage Accounts + self.cmd('storage account blob-service-properties update -n {src_sc} -g {rg} --enable-versioning', checks=[ + JMESPathCheck('isVersioningEnabled', True)]) + + self.cmd('storage account blob-service-properties update -n {dest_sc} -g {rg} --enable-versioning', checks=[ + JMESPathCheck('isVersioningEnabled', True)]) + + # Create ORS policy on destination account + result = self.cmd('storage account or-policy create -g {rg} -n {dest_sc} -s {src_sc} --destination-container {dcont} --source-container {scont} -t "2020-02-19T16:05:00Z"')\ + .get_output_in_json() + self.assertIn('policyId', result) + self.assertIn('ruleId', result['rules'][0]) + self.assertEqual(result["rules"][0]["filters"]["minCreationTime"], "2020-02-19T16:05:00Z") + + self.kwargs.update({ + 'policy_id': result["policyId"], + 'rule_id': result["rules"][0]["ruleId"] + }) + + # Get policy properties from destination account + self.cmd('storage account or-policy show -g {rg} -n {dest_sc} --policy-id {policy_id}') \ + .assert_with_checks(JMESPathCheck('type', "Microsoft.Storage/storageAccounts/objectReplicationPolicies")) \ + .assert_with_checks(JMESPathCheck('sourceAccount', source_account)) \ + .assert_with_checks(JMESPathCheck('destinationAccount', destination_account)) \ + .assert_with_checks(JMESPathCheck('rules[0].sourceContainer', src_container)) \ + .assert_with_checks(JMESPathCheck('rules[0].destinationContainer', dest_container)) + + # Add rules + src_container1 = self.create_container(src_account_info) + dest_container1 = self.create_container(dest_account_info) + self.cmd('storage account or-policy rule list -g {rg} -n {dest_sc} --policy-id {policy_id}')\ + .assert_with_checks(JMESPathCheck('length(@)', 1)) + self.cmd('storage account or-policy rule show -g {rg} -n {dest_sc} --rule-id {rule_id} --policy-id {policy_id}')\ + .assert_with_checks(JMESPathCheck('ruleId', result["rules"][0]["ruleId"])) \ + .assert_with_checks(JMESPathCheck('sourceContainer', src_container)) \ + .assert_with_checks(JMESPathCheck('destinationContainer', dest_container)) + + result = self.cmd('storage account or-policy rule add -g {} -n {} --policy-id {} -d {} -s {} -t "2020-02-19T16:05:00Z"'.format( + resource_group, destination_account, self.kwargs["policy_id"], dest_container1, src_container1)).get_output_in_json() + self.assertEqual(result["rules"][0]["filters"]["minCreationTime"], "2020-02-19T16:05:00Z") + + self.cmd('storage account or-policy rule list -g {rg} -n {dest_sc} --policy-id {policy_id}')\ + .assert_with_checks(JMESPathCheck('length(@)', 2)) + + # Update rules + self.cmd('storage account or-policy rule update -g {} -n {} --policy-id {} --rule-id {} --prefix-match blobA blobB -t "2020-02-20T16:05:00Z"'.format( + resource_group, destination_account, result['policyId'], result['rules'][1]['ruleId'])) \ + .assert_with_checks(JMESPathCheck('filters.prefixMatch[0]', 'blobA')) \ + .assert_with_checks(JMESPathCheck('filters.prefixMatch[1]', 'blobB')) \ + .assert_with_checks(JMESPathCheck('filters.minCreationTime', '2020-02-20T16:05:00Z')) + + self.cmd('storage account or-policy rule show -g {} -n {} --policy-id {} --rule-id {}'.format( + resource_group, destination_account, result['policyId'], result['rules'][1]['ruleId'])) \ + .assert_with_checks(JMESPathCheck('filters.prefixMatch[0]', 'blobA')) \ + .assert_with_checks(JMESPathCheck('filters.prefixMatch[1]', 'blobB')) \ + .assert_with_checks(JMESPathCheck('filters.minCreationTime', '2020-02-20T16:05:00Z')) + + # Remove rules + self.cmd('storage account or-policy rule remove -g {} -n {} --policy-id {} --rule-id {}'.format( + resource_group, destination_account, result['policyId'], result['rules'][1]['ruleId'])) + self.cmd('storage account or-policy rule list -g {rg} -n {dest_sc} --policy-id {policy_id}') \ + .assert_with_checks(JMESPathCheck('length(@)', 1)) + + # Set ORS policy to source account + import json + temp_dir = self.create_temp_dir() + policy_file = os.path.join(temp_dir, "policy.json") + with open(policy_file, "w") as f: + policy = self.cmd('storage account or-policy show -g {rg} -n {dest_sc} --policy-id {policy_id}')\ + .get_output_in_json() + json.dump(policy, f) + self.kwargs['policy'] = policy_file + self.cmd('storage account or-policy create -g {rg} -n {src_sc} -p @"{policy}"')\ + .assert_with_checks(JMESPathCheck('type', "Microsoft.Storage/storageAccounts/objectReplicationPolicies")) \ + .assert_with_checks(JMESPathCheck('sourceAccount', source_account)) \ + .assert_with_checks(JMESPathCheck('destinationAccount', destination_account)) \ + .assert_with_checks(JMESPathCheck('rules[0].sourceContainer', src_container)) \ + .assert_with_checks(JMESPathCheck('rules[0].destinationContainer', dest_container)) \ + .assert_with_checks(JMESPathCheck('rules[0].filters.minCreationTime', '2020-02-19T16:05:00Z')) + + # Update ORS policy + self.cmd('storage account or-policy update -g {} -n {} --policy-id {} --source-account {}'.format( + resource_group, destination_account, self.kwargs["policy_id"], new_account)) \ + .assert_with_checks(JMESPathCheck('sourceAccount', new_account)) + + # Delete policy from destination and source account + self.cmd('storage account or-policy delete -g {rg} -n {src_sc} --policy-id {policy_id}') + self.cmd('storage account or-policy list -g {rg} -n {src_sc}') \ + .assert_with_checks(JMESPathCheck('length(@)', 0)) + + self.cmd('storage account or-policy delete -g {rg} -n {dest_sc} --policy-id {policy_id}') + self.cmd('storage account or-policy list -g {rg} -n {dest_sc}') \ + .assert_with_checks(JMESPathCheck('length(@)', 0)) diff --git a/src/storage-or-preview/azext_storage_or_preview/tests/storage_test_util.py b/src/storage-or-preview/azext_storage_or_preview/tests/storage_test_util.py new file mode 100644 index 00000000000..05d67d5a052 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/tests/storage_test_util.py @@ -0,0 +1,89 @@ +# -------------------------------------------------------------------------------------------- +# 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 tempfile +import shutil + +from azure.cli.testsdk.preparers import AbstractPreparer + +# pylint: disable=unused-argument + + +class StorageScenarioMixin(object): + profile = None + + def get_current_profile(self): + if not self.profile: + self.profile = self.cmd('cloud show --query profile -otsv').output + return self.profile + + def get_account_key(self, group, name): + if self.get_current_profile() == '2017-03-09-profile': + template = 'storage account keys list -n {} -g {} --query "key1" -otsv' + else: + template = 'storage account keys list -n {} -g {} --query "[0].value" -otsv' + + return self.cmd(template.format(name, group)).output + + def get_account_info(self, group, name): + """Returns the storage account name and key in a tuple""" + return name, self.get_account_key(group, name) + + def storage_cmd(self, cmd, account_info, *args): + cmd = cmd.format(*args) + cmd = '{} --account-name {} --account-key {}'.format(cmd, *account_info) + return self.cmd(cmd) + + def storage_cmd_negative(self, cmd, account_info, *args): + cmd = cmd.format(*args) + cmd = '{} --account-name {} --account-key {}'.format(cmd, *account_info) + return self.cmd(cmd, expect_failure=True) + + def create_container(self, account_info, prefix='cont', length=24): + container_name = self.create_random_name(prefix=prefix, length=length) + self.storage_cmd('storage container create -n {}', account_info, container_name) + return container_name + + def create_share(self, account_info, prefix='share', length=24): + share_name = self.create_random_name(prefix=prefix, length=length) + self.storage_cmd('storage share create -n {}', account_info, share_name) + return share_name + + +class StorageTestFilesPreparer(AbstractPreparer): + def __init__(self, parameter_name='test_dir'): + super(StorageTestFilesPreparer, self).__init__(name_prefix='test', name_len=24) + self.parameter_name = parameter_name + + def create_resource(self, name, **kwargs): + temp_dir = os.path.join(tempfile.gettempdir(), self.random_name) + if not os.path.exists(temp_dir): + os.mkdir(temp_dir) + + with open(os.path.join(temp_dir, 'readme'), 'w') as f: + f.write('This directory contains test files generated by Azure CLI storage command ' + 'module tests.') + + for folder_name in ['apple', 'butter', 'butter/charlie', 'duff/edward']: + for file_index in range(10): + file_path = os.path.join(temp_dir, folder_name, 'file_%s' % file_index) + if not os.path.exists(os.path.dirname(file_path)): + os.makedirs(os.path.dirname(file_path)) + + with open(file_path, 'w') as f: + f.write('Azure CLI storage command module test sample file. origin:' + ' %s' % file_path) + + setattr(self, '_temp_dir', temp_dir) + return {self.parameter_name: temp_dir} + + def remove_resource(self, name, **kwargs): + temp_dir = self.get_temp_dir() + if temp_dir: + shutil.rmtree(temp_dir, ignore_errors=True) + + def get_temp_dir(self): + return getattr(self, '_temp_dir', None) diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/__init__.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/__init__.py new file mode 100644 index 00000000000..a5b81f3bde4 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/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/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/__init__.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/__init__.py new file mode 100644 index 00000000000..da2c3f969e6 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/__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 StorageManagementClientConfiguration +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient', 'StorageManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/_configuration.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/_configuration.py new file mode 100644 index 00000000000..57fa5132dc8 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/_configuration.py @@ -0,0 +1,48 @@ +# 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 StorageManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageManagementClient + 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: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(StorageManagementClientConfiguration, 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-storage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/_storage_management_client.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/_storage_management_client.py new file mode 100644 index 00000000000..34e11baa858 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/_storage_management_client.py @@ -0,0 +1,428 @@ +# 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 azure.profiles import KnownProfiles, ProfileDefinition +from azure.profiles.multiapiclient import MultiApiClientMixin +from ._configuration import StorageManagementClientConfiguration + + + +class StorageManagementClient(MultiApiClientMixin, SDKClient): + """The Azure Storage Management API. + + This ready contains multiple API versions, to help you deal with all Azure clouds + (Azure Stack, Azure Government, Azure China, etc.). + By default, uses latest API version available on public Azure. + For production, you should stick a particular api-version and/or profile. + The profile sets a mapping between the operation group and an API version. + The api-version parameter sets the default API version if the operation + group is not described in the profile. + + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: 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 str api_version: API version to use if no profile is provided, or if + missing in profile. + :param str base_url: Service URL + :param profile: A profile definition, from KnownProfiles to dict. + :type profile: azure.profiles.KnownProfiles + """ + + DEFAULT_API_VERSION = '2019-06-01' + _PROFILE_TAG = "azure.mgmt.storage.StorageManagementClient" + LATEST_PROFILE = ProfileDefinition({ + _PROFILE_TAG: { + None: DEFAULT_API_VERSION, + 'usage': '2018-02-01', + }}, + _PROFILE_TAG + " latest" + ) + + def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default): + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, self).__init__( + credentials, + self.config, + api_version=api_version, + profile=profile + ) + + @classmethod + def _models_dict(cls, api_version): + return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} + + @classmethod + def models(cls, api_version=DEFAULT_API_VERSION): + """Module depends on the API version: + + * 2015-06-15: :mod:`v2015_06_15.models` + * 2016-01-01: :mod:`v2016_01_01.models` + * 2016-12-01: :mod:`v2016_12_01.models` + * 2017-06-01: :mod:`v2017_06_01.models` + * 2017-10-01: :mod:`v2017_10_01.models` + * 2018-02-01: :mod:`v2018_02_01.models` + * 2018-03-01-preview: :mod:`v2018_03_01_preview.models` + * 2018-07-01: :mod:`v2018_07_01.models` + * 2018-11-01: :mod:`v2018_11_01.models` + * 2019-04-01: :mod:`v2019_04_01.models` + * 2019-06-01: :mod:`v2019_06_01.models` + """ + if api_version == '2015-06-15': + from .v2015_06_15 import models + return models + elif api_version == '2016-01-01': + from .v2016_01_01 import models + return models + elif api_version == '2016-12-01': + from .v2016_12_01 import models + return models + elif api_version == '2017-06-01': + from .v2017_06_01 import models + return models + elif api_version == '2017-10-01': + from .v2017_10_01 import models + return models + elif api_version == '2018-02-01': + from .v2018_02_01 import models + return models + elif api_version == '2018-03-01-preview': + from .v2018_03_01_preview import models + return models + elif api_version == '2018-07-01': + from .v2018_07_01 import models + return models + elif api_version == '2018-11-01': + from .v2018_11_01 import models + return models + elif api_version == '2019-04-01': + from .v2019_04_01 import models + return models + elif api_version == '2019-06-01': + from .v2019_06_01 import models + return models + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + + @property + def blob_containers(self): + """Instance depends on the API version: + + * 2018-02-01: :class:`BlobContainersOperations` + * 2018-03-01-preview: :class:`BlobContainersOperations` + * 2018-07-01: :class:`BlobContainersOperations` + * 2018-11-01: :class:`BlobContainersOperations` + * 2019-04-01: :class:`BlobContainersOperations` + * 2019-06-01: :class:`BlobContainersOperations` + """ + api_version = self._get_api_version('blob_containers') + if api_version == '2018-02-01': + from .v2018_02_01.operations import BlobContainersOperations as OperationClass + elif api_version == '2018-03-01-preview': + from .v2018_03_01_preview.operations import BlobContainersOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import BlobContainersOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import BlobContainersOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import BlobContainersOperations as OperationClass + elif api_version == '2019-06-01': + from .v2019_06_01.operations import BlobContainersOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def blob_services(self): + """Instance depends on the API version: + + * 2018-07-01: :class:`BlobServicesOperations` + * 2018-11-01: :class:`BlobServicesOperations` + * 2019-04-01: :class:`BlobServicesOperations` + * 2019-06-01: :class:`BlobServicesOperations` + """ + api_version = self._get_api_version('blob_services') + if api_version == '2018-07-01': + from .v2018_07_01.operations import BlobServicesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import BlobServicesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import BlobServicesOperations as OperationClass + elif api_version == '2019-06-01': + from .v2019_06_01.operations import BlobServicesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def file_services(self): + """Instance depends on the API version: + + * 2019-04-01: :class:`FileServicesOperations` + * 2019-06-01: :class:`FileServicesOperations` + """ + api_version = self._get_api_version('file_services') + if api_version == '2019-04-01': + from .v2019_04_01.operations import FileServicesOperations as OperationClass + elif api_version == '2019-06-01': + from .v2019_06_01.operations import FileServicesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def file_shares(self): + """Instance depends on the API version: + + * 2019-04-01: :class:`FileSharesOperations` + * 2019-06-01: :class:`FileSharesOperations` + """ + api_version = self._get_api_version('file_shares') + if api_version == '2019-04-01': + from .v2019_04_01.operations import FileSharesOperations as OperationClass + elif api_version == '2019-06-01': + from .v2019_06_01.operations import FileSharesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def management_policies(self): + """Instance depends on the API version: + + * 2018-07-01: :class:`ManagementPoliciesOperations` + * 2018-11-01: :class:`ManagementPoliciesOperations` + * 2019-04-01: :class:`ManagementPoliciesOperations` + * 2019-06-01: :class:`ManagementPoliciesOperations` + """ + api_version = self._get_api_version('management_policies') + if api_version == '2018-07-01': + from .v2018_07_01.operations import ManagementPoliciesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import ManagementPoliciesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import ManagementPoliciesOperations as OperationClass + elif api_version == '2019-06-01': + from .v2019_06_01.operations import ManagementPoliciesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def object_replication_policies(self): + """Instance depends on the API version: + + * 2019-06-01: :class:`ObjectReplicationPoliciesOperations` + """ + api_version = self._get_api_version('object_replication_policies') + if api_version == '2019-06-01': + from .v2019_06_01.operations import ObjectReplicationPoliciesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def operations(self): + """Instance depends on the API version: + + * 2017-06-01: :class:`Operations` + * 2017-10-01: :class:`Operations` + * 2018-02-01: :class:`Operations` + * 2018-03-01-preview: :class:`Operations` + * 2018-07-01: :class:`Operations` + * 2018-11-01: :class:`Operations` + * 2019-04-01: :class:`Operations` + * 2019-06-01: :class:`Operations` + """ + api_version = self._get_api_version('operations') + if api_version == '2017-06-01': + from .v2017_06_01.operations import Operations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import Operations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import Operations as OperationClass + elif api_version == '2018-03-01-preview': + from .v2018_03_01_preview.operations import Operations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import Operations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import Operations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import Operations as OperationClass + elif api_version == '2019-06-01': + from .v2019_06_01.operations import Operations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def private_endpoint_connections(self): + """Instance depends on the API version: + + * 2019-06-01: :class:`PrivateEndpointConnectionsOperations` + """ + api_version = self._get_api_version('private_endpoint_connections') + if api_version == '2019-06-01': + from .v2019_06_01.operations import PrivateEndpointConnectionsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def private_link_resources(self): + """Instance depends on the API version: + + * 2019-06-01: :class:`PrivateLinkResourcesOperations` + """ + api_version = self._get_api_version('private_link_resources') + if api_version == '2019-06-01': + from .v2019_06_01.operations import PrivateLinkResourcesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def skus(self): + """Instance depends on the API version: + + * 2017-06-01: :class:`SkusOperations` + * 2017-10-01: :class:`SkusOperations` + * 2018-02-01: :class:`SkusOperations` + * 2018-03-01-preview: :class:`SkusOperations` + * 2018-07-01: :class:`SkusOperations` + * 2018-11-01: :class:`SkusOperations` + * 2019-04-01: :class:`SkusOperations` + * 2019-06-01: :class:`SkusOperations` + """ + api_version = self._get_api_version('skus') + if api_version == '2017-06-01': + from .v2017_06_01.operations import SkusOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import SkusOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import SkusOperations as OperationClass + elif api_version == '2018-03-01-preview': + from .v2018_03_01_preview.operations import SkusOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import SkusOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import SkusOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import SkusOperations as OperationClass + elif api_version == '2019-06-01': + from .v2019_06_01.operations import SkusOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def storage_accounts(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`StorageAccountsOperations` + * 2016-01-01: :class:`StorageAccountsOperations` + * 2016-12-01: :class:`StorageAccountsOperations` + * 2017-06-01: :class:`StorageAccountsOperations` + * 2017-10-01: :class:`StorageAccountsOperations` + * 2018-02-01: :class:`StorageAccountsOperations` + * 2018-03-01-preview: :class:`StorageAccountsOperations` + * 2018-07-01: :class:`StorageAccountsOperations` + * 2018-11-01: :class:`StorageAccountsOperations` + * 2019-04-01: :class:`StorageAccountsOperations` + * 2019-06-01: :class:`StorageAccountsOperations` + """ + api_version = self._get_api_version('storage_accounts') + if api_version == '2015-06-15': + from .v2015_06_15.operations import StorageAccountsOperations as OperationClass + elif api_version == '2016-01-01': + from .v2016_01_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2018-03-01-preview': + from .v2018_03_01_preview.operations import StorageAccountsOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import StorageAccountsOperations as OperationClass + elif api_version == '2019-06-01': + from .v2019_06_01.operations import StorageAccountsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def usage(self): + """Instance depends on the API version: + + * 2015-06-15: :class:`UsageOperations` + * 2016-01-01: :class:`UsageOperations` + * 2016-12-01: :class:`UsageOperations` + * 2017-06-01: :class:`UsageOperations` + * 2017-10-01: :class:`UsageOperations` + * 2018-02-01: :class:`UsageOperations` + """ + api_version = self._get_api_version('usage') + if api_version == '2015-06-15': + from .v2015_06_15.operations import UsageOperations as OperationClass + elif api_version == '2016-01-01': + from .v2016_01_01.operations import UsageOperations as OperationClass + elif api_version == '2016-12-01': + from .v2016_12_01.operations import UsageOperations as OperationClass + elif api_version == '2017-06-01': + from .v2017_06_01.operations import UsageOperations as OperationClass + elif api_version == '2017-10-01': + from .v2017_10_01.operations import UsageOperations as OperationClass + elif api_version == '2018-02-01': + from .v2018_02_01.operations import UsageOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def usages(self): + """Instance depends on the API version: + + * 2018-03-01-preview: :class:`UsagesOperations` + * 2018-07-01: :class:`UsagesOperations` + * 2018-11-01: :class:`UsagesOperations` + * 2019-04-01: :class:`UsagesOperations` + * 2019-06-01: :class:`UsagesOperations` + """ + api_version = self._get_api_version('usages') + if api_version == '2018-03-01-preview': + from .v2018_03_01_preview.operations import UsagesOperations as OperationClass + elif api_version == '2018-07-01': + from .v2018_07_01.operations import UsagesOperations as OperationClass + elif api_version == '2018-11-01': + from .v2018_11_01.operations import UsagesOperations as OperationClass + elif api_version == '2019-04-01': + from .v2019_04_01.operations import UsagesOperations as OperationClass + elif api_version == '2019-06-01': + from .v2019_06_01.operations import UsagesOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/models.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/models.py new file mode 100644 index 00000000000..35b6148bf8e --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/models.py @@ -0,0 +1,8 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from .v2018_02_01.models import * +from .v2019_06_01.models import * diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/__init__.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/__init__.py new file mode 100644 index 00000000000..da2c3f969e6 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/__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 StorageManagementClientConfiguration +from ._storage_management_client import StorageManagementClient +__all__ = ['StorageManagementClient', 'StorageManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/_configuration.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/_configuration.py new file mode 100644 index 00000000000..57fa5132dc8 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/_configuration.py @@ -0,0 +1,48 @@ +# 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 StorageManagementClientConfiguration(AzureConfiguration): + """Configuration for StorageManagementClient + 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: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(StorageManagementClientConfiguration, 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-storage/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/_storage_management_client.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/_storage_management_client.py new file mode 100644 index 00000000000..4d52a2fc3ee --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/_storage_management_client.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import StorageManagementClientConfiguration +from .operations import Operations +from .operations import SkusOperations +from .operations import StorageAccountsOperations +from .operations import UsagesOperations +from .operations import ManagementPoliciesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations +from .operations import ObjectReplicationPoliciesOperations +from .operations import BlobServicesOperations +from .operations import BlobContainersOperations +from .operations import FileServicesOperations +from .operations import FileSharesOperations +from . import models + + +class StorageManagementClient(SDKClient): + """The Azure Storage Management API. + + :ivar config: Configuration for client. + :vartype config: StorageManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.storage.v2019_06_01.operations.Operations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.storage.v2019_06_01.operations.SkusOperations + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.storage.v2019_06_01.operations.StorageAccountsOperations + :ivar usages: Usages operations + :vartype usages: azure.mgmt.storage.v2019_06_01.operations.UsagesOperations + :ivar management_policies: ManagementPolicies operations + :vartype management_policies: azure.mgmt.storage.v2019_06_01.operations.ManagementPoliciesOperations + :ivar private_endpoint_connections: PrivateEndpointConnections operations + :vartype private_endpoint_connections: azure.mgmt.storage.v2019_06_01.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResources operations + :vartype private_link_resources: azure.mgmt.storage.v2019_06_01.operations.PrivateLinkResourcesOperations + :ivar object_replication_policies: ObjectReplicationPolicies operations + :vartype object_replication_policies: azure.mgmt.storage.v2019_06_01.operations.ObjectReplicationPoliciesOperations + :ivar blob_services: BlobServices operations + :vartype blob_services: azure.mgmt.storage.v2019_06_01.operations.BlobServicesOperations + :ivar blob_containers: BlobContainers operations + :vartype blob_containers: azure.mgmt.storage.v2019_06_01.operations.BlobContainersOperations + :ivar file_services: FileServices operations + :vartype file_services: azure.mgmt.storage.v2019_06_01.operations.FileServicesOperations + :ivar file_shares: FileShares operations + :vartype file_shares: azure.mgmt.storage.v2019_06_01.operations.FileSharesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = StorageManagementClientConfiguration(credentials, subscription_id, base_url) + super(StorageManagementClient, 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 = '2019-06-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self.config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.management_policies = ManagementPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.object_replication_policies = ObjectReplicationPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.blob_services = BlobServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.blob_containers = BlobContainersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.file_services = FileServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.file_shares = FileSharesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/models/__init__.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/models/__init__.py new file mode 100644 index 00000000000..825458fba64 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/models/__init__.py @@ -0,0 +1,373 @@ +# 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 AccountSasParameters + from ._models_py3 import ActiveDirectoryProperties + from ._models_py3 import AzureEntityResource + from ._models_py3 import AzureFilesIdentityBasedAuthentication + from ._models_py3 import BlobContainer + from ._models_py3 import BlobRestoreParameters + from ._models_py3 import BlobRestoreRange + from ._models_py3 import BlobRestoreStatus + from ._models_py3 import BlobServiceProperties + from ._models_py3 import ChangeFeed + from ._models_py3 import CheckNameAvailabilityResult + from ._models_py3 import CorsRule + from ._models_py3 import CorsRules + from ._models_py3 import CustomDomain + from ._models_py3 import DateAfterCreation + from ._models_py3 import DateAfterModification + from ._models_py3 import DeleteRetentionPolicy + from ._models_py3 import Dimension + from ._models_py3 import Encryption + from ._models_py3 import EncryptionScope + from ._models_py3 import EncryptionScopeKeyVaultProperties + from ._models_py3 import EncryptionService + from ._models_py3 import EncryptionServices + from ._models_py3 import Endpoints + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import FileServiceItems + from ._models_py3 import FileServiceProperties + from ._models_py3 import FileShare + from ._models_py3 import FileShareItem + from ._models_py3 import GeoReplicationStats + from ._models_py3 import Identity + from ._models_py3 import ImmutabilityPolicy + from ._models_py3 import ImmutabilityPolicyProperties + from ._models_py3 import IPRule + from ._models_py3 import KeyVaultProperties + from ._models_py3 import LeaseContainerRequest + from ._models_py3 import LeaseContainerResponse + from ._models_py3 import LegalHold + from ._models_py3 import LegalHoldProperties + from ._models_py3 import ListAccountSasResponse + from ._models_py3 import ListContainerItem + from ._models_py3 import ListServiceSasResponse + from ._models_py3 import ManagementPolicy + from ._models_py3 import ManagementPolicyAction + from ._models_py3 import ManagementPolicyBaseBlob + from ._models_py3 import ManagementPolicyDefinition + from ._models_py3 import ManagementPolicyFilter + from ._models_py3 import ManagementPolicyRule + from ._models_py3 import ManagementPolicySchema + from ._models_py3 import ManagementPolicySnapShot + from ._models_py3 import MetricSpecification + from ._models_py3 import NetworkRuleSet + from ._models_py3 import ObjectReplicationPolicy + from ._models_py3 import ObjectReplicationPolicyFilter + from ._models_py3 import ObjectReplicationPolicyRule + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceListResult + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import ProxyResource + from ._models_py3 import Resource + from ._models_py3 import RestorePolicyProperties + from ._models_py3 import Restriction + from ._models_py3 import RoutingPreference + from ._models_py3 import ServiceSasParameters + from ._models_py3 import ServiceSpecification + from ._models_py3 import Sku + from ._models_py3 import SKUCapability + from ._models_py3 import SkuInformation + from ._models_py3 import StorageAccount + from ._models_py3 import StorageAccountCheckNameAvailabilityParameters + from ._models_py3 import StorageAccountCreateParameters + from ._models_py3 import StorageAccountInternetEndpoints + from ._models_py3 import StorageAccountKey + from ._models_py3 import StorageAccountListKeysResult + from ._models_py3 import StorageAccountMicrosoftEndpoints + from ._models_py3 import StorageAccountRegenerateKeyParameters + from ._models_py3 import StorageAccountUpdateParameters + from ._models_py3 import TagProperty + from ._models_py3 import TrackedResource + from ._models_py3 import UpdateHistoryProperty + from ._models_py3 import Usage + from ._models_py3 import UsageName + from ._models_py3 import VirtualNetworkRule +except (SyntaxError, ImportError): + from ._models import AccountSasParameters + from ._models import ActiveDirectoryProperties + from ._models import AzureEntityResource + from ._models import AzureFilesIdentityBasedAuthentication + from ._models import BlobContainer + from ._models import BlobRestoreParameters + from ._models import BlobRestoreRange + from ._models import BlobRestoreStatus + from ._models import BlobServiceProperties + from ._models import ChangeFeed + from ._models import CheckNameAvailabilityResult + from ._models import CorsRule + from ._models import CorsRules + from ._models import CustomDomain + from ._models import DateAfterCreation + from ._models import DateAfterModification + from ._models import DeleteRetentionPolicy + from ._models import Dimension + from ._models import Encryption + from ._models import EncryptionScope + from ._models import EncryptionScopeKeyVaultProperties + from ._models import EncryptionService + from ._models import EncryptionServices + from ._models import Endpoints + from ._models import ErrorResponse, ErrorResponseException + from ._models import FileServiceItems + from ._models import FileServiceProperties + from ._models import FileShare + from ._models import FileShareItem + from ._models import GeoReplicationStats + from ._models import Identity + from ._models import ImmutabilityPolicy + from ._models import ImmutabilityPolicyProperties + from ._models import IPRule + from ._models import KeyVaultProperties + from ._models import LeaseContainerRequest + from ._models import LeaseContainerResponse + from ._models import LegalHold + from ._models import LegalHoldProperties + from ._models import ListAccountSasResponse + from ._models import ListContainerItem + from ._models import ListServiceSasResponse + from ._models import ManagementPolicy + from ._models import ManagementPolicyAction + from ._models import ManagementPolicyBaseBlob + from ._models import ManagementPolicyDefinition + from ._models import ManagementPolicyFilter + from ._models import ManagementPolicyRule + from ._models import ManagementPolicySchema + from ._models import ManagementPolicySnapShot + from ._models import MetricSpecification + from ._models import NetworkRuleSet + from ._models import ObjectReplicationPolicy + from ._models import ObjectReplicationPolicyFilter + from ._models import ObjectReplicationPolicyRule + from ._models import Operation + from ._models import OperationDisplay + from ._models import PrivateEndpoint + from ._models import PrivateEndpointConnection + from ._models import PrivateLinkResource + from ._models import PrivateLinkResourceListResult + from ._models import PrivateLinkServiceConnectionState + from ._models import ProxyResource + from ._models import Resource + from ._models import RestorePolicyProperties + from ._models import Restriction + from ._models import RoutingPreference + from ._models import ServiceSasParameters + from ._models import ServiceSpecification + from ._models import Sku + from ._models import SKUCapability + from ._models import SkuInformation + from ._models import StorageAccount + from ._models import StorageAccountCheckNameAvailabilityParameters + from ._models import StorageAccountCreateParameters + from ._models import StorageAccountInternetEndpoints + from ._models import StorageAccountKey + from ._models import StorageAccountListKeysResult + from ._models import StorageAccountMicrosoftEndpoints + from ._models import StorageAccountRegenerateKeyParameters + from ._models import StorageAccountUpdateParameters + from ._models import TagProperty + from ._models import TrackedResource + from ._models import UpdateHistoryProperty + from ._models import Usage + from ._models import UsageName + from ._models import VirtualNetworkRule +from ._paged_models import BlobServicePropertiesPaged +from ._paged_models import EncryptionScopePaged +from ._paged_models import FileShareItemPaged +from ._paged_models import ListContainerItemPaged +from ._paged_models import ObjectReplicationPolicyPaged +from ._paged_models import OperationPaged +from ._paged_models import SkuInformationPaged +from ._paged_models import StorageAccountPaged +from ._paged_models import UsagePaged +from ._storage_management_client_enums import ( + ReasonCode, + SkuName, + SkuTier, + Kind, + Reason, + KeyType, + KeySource, + Action, + State, + Bypass, + DefaultAction, + DirectoryServiceOptions, + AccessTier, + LargeFileSharesState, + RoutingChoice, + GeoReplicationStatus, + BlobRestoreProgressStatus, + ProvisioningState, + AccountStatus, + PrivateEndpointServiceConnectionStatus, + PrivateEndpointConnectionProvisioningState, + KeyPermission, + UsageUnit, + Services, + SignedResourceTypes, + Permissions, + HttpProtocol, + SignedResource, + EncryptionScopeSource, + EncryptionScopeState, + PublicAccess, + LeaseStatus, + LeaseState, + LeaseDuration, + ImmutabilityPolicyState, + ImmutabilityPolicyUpdateType, + StorageAccountExpand, + ListKeyExpand, +) + +__all__ = [ + 'AccountSasParameters', + 'ActiveDirectoryProperties', + 'AzureEntityResource', + 'AzureFilesIdentityBasedAuthentication', + 'BlobContainer', + 'BlobRestoreParameters', + 'BlobRestoreRange', + 'BlobRestoreStatus', + 'BlobServiceProperties', + 'ChangeFeed', + 'CheckNameAvailabilityResult', + 'CorsRule', + 'CorsRules', + 'CustomDomain', + 'DateAfterCreation', + 'DateAfterModification', + 'DeleteRetentionPolicy', + 'Dimension', + 'Encryption', + 'EncryptionScope', + 'EncryptionScopeKeyVaultProperties', + 'EncryptionService', + 'EncryptionServices', + 'Endpoints', + 'ErrorResponse', 'ErrorResponseException', + 'FileServiceItems', + 'FileServiceProperties', + 'FileShare', + 'FileShareItem', + 'GeoReplicationStats', + 'Identity', + 'ImmutabilityPolicy', + 'ImmutabilityPolicyProperties', + 'IPRule', + 'KeyVaultProperties', + 'LeaseContainerRequest', + 'LeaseContainerResponse', + 'LegalHold', + 'LegalHoldProperties', + 'ListAccountSasResponse', + 'ListContainerItem', + 'ListServiceSasResponse', + 'ManagementPolicy', + 'ManagementPolicyAction', + 'ManagementPolicyBaseBlob', + 'ManagementPolicyDefinition', + 'ManagementPolicyFilter', + 'ManagementPolicyRule', + 'ManagementPolicySchema', + 'ManagementPolicySnapShot', + 'MetricSpecification', + 'NetworkRuleSet', + 'ObjectReplicationPolicy', + 'ObjectReplicationPolicyFilter', + 'ObjectReplicationPolicyRule', + 'Operation', + 'OperationDisplay', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', + 'ProxyResource', + 'Resource', + 'RestorePolicyProperties', + 'Restriction', + 'RoutingPreference', + 'ServiceSasParameters', + 'ServiceSpecification', + 'Sku', + 'SKUCapability', + 'SkuInformation', + 'StorageAccount', + 'StorageAccountCheckNameAvailabilityParameters', + 'StorageAccountCreateParameters', + 'StorageAccountInternetEndpoints', + 'StorageAccountKey', + 'StorageAccountListKeysResult', + 'StorageAccountMicrosoftEndpoints', + 'StorageAccountRegenerateKeyParameters', + 'StorageAccountUpdateParameters', + 'TagProperty', + 'TrackedResource', + 'UpdateHistoryProperty', + 'Usage', + 'UsageName', + 'VirtualNetworkRule', + 'OperationPaged', + 'SkuInformationPaged', + 'StorageAccountPaged', + 'UsagePaged', + 'ObjectReplicationPolicyPaged', + 'EncryptionScopePaged', + 'BlobServicePropertiesPaged', + 'ListContainerItemPaged', + 'FileShareItemPaged', + 'ReasonCode', + 'SkuName', + 'SkuTier', + 'Kind', + 'Reason', + 'KeyType', + 'KeySource', + 'Action', + 'State', + 'Bypass', + 'DefaultAction', + 'DirectoryServiceOptions', + 'AccessTier', + 'LargeFileSharesState', + 'RoutingChoice', + 'GeoReplicationStatus', + 'BlobRestoreProgressStatus', + 'ProvisioningState', + 'AccountStatus', + 'PrivateEndpointServiceConnectionStatus', + 'PrivateEndpointConnectionProvisioningState', + 'KeyPermission', + 'UsageUnit', + 'Services', + 'SignedResourceTypes', + 'Permissions', + 'HttpProtocol', + 'SignedResource', + 'EncryptionScopeSource', + 'EncryptionScopeState', + 'PublicAccess', + 'LeaseStatus', + 'LeaseState', + 'LeaseDuration', + 'ImmutabilityPolicyState', + 'ImmutabilityPolicyUpdateType', + 'StorageAccountExpand', + 'ListKeyExpand', +] diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/models/_models.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/models/_models.py new file mode 100644 index 00000000000..903a0b43340 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/models/_models.py @@ -0,0 +1,3734 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2019_06_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2019_06_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2019_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2019_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AccountSasParameters, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.resource_types = kwargs.get('resource_types', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + + +class ActiveDirectoryProperties(Model): + """Settings properties for Active Directory (AD). + + All required parameters must be populated in order to send to Azure. + + :param domain_name: Required. Specifies the primary domain that the AD DNS + server is authoritative for. + :type domain_name: str + :param net_bios_domain_name: Required. Specifies the NetBIOS domain name. + :type net_bios_domain_name: str + :param forest_name: Required. Specifies the Active Directory forest to + get. + :type forest_name: str + :param domain_guid: Required. Specifies the domain GUID. + :type domain_guid: str + :param domain_sid: Required. Specifies the security identifier (SID). + :type domain_sid: str + :param azure_storage_sid: Required. Specifies the security identifier + (SID) for Azure Storage. + :type azure_storage_sid: str + """ + + _validation = { + 'domain_name': {'required': True}, + 'net_bios_domain_name': {'required': True}, + 'forest_name': {'required': True}, + 'domain_guid': {'required': True}, + 'domain_sid': {'required': True}, + 'azure_storage_sid': {'required': True}, + } + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'net_bios_domain_name': {'key': 'netBiosDomainName', 'type': 'str'}, + 'forest_name': {'key': 'forestName', 'type': 'str'}, + 'domain_guid': {'key': 'domainGuid', 'type': 'str'}, + 'domain_sid': {'key': 'domainSid', 'type': 'str'}, + 'azure_storage_sid': {'key': 'azureStorageSid', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ActiveDirectoryProperties, self).__init__(**kwargs) + self.domain_name = kwargs.get('domain_name', None) + self.net_bios_domain_name = kwargs.get('net_bios_domain_name', None) + self.forest_name = kwargs.get('forest_name', None) + self.domain_guid = kwargs.get('domain_guid', None) + self.domain_sid = kwargs.get('domain_sid', None) + self.azure_storage_sid = kwargs.get('azure_storage_sid', None) + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class AzureFilesIdentityBasedAuthentication(Model): + """Settings for Azure Files identity based authentication. + + All required parameters must be populated in order to send to Azure. + + :param directory_service_options: Required. Indicates the directory + service used. Possible values include: 'None', 'AADDS', 'AD' + :type directory_service_options: str or + ~azure.mgmt.storage.v2019_06_01.models.DirectoryServiceOptions + :param active_directory_properties: Required if choose AD. + :type active_directory_properties: + ~azure.mgmt.storage.v2019_06_01.models.ActiveDirectoryProperties + """ + + _validation = { + 'directory_service_options': {'required': True}, + } + + _attribute_map = { + 'directory_service_options': {'key': 'directoryServiceOptions', 'type': 'str'}, + 'active_directory_properties': {'key': 'activeDirectoryProperties', 'type': 'ActiveDirectoryProperties'}, + } + + def __init__(self, **kwargs): + super(AzureFilesIdentityBasedAuthentication, self).__init__(**kwargs) + self.directory_service_options = kwargs.get('directory_service_options', None) + self.active_directory_properties = kwargs.get('active_directory_properties', None) + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2019_06_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2019_06_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2019_06_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2019_06_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2019_06_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(BlobContainer, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class BlobRestoreParameters(Model): + """Blob restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param time_to_restore: Required. Restore blob to the specified time. + :type time_to_restore: datetime + :param blob_ranges: Required. Blob ranges to restore. + :type blob_ranges: + list[~azure.mgmt.storage.v2019_06_01.models.BlobRestoreRange] + """ + + _validation = { + 'time_to_restore': {'required': True}, + 'blob_ranges': {'required': True}, + } + + _attribute_map = { + 'time_to_restore': {'key': 'timeToRestore', 'type': 'iso-8601'}, + 'blob_ranges': {'key': 'blobRanges', 'type': '[BlobRestoreRange]'}, + } + + def __init__(self, **kwargs): + super(BlobRestoreParameters, self).__init__(**kwargs) + self.time_to_restore = kwargs.get('time_to_restore', None) + self.blob_ranges = kwargs.get('blob_ranges', None) + + +class BlobRestoreRange(Model): + """Blob range. + + All required parameters must be populated in order to send to Azure. + + :param start_range: Required. Blob start range. Empty means account start. + :type start_range: str + :param end_range: Required. Blob end range. Empty means account end. + :type end_range: str + """ + + _validation = { + 'start_range': {'required': True}, + 'end_range': {'required': True}, + } + + _attribute_map = { + 'start_range': {'key': 'startRange', 'type': 'str'}, + 'end_range': {'key': 'endRange', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BlobRestoreRange, self).__init__(**kwargs) + self.start_range = kwargs.get('start_range', None) + self.end_range = kwargs.get('end_range', None) + + +class BlobRestoreStatus(Model): + """Blob restore status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of blob restore progress. Possible values are: - + InProgress: Indicates that blob restore is ongoing. - Complete: Indicates + that blob restore has been completed successfully. - Failed: Indicates + that blob restore is failed. Possible values include: 'InProgress', + 'Complete', 'Failed' + :vartype status: str or + ~azure.mgmt.storage.v2019_06_01.models.BlobRestoreProgressStatus + :ivar failure_reason: Failure reason when blob restore is failed. + :vartype failure_reason: str + :ivar restore_id: Id for tracking blob restore request. + :vartype restore_id: str + :ivar parameters: Blob restore request parameters. + :vartype parameters: + ~azure.mgmt.storage.v2019_06_01.models.BlobRestoreParameters + """ + + _validation = { + 'status': {'readonly': True}, + 'failure_reason': {'readonly': True}, + 'restore_id': {'readonly': True}, + 'parameters': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'failure_reason': {'key': 'failureReason', 'type': 'str'}, + 'restore_id': {'key': 'restoreId', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'BlobRestoreParameters'}, + } + + def __init__(self, **kwargs): + super(BlobRestoreStatus, self).__init__(**kwargs) + self.status = None + self.failure_reason = None + self.restore_id = None + self.parameters = None + + +class BlobServiceProperties(Resource): + """The properties of a storage account’s Blob service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param cors: Specifies CORS rules for the Blob service. You can include up + to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the Blob service. + :type cors: ~azure.mgmt.storage.v2019_06_01.models.CorsRules + :param default_service_version: DefaultServiceVersion indicates the + default version to use for requests to the Blob service if an incoming + request’s version is not specified. Possible values include version + 2008-10-27 and all more recent versions. + :type default_service_version: str + :param delete_retention_policy: The blob service properties for blob soft + delete. + :type delete_retention_policy: + ~azure.mgmt.storage.v2019_06_01.models.DeleteRetentionPolicy + :param is_versioning_enabled: Versioning is enabled if set to true. + :type is_versioning_enabled: bool + :param automatic_snapshot_policy_enabled: Deprecated in favor of + isVersioningEnabled property. + :type automatic_snapshot_policy_enabled: bool + :param change_feed: The blob service properties for change feed events. + :type change_feed: ~azure.mgmt.storage.v2019_06_01.models.ChangeFeed + :param restore_policy: The blob service properties for blob restore + policy. + :type restore_policy: + ~azure.mgmt.storage.v2019_06_01.models.RestorePolicyProperties + :param container_delete_retention_policy: The blob service properties for + container soft delete. + :type container_delete_retention_policy: + ~azure.mgmt.storage.v2019_06_01.models.DeleteRetentionPolicy + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2019_06_01.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, + 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'is_versioning_enabled': {'key': 'properties.isVersioningEnabled', 'type': 'bool'}, + 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, + 'change_feed': {'key': 'properties.changeFeed', 'type': 'ChangeFeed'}, + 'restore_policy': {'key': 'properties.restorePolicy', 'type': 'RestorePolicyProperties'}, + 'container_delete_retention_policy': {'key': 'properties.containerDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(BlobServiceProperties, self).__init__(**kwargs) + self.cors = kwargs.get('cors', None) + self.default_service_version = kwargs.get('default_service_version', None) + self.delete_retention_policy = kwargs.get('delete_retention_policy', None) + self.is_versioning_enabled = kwargs.get('is_versioning_enabled', None) + self.automatic_snapshot_policy_enabled = kwargs.get('automatic_snapshot_policy_enabled', None) + self.change_feed = kwargs.get('change_feed', None) + self.restore_policy = kwargs.get('restore_policy', None) + self.container_delete_retention_policy = kwargs.get('container_delete_retention_policy', None) + self.sku = None + + +class ChangeFeed(Model): + """The blob service properties for change feed events. + + :param enabled: Indicates whether change feed event logging is enabled for + the Blob service. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ChangeFeed, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2019_06_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """An error response from the Storage service. + + :param error: + :type error: ~azure.mgmt.storage.v2019_06_01.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the Storage service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.storage.v2019_06_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, **kwargs): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class CorsRule(Model): + """Specifies a CORS rule for the Blob service. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. Required if CorsRule element is present. + A list of origin domains that will be allowed via CORS, or "*" to allow + all domains + :type allowed_origins: list[str] + :param allowed_methods: Required. Required if CorsRule element is present. + A list of HTTP methods that are allowed to be executed by the origin. + :type allowed_methods: list[str] + :param max_age_in_seconds: Required. Required if CorsRule element is + present. The number of seconds that the client/browser should cache a + preflight response. + :type max_age_in_seconds: int + :param exposed_headers: Required. Required if CorsRule element is present. + A list of response headers to expose to CORS clients. + :type exposed_headers: list[str] + :param allowed_headers: Required. Required if CorsRule element is present. + A list of headers allowed to be part of the cross-origin request. + :type allowed_headers: list[str] + """ + + _validation = { + 'allowed_origins': {'required': True}, + 'allowed_methods': {'required': True}, + 'max_age_in_seconds': {'required': True}, + 'exposed_headers': {'required': True}, + 'allowed_headers': {'required': True}, + } + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, + 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, + 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, + 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(CorsRule, self).__init__(**kwargs) + self.allowed_origins = kwargs.get('allowed_origins', None) + self.allowed_methods = kwargs.get('allowed_methods', None) + self.max_age_in_seconds = kwargs.get('max_age_in_seconds', None) + self.exposed_headers = kwargs.get('exposed_headers', None) + self.allowed_headers = kwargs.get('allowed_headers', None) + + +class CorsRules(Model): + """Sets the CORS rules. You can include up to five CorsRule elements in the + request. . + + :param cors_rules: The List of CORS rules. You can include up to five + CorsRule elements in the request. + :type cors_rules: list[~azure.mgmt.storage.v2019_06_01.models.CorsRule] + """ + + _attribute_map = { + 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, + } + + def __init__(self, **kwargs): + super(CorsRules, self).__init__(**kwargs) + self.cors_rules = kwargs.get('cors_rules', None) + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CustomDomain, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.use_sub_domain_name = kwargs.get('use_sub_domain_name', None) + + +class DateAfterCreation(Model): + """Object to define the number of days after creation. + + All required parameters must be populated in order to send to Azure. + + :param days_after_creation_greater_than: Required. Value indicating the + age in days after creation + :type days_after_creation_greater_than: float + """ + + _validation = { + 'days_after_creation_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(DateAfterCreation, self).__init__(**kwargs) + self.days_after_creation_greater_than = kwargs.get('days_after_creation_greater_than', None) + + +class DateAfterModification(Model): + """Object to define the number of days after last modification. + + All required parameters must be populated in order to send to Azure. + + :param days_after_modification_greater_than: Required. Value indicating + the age in days after last modification + :type days_after_modification_greater_than: float + """ + + _validation = { + 'days_after_modification_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(DateAfterModification, self).__init__(**kwargs) + self.days_after_modification_greater_than = kwargs.get('days_after_modification_greater_than', None) + + +class DeleteRetentionPolicy(Model): + """The service properties for soft delete. + + :param enabled: Indicates whether DeleteRetentionPolicy is enabled. + :type enabled: bool + :param days: Indicates the number of days that the deleted item should be + retained. The minimum specified value can be 1 and the maximum value can + be 365. + :type days: int + """ + + _validation = { + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(DeleteRetentionPolicy, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.days = kwargs.get('days', None) + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Dimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2019_06_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2019_06_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2019_06_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(Encryption, self).__init__(**kwargs) + self.services = kwargs.get('services', None) + self.key_source = kwargs.get('key_source', "Microsoft.Storage") + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionScope(Resource): + """The Encryption Scope resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param source: The provider for the encryption scope. Possible values + (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. Possible + values include: 'Microsoft.Storage', 'Microsoft.KeyVault' + :type source: str or + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeSource + :param state: The state of the encryption scope. Possible values + (case-insensitive): Enabled, Disabled. Possible values include: + 'Enabled', 'Disabled' + :type state: str or + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeState + :ivar creation_time: Gets the creation date and time of the encryption + scope in UTC. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modification date and time of the + encryption scope in UTC. + :vartype last_modified_time: datetime + :param key_vault_properties: The key vault properties for the encryption + scope. This is a required field if encryption scope 'source' attribute is + set to 'Microsoft.KeyVault'. + :type key_vault_properties: + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeKeyVaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'EncryptionScopeKeyVaultProperties'}, + } + + def __init__(self, **kwargs): + super(EncryptionScope, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.state = kwargs.get('state', None) + self.creation_time = None + self.last_modified_time = None + self.key_vault_properties = kwargs.get('key_vault_properties', None) + + +class EncryptionScopeKeyVaultProperties(Model): + """The key vault properties for the encryption scope. This is a required field + if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + + :param key_uri: The object identifier for a key vault key object. When + applied, the encryption scope will use the key referenced by the + identifier to enable customer-managed key support on this encryption + scope. + :type key_uri: str + """ + + _attribute_map = { + 'key_uri': {'key': 'keyUri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EncryptionScopeKeyVaultProperties, self).__init__(**kwargs) + self.key_uri = kwargs.get('key_uri', None) + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + :param key_type: Encryption key type to be used for the encryption + service. 'Account' key type implies that an account-scoped encryption key + will be used. 'Service' key type implies that a default service key is + used. Possible values include: 'Service', 'Account' + :type key_type: str or ~azure.mgmt.storage.v2019_06_01.models.KeyType + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EncryptionService, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.last_enabled_time = None + self.key_type = kwargs.get('key_type', None) + + +class EncryptionServices(Model): + """A list of services that support encryption. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService + :param table: The encryption function of the table storage service. + :type table: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService + :param queue: The encryption function of the queue storage service. + :type queue: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService + """ + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, **kwargs): + super(EncryptionServices, self).__init__(**kwargs) + self.blob = kwargs.get('blob', None) + self.file = kwargs.get('file', None) + self.table = kwargs.get('table', None) + self.queue = kwargs.get('queue', None) + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + :param microsoft_endpoints: Gets the microsoft routing storage endpoints. + :type microsoft_endpoints: + ~azure.mgmt.storage.v2019_06_01.models.StorageAccountMicrosoftEndpoints + :param internet_endpoints: Gets the internet routing storage endpoints + :type internet_endpoints: + ~azure.mgmt.storage.v2019_06_01.models.StorageAccountInternetEndpoints + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + 'microsoft_endpoints': {'key': 'microsoftEndpoints', 'type': 'StorageAccountMicrosoftEndpoints'}, + 'internet_endpoints': {'key': 'internetEndpoints', 'type': 'StorageAccountInternetEndpoints'}, + } + + def __init__(self, **kwargs): + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + self.microsoft_endpoints = kwargs.get('microsoft_endpoints', None) + self.internet_endpoints = kwargs.get('internet_endpoints', None) + + +class ErrorResponse(Model): + """An error response from the storage resource provider. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class FileServiceItems(Model): + """FileServiceItems. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of file services returned. + :vartype value: + list[~azure.mgmt.storage.v2019_06_01.models.FileServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FileServiceProperties]'}, + } + + def __init__(self, **kwargs): + super(FileServiceItems, self).__init__(**kwargs) + self.value = None + + +class FileServiceProperties(Resource): + """The properties of File services in storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param cors: Specifies CORS rules for the File service. You can include up + to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the File service. + :type cors: ~azure.mgmt.storage.v2019_06_01.models.CorsRules + :param share_delete_retention_policy: The file service properties for + share soft delete. + :type share_delete_retention_policy: + ~azure.mgmt.storage.v2019_06_01.models.DeleteRetentionPolicy + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2019_06_01.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'share_delete_retention_policy': {'key': 'properties.shareDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(FileServiceProperties, self).__init__(**kwargs) + self.cors = kwargs.get('cors', None) + self.share_delete_retention_policy = kwargs.get('share_delete_retention_policy', None) + self.sku = None + + +class FileShare(AzureEntityResource): + """Properties of the file share, including Id, resource name, resource type, + Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar last_modified_time: Returns the date and time the share was last + modified. + :vartype last_modified_time: datetime + :param metadata: A name-value pair to associate with the share as + metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be + greater than 0, and less than or equal to 5TB (5120). For Large File + Shares, the maximum size is 102400. + :type share_quota: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(FileShare, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = kwargs.get('metadata', None) + self.share_quota = kwargs.get('share_quota', None) + + +class FileShareItem(AzureEntityResource): + """The file share properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar last_modified_time: Returns the date and time the share was last + modified. + :vartype last_modified_time: datetime + :param metadata: A name-value pair to associate with the share as + metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be + greater than 0, and less than or equal to 5TB (5120). For Large File + Shares, the maximum size is 102400. + :type share_quota: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(FileShareItem, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = kwargs.get('metadata', None) + self.share_quota = kwargs.get('share_quota', None) + + +class GeoReplicationStats(Model): + """Statistics related to replication for storage account's Blob, Table, Queue + and File services. It is only available when geo-redundant replication is + enabled for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of the secondary location. Possible values are: - + Live: Indicates that the secondary location is active and operational. - + Bootstrap: Indicates initial synchronization from the primary location to + the secondary location is in progress.This typically occurs when + replication is first enabled. - Unavailable: Indicates that the secondary + location is temporarily unavailable. Possible values include: 'Live', + 'Bootstrap', 'Unavailable' + :vartype status: str or + ~azure.mgmt.storage.v2019_06_01.models.GeoReplicationStatus + :ivar last_sync_time: All primary writes preceding this UTC date/time + value are guaranteed to be available for read operations. Primary writes + following this point in time may or may not be available for reads. + Element may be default value if value of LastSyncTime is not available, + this can happen if secondary is offline or we are in bootstrap. + :vartype last_sync_time: datetime + :ivar can_failover: A boolean flag which indicates whether or not account + failover is supported for the account. + :vartype can_failover: bool + """ + + _validation = { + 'status': {'readonly': True}, + 'last_sync_time': {'readonly': True}, + 'can_failover': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, + 'can_failover': {'key': 'canFailover', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(GeoReplicationStats, self).__init__(**kwargs) + self.status = None + self.last_sync_time = None + self.can_failover = None + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed + for unlocked time-based retention policies. When enabled, new blocks can + be written to an append blob while maintaining immutability protection and + compliance. Only new blocks can be added and any existing blocks cannot be + modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + self.allow_protected_append_writes = kwargs.get('allow_protected_append_writes', None) + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed + for unlocked time-based retention policies. When enabled, new blocks can + be written to an append blob while maintaining immutability protection and + compliance. Only new blocks can be added and any existing blocks cannot be + modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2019_06_01.models.UpdateHistoryProperty] + """ + + _validation = { + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, **kwargs): + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None) + self.state = None + self.allow_protected_append_writes = kwargs.get('allow_protected_append_writes', None) + self.etag = None + self.update_history = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2019_06_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.action = kwargs.get('action', "Allow") + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + self.key_version = kwargs.get('key_version', None) + self.key_vault_uri = kwargs.get('key_vault_uri', None) + + +class LeaseContainerRequest(Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the + available actions. Possible values include: 'Acquire', 'Renew', 'Change', + 'Release', 'Break' + :type action: str or ~azure.mgmt.storage.v2019_06_01.models.enum + :param lease_id: Identifies the lease. Can be specified in any valid GUID + string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the + lease should continue before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the + lease, in seconds, or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. + Proposed lease ID, in a GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = kwargs.get('action', None) + self.lease_id = kwargs.get('lease_id', None) + self.break_period = kwargs.get('break_period', None) + self.lease_duration = kwargs.get('lease_duration', None) + self.proposed_lease_id = kwargs.get('proposed_lease_id', None) + + +class LeaseContainerResponse(Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any + request to delete the container, or to renew, change, or release the + lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, + in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = kwargs.get('lease_id', None) + self.lease_time_seconds = kwargs.get('lease_time_seconds', None) + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2019_06_01.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, **kwargs): + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = kwargs.get('tags', None) + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2019_06_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2019_06_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2019_06_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2019_06_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2019_06_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = kwargs.get('public_access', None) + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = kwargs.get('metadata', None) + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class ManagementPolicy(Resource): + """The Get Storage Account ManagementPolicies operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar last_modified_time: Returns the date and time the ManagementPolicies + was last modified. + :vartype last_modified_time: datetime + :param policy: Required. The Storage Account ManagementPolicy, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: + ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'policy': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicy, self).__init__(**kwargs) + self.last_modified_time = None + self.policy = kwargs.get('policy', None) + + +class ManagementPolicyAction(Model): + """Actions are applied to the filtered blobs when the execution condition is + met. + + :param base_blob: The management policy action for base blob + :type base_blob: + ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyBaseBlob + :param snapshot: The management policy action for snapshot + :type snapshot: + ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicySnapShot + """ + + _attribute_map = { + 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, + 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyAction, self).__init__(**kwargs) + self.base_blob = kwargs.get('base_blob', None) + self.snapshot = kwargs.get('snapshot', None) + + +class ManagementPolicyBaseBlob(Model): + """Management policy action for base blob. + + :param tier_to_cool: The function to tier blobs to cool storage. Support + blobs currently at Hot tier + :type tier_to_cool: + ~azure.mgmt.storage.v2019_06_01.models.DateAfterModification + :param tier_to_archive: The function to tier blobs to archive storage. + Support blobs currently at Hot or Cool tier + :type tier_to_archive: + ~azure.mgmt.storage.v2019_06_01.models.DateAfterModification + :param delete: The function to delete the blob + :type delete: ~azure.mgmt.storage.v2019_06_01.models.DateAfterModification + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, + 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyBaseBlob, self).__init__(**kwargs) + self.tier_to_cool = kwargs.get('tier_to_cool', None) + self.tier_to_archive = kwargs.get('tier_to_archive', None) + self.delete = kwargs.get('delete', None) + + +class ManagementPolicyDefinition(Model): + """An object that defines the Lifecycle rule. Each definition is made up with + a filters set and an actions set. + + All required parameters must be populated in order to send to Azure. + + :param actions: Required. An object that defines the action set. + :type actions: + ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyAction + :param filters: An object that defines the filter set. + :type filters: + ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyFilter + """ + + _validation = { + 'actions': {'required': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, + 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyDefinition, self).__init__(**kwargs) + self.actions = kwargs.get('actions', None) + self.filters = kwargs.get('filters', None) + + +class ManagementPolicyFilter(Model): + """Filters limit rule actions to a subset of blobs within the storage account. + If multiple filters are defined, a logical AND is performed on all filters. + . + + All required parameters must be populated in order to send to Azure. + + :param prefix_match: An array of strings for prefixes to be match. + :type prefix_match: list[str] + :param blob_types: Required. An array of predefined enum values. Only + blockBlob is supported. + :type blob_types: list[str] + """ + + _validation = { + 'blob_types': {'required': True}, + } + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicyFilter, self).__init__(**kwargs) + self.prefix_match = kwargs.get('prefix_match', None) + self.blob_types = kwargs.get('blob_types', None) + + +class ManagementPolicyRule(Model): + """An object that wraps the Lifecycle rule. Each rule is uniquely defined by + name. + + 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 enabled: Rule is enabled if set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha + numeric characters. Rule name is case-sensitive. It must be unique within + a policy. + :type name: str + :ivar type: Required. The valid value is Lifecycle. Default value: + "Lifecycle" . + :vartype type: str + :param definition: Required. An object that defines the Lifecycle rule. + :type definition: + ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyDefinition + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, + } + + type = "Lifecycle" + + def __init__(self, **kwargs): + super(ManagementPolicyRule, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.name = kwargs.get('name', None) + self.definition = kwargs.get('definition', None) + + +class ManagementPolicySchema(Model): + """The Storage Account ManagementPolicies Rules. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + All required parameters must be populated in order to send to Azure. + + :param rules: Required. The Storage Account ManagementPolicies Rules. See + more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type rules: + list[~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicySchema, self).__init__(**kwargs) + self.rules = kwargs.get('rules', None) + + +class ManagementPolicySnapShot(Model): + """Management policy action for snapshot. + + :param delete: The function to delete the blob snapshot + :type delete: ~azure.mgmt.storage.v2019_06_01.models.DateAfterCreation + """ + + _attribute_map = { + 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, + } + + def __init__(self, **kwargs): + super(ManagementPolicySnapShot, self).__init__(**kwargs) + self.delete = kwargs.get('delete', None) + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2019_06_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.dimensions = kwargs.get('dimensions', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.category = kwargs.get('category', None) + self.resource_id_dimension_name_override = kwargs.get('resource_id_dimension_name_override', None) + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2019_06_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2019_06_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2019_06_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2019_06_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', "AzureServices") + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.default_action = kwargs.get('default_action', "Allow") + + +class ObjectReplicationPolicy(Resource): + """The replication policy between two storage accounts. Multiple rules can be + defined in one policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar policy_id: A unique id for object replication policy. + :vartype policy_id: str + :ivar enabled_time: Indicates when the policy is enabled on the source + account. + :vartype enabled_time: datetime + :param source_account: Required. Required. Source account name. + :type source_account: str + :param destination_account: Required. Required. Destination account name. + :type destination_account: str + :param rules: The storage account object replication rules. + :type rules: + list[~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicyRule] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'policy_id': {'readonly': True}, + 'enabled_time': {'readonly': True}, + 'source_account': {'required': True}, + 'destination_account': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy_id': {'key': 'properties.policyId', 'type': 'str'}, + 'enabled_time': {'key': 'properties.enabledTime', 'type': 'iso-8601'}, + 'source_account': {'key': 'properties.sourceAccount', 'type': 'str'}, + 'destination_account': {'key': 'properties.destinationAccount', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[ObjectReplicationPolicyRule]'}, + } + + def __init__(self, **kwargs): + super(ObjectReplicationPolicy, self).__init__(**kwargs) + self.policy_id = None + self.enabled_time = None + self.source_account = kwargs.get('source_account', None) + self.destination_account = kwargs.get('destination_account', None) + self.rules = kwargs.get('rules', None) + + +class ObjectReplicationPolicyFilter(Model): + """Filters limit replication to a subset of blobs within the storage account. + A logical OR is performed on values in the filter. If multiple filters are + defined, a logical AND is performed on all filters. + + :param prefix_match: Optional. Filters the results to replicate only blobs + whose names begin with the specified prefix. + :type prefix_match: list[str] + :param min_creation_time: Blobs created after the time will be replicated + to the destination. It must be in datetime format + 'yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'. Example: 2020-02-19T16:05:00Z + :type min_creation_time: str + """ + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'min_creation_time': {'key': 'minCreationTime', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ObjectReplicationPolicyFilter, self).__init__(**kwargs) + self.prefix_match = kwargs.get('prefix_match', None) + self.min_creation_time = kwargs.get('min_creation_time', None) + + +class ObjectReplicationPolicyRule(Model): + """The replication policy rule between two containers. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Rule Id is auto-generated for each new rule on destination + account. It is required for put policy on source account. + :type rule_id: str + :param source_container: Required. Required. Source container name. + :type source_container: str + :param destination_container: Required. Required. Destination container + name. + :type destination_container: str + :param filters: Optional. An object that defines the filter set. + :type filters: + ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicyFilter + """ + + _validation = { + 'source_container': {'required': True}, + 'destination_container': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'source_container': {'key': 'sourceContainer', 'type': 'str'}, + 'destination_container': {'key': 'destinationContainer', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': 'ObjectReplicationPolicyFilter'}, + } + + def __init__(self, **kwargs): + super(ObjectReplicationPolicyRule, self).__init__(**kwargs) + self.rule_id = kwargs.get('rule_id', None) + self.source_container = kwargs.get('source_container', None) + self.destination_container = kwargs.get('destination_container', None) + self.filters = kwargs.get('filters', None) + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2019_06_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2019_06_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :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 + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: + ~azure.mgmt.storage.v2019_06_01.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.storage.v2019_06_01.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.storage.v2019_06_01.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class PrivateLinkResource(Resource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS + zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = kwargs.get('required_zone_names', None) + + +class PrivateLinkResourceListResult(Model): + """A list of private link resources. + + :param value: Array of private link resources + :type value: + list[~azure.mgmt.storage.v2019_06_01.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected' + :type status: str or + ~azure.mgmt.storage.v2019_06_01.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param action_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type action_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'action_required': {'key': 'actionRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.action_required = kwargs.get('action_required', None) + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + + +class RestorePolicyProperties(Model): + """The blob service properties for blob restore policy. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Blob restore is enabled if set to true. + :type enabled: bool + :param days: how long this blob can be restored. It should be great than + zero and less than DeleteRetentionPolicy.days. + :type days: int + """ + + _validation = { + 'enabled': {'required': True}, + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(RestorePolicyProperties, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.days = kwargs.get('days', None) + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2019_06_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = kwargs.get('reason_code', None) + + +class RoutingPreference(Model): + """Routing preference defines the type of network, either microsoft or + internet routing to be used to deliver the user data, the default option is + microsoft routing. + + :param routing_choice: Routing Choice defines the kind of network routing + opted by the user. Possible values include: 'MicrosoftRouting', + 'InternetRouting' + :type routing_choice: str or + ~azure.mgmt.storage.v2019_06_01.models.RoutingChoice + :param publish_microsoft_endpoints: A boolean flag which indicates whether + microsoft routing storage endpoints are to be published + :type publish_microsoft_endpoints: bool + :param publish_internet_endpoints: A boolean flag which indicates whether + internet routing storage endpoints are to be published + :type publish_internet_endpoints: bool + """ + + _attribute_map = { + 'routing_choice': {'key': 'routingChoice', 'type': 'str'}, + 'publish_microsoft_endpoints': {'key': 'publishMicrosoftEndpoints', 'type': 'bool'}, + 'publish_internet_endpoints': {'key': 'publishInternetEndpoints', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(RoutingPreference, self).__init__(**kwargs) + self.routing_choice = kwargs.get('routing_choice', None) + self.publish_microsoft_endpoints = kwargs.get('publish_microsoft_endpoints', None) + self.publish_internet_endpoints = kwargs.get('publish_internet_endpoints', None) + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. + Possible values include: Blob (b), Container (c), File (f), Share (s). + Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2019_06_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2019_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2019_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = kwargs.get('canonicalized_resource', None) + self.resource = kwargs.get('resource', None) + self.permissions = kwargs.get('permissions', None) + self.ip_address_or_range = kwargs.get('ip_address_or_range', None) + self.protocols = kwargs.get('protocols', None) + self.shared_access_start_time = kwargs.get('shared_access_start_time', None) + self.shared_access_expiry_time = kwargs.get('shared_access_expiry_time', None) + self.identifier = kwargs.get('identifier', None) + self.partition_key_start = kwargs.get('partition_key_start', None) + self.partition_key_end = kwargs.get('partition_key_end', None) + self.row_key_start = kwargs.get('row_key_start', None) + self.row_key_end = kwargs.get('row_key_end', None) + self.key_to_sign = kwargs.get('key_to_sign', None) + self.cache_control = kwargs.get('cache_control', None) + self.content_disposition = kwargs.get('content_disposition', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_type = kwargs.get('content_type', None) + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2019_06_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Sku(Model): + """The SKU of the storage account. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS' + :type name: str or ~azure.mgmt.storage.v2019_06_01.models.SkuName + :param tier: Possible values include: 'Standard', 'Premium' + :type tier: str or ~azure.mgmt.storage.v2019_06_01.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class SKUCapability(Model): + """The capability information in the specified SKU, including file encryption, + network ACLs, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified SKU, including file encryption, network ACLs, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class SkuInformation(Model): + """Storage SKU and its properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS' + :type name: str or ~azure.mgmt.storage.v2019_06_01.models.SkuName + :param tier: Possible values include: 'Standard', 'Premium' + :type tier: str or ~azure.mgmt.storage.v2019_06_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2019_06_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified SKU, + including file encryption, network ACLs, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2019_06_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2019_06_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, **kwargs): + super(SkuInformation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = kwargs.get('restrictions', None) + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + + +class StorageAccount(TrackedResource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2019_06_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2019_06_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2019_06_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2019_06_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2019_06_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2019_06_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2019_06_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2019_06_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2019_06_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2019_06_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2019_06_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2019_06_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2019_06_01.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + :ivar geo_replication_stats: Geo Replication Stats + :vartype geo_replication_stats: + ~azure.mgmt.storage.v2019_06_01.models.GeoReplicationStats + :ivar failover_in_progress: If the failover is in progress, the value will + be true, otherwise, it will be null. + :vartype failover_in_progress: bool + :param large_file_shares_state: Allow large file shares if sets to + Enabled. It cannot be disabled once it is enabled. Possible values + include: 'Disabled', 'Enabled' + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2019_06_01.models.LargeFileSharesState + :ivar private_endpoint_connections: List of private endpoint connection + associated with the specified storage account + :vartype private_endpoint_connections: + list[~azure.mgmt.storage.v2019_06_01.models.PrivateEndpointConnection] + :param routing_preference: Maintains information about the network routing + choice opted by the user for data transfer + :type routing_preference: + ~azure.mgmt.storage.v2019_06_01.models.RoutingPreference + :ivar blob_restore_status: Blob restore status + :vartype blob_restore_status: + ~azure.mgmt.storage.v2019_06_01.models.BlobRestoreStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + 'geo_replication_stats': {'readonly': True}, + 'failover_in_progress': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'blob_restore_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, + 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'blob_restore_status': {'key': 'properties.blobRestoreStatus', 'type': 'BlobRestoreStatus'}, + } + + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.sku = None + self.kind = None + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.azure_files_identity_based_authentication = kwargs.get('azure_files_identity_based_authentication', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.network_rule_set = None + self.is_hns_enabled = kwargs.get('is_hns_enabled', None) + self.geo_replication_stats = None + self.failover_in_progress = None + self.large_file_shares_state = kwargs.get('large_file_shares_state', None) + self.private_endpoint_connections = None + self.routing_preference = kwargs.get('routing_preference', None) + self.blob_restore_status = None + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 name: Required. The storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, **kwargs): + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU name. + :type sku: ~azure.mgmt.storage.v2019_06_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2019_06_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2019_06_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2019_06_01.models.CustomDomain + :param encryption: Not applicable. Azure Storage encryption is enabled for + all storage accounts and cannot be disabled. + :type encryption: ~azure.mgmt.storage.v2019_06_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2019_06_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2019_06_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2019_06_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. The default value is true since API version + 2019-04-01. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + :param large_file_shares_state: Allow large file shares if sets to + Enabled. It cannot be disabled once it is enabled. Possible values + include: 'Disabled', 'Enabled' + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2019_06_01.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing + choice opted by the user for data transfer + :type routing_preference: + ~azure.mgmt.storage.v2019_06_01.models.RoutingPreference + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + } + + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.access_tier = kwargs.get('access_tier', None) + self.azure_files_identity_based_authentication = kwargs.get('azure_files_identity_based_authentication', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.is_hns_enabled = kwargs.get('is_hns_enabled', None) + self.large_file_shares_state = kwargs.get('large_file_shares_state', None) + self.routing_preference = kwargs.get('routing_preference', None) + + +class StorageAccountInternetEndpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, file, web + or dfs object via a internet routing endpoint. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountInternetEndpoints, self).__init__(**kwargs) + self.blob = None + self.file = None + self.web = None + self.dfs = None + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2019_06_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs): + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2019_06_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs): + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountMicrosoftEndpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object via a microsoft routing endpoint. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountMicrosoftEndpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2, kerb1, kerb2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of + those SKU names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2019_06_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2019_06_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2019_06_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2019_06_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2019_06_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2019_06_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2019_06_01.models.NetworkRuleSet + :param large_file_shares_state: Allow large file shares if sets to + Enabled. It cannot be disabled once it is enabled. Possible values + include: 'Disabled', 'Enabled' + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2019_06_01.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing + choice opted by the user for data transfer + :type routing_preference: + ~azure.mgmt.storage.v2019_06_01.models.RoutingPreference + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2019_06_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.custom_domain = kwargs.get('custom_domain', None) + self.encryption = kwargs.get('encryption', None) + self.access_tier = kwargs.get('access_tier', None) + self.azure_files_identity_based_authentication = kwargs.get('azure_files_identity_based_authentication', None) + self.enable_https_traffic_only = kwargs.get('enable_https_traffic_only', None) + self.network_rule_set = kwargs.get('network_rule_set', None) + self.large_file_shares_state = kwargs.get('large_file_shares_state', None) + self.routing_preference = kwargs.get('routing_preference', None) + self.kind = kwargs.get('kind', None) + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2019_06_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2019_06_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2019_06_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2019_06_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = kwargs.get('virtual_network_resource_id', None) + self.action = kwargs.get('action', "Allow") + self.state = kwargs.get('state', None) diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/models/_models_py3.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/models/_models_py3.py new file mode 100644 index 00000000000..2f256579796 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/models/_models_py3.py @@ -0,0 +1,3734 @@ +# 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 AccountSasParameters(Model): + """The parameters to list SAS credentials of a storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: Required. The signed services accessible with the account + SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + Possible values include: 'b', 'q', 't', 'f' + :type services: str or ~azure.mgmt.storage.v2019_06_01.models.Services + :param resource_types: Required. The signed resource types that are + accessible with the account SAS. Service (s): Access to service-level + APIs; Container (c): Access to container-level APIs; Object (o): Access to + object-level APIs for blobs, queue messages, table entities, and files. + Possible values include: 's', 'c', 'o' + :type resource_types: str or + ~azure.mgmt.storage.v2019_06_01.models.SignedResourceTypes + :param permissions: Required. The signed permissions for the account SAS. + Possible values include: Read (r), Write (w), Delete (d), List (l), Add + (a), Create (c), Update (u) and Process (p). Possible values include: 'r', + 'd', 'w', 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2019_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2019_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: Required. The time at which the shared + access signature becomes invalid. + :type shared_access_expiry_time: datetime + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + """ + + _validation = { + 'services': {'required': True}, + 'resource_types': {'required': True}, + 'permissions': {'required': True}, + 'shared_access_expiry_time': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'signedServices', 'type': 'str'}, + 'resource_types': {'key': 'signedResourceTypes', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + } + + def __init__(self, *, services, resource_types, permissions, shared_access_expiry_time, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, key_to_sign: str=None, **kwargs) -> None: + super(AccountSasParameters, self).__init__(**kwargs) + self.services = services + self.resource_types = resource_types + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.key_to_sign = key_to_sign + + +class ActiveDirectoryProperties(Model): + """Settings properties for Active Directory (AD). + + All required parameters must be populated in order to send to Azure. + + :param domain_name: Required. Specifies the primary domain that the AD DNS + server is authoritative for. + :type domain_name: str + :param net_bios_domain_name: Required. Specifies the NetBIOS domain name. + :type net_bios_domain_name: str + :param forest_name: Required. Specifies the Active Directory forest to + get. + :type forest_name: str + :param domain_guid: Required. Specifies the domain GUID. + :type domain_guid: str + :param domain_sid: Required. Specifies the security identifier (SID). + :type domain_sid: str + :param azure_storage_sid: Required. Specifies the security identifier + (SID) for Azure Storage. + :type azure_storage_sid: str + """ + + _validation = { + 'domain_name': {'required': True}, + 'net_bios_domain_name': {'required': True}, + 'forest_name': {'required': True}, + 'domain_guid': {'required': True}, + 'domain_sid': {'required': True}, + 'azure_storage_sid': {'required': True}, + } + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'net_bios_domain_name': {'key': 'netBiosDomainName', 'type': 'str'}, + 'forest_name': {'key': 'forestName', 'type': 'str'}, + 'domain_guid': {'key': 'domainGuid', 'type': 'str'}, + 'domain_sid': {'key': 'domainSid', 'type': 'str'}, + 'azure_storage_sid': {'key': 'azureStorageSid', 'type': 'str'}, + } + + def __init__(self, *, domain_name: str, net_bios_domain_name: str, forest_name: str, domain_guid: str, domain_sid: str, azure_storage_sid: str, **kwargs) -> None: + super(ActiveDirectoryProperties, self).__init__(**kwargs) + self.domain_name = domain_name + self.net_bios_domain_name = net_bios_domain_name + self.forest_name = forest_name + self.domain_guid = domain_guid + self.domain_sid = domain_sid + self.azure_storage_sid = azure_storage_sid + + +class Resource(Model): + """Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class AzureFilesIdentityBasedAuthentication(Model): + """Settings for Azure Files identity based authentication. + + All required parameters must be populated in order to send to Azure. + + :param directory_service_options: Required. Indicates the directory + service used. Possible values include: 'None', 'AADDS', 'AD' + :type directory_service_options: str or + ~azure.mgmt.storage.v2019_06_01.models.DirectoryServiceOptions + :param active_directory_properties: Required if choose AD. + :type active_directory_properties: + ~azure.mgmt.storage.v2019_06_01.models.ActiveDirectoryProperties + """ + + _validation = { + 'directory_service_options': {'required': True}, + } + + _attribute_map = { + 'directory_service_options': {'key': 'directoryServiceOptions', 'type': 'str'}, + 'active_directory_properties': {'key': 'activeDirectoryProperties', 'type': 'ActiveDirectoryProperties'}, + } + + def __init__(self, *, directory_service_options, active_directory_properties=None, **kwargs) -> None: + super(AzureFilesIdentityBasedAuthentication, self).__init__(**kwargs) + self.directory_service_options = directory_service_options + self.active_directory_properties = active_directory_properties + + +class BlobContainer(AzureEntityResource): + """Properties of the blob container, including Id, resource name, resource + type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2019_06_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2019_06_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2019_06_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2019_06_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2019_06_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(BlobContainer, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class BlobRestoreParameters(Model): + """Blob restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param time_to_restore: Required. Restore blob to the specified time. + :type time_to_restore: datetime + :param blob_ranges: Required. Blob ranges to restore. + :type blob_ranges: + list[~azure.mgmt.storage.v2019_06_01.models.BlobRestoreRange] + """ + + _validation = { + 'time_to_restore': {'required': True}, + 'blob_ranges': {'required': True}, + } + + _attribute_map = { + 'time_to_restore': {'key': 'timeToRestore', 'type': 'iso-8601'}, + 'blob_ranges': {'key': 'blobRanges', 'type': '[BlobRestoreRange]'}, + } + + def __init__(self, *, time_to_restore, blob_ranges, **kwargs) -> None: + super(BlobRestoreParameters, self).__init__(**kwargs) + self.time_to_restore = time_to_restore + self.blob_ranges = blob_ranges + + +class BlobRestoreRange(Model): + """Blob range. + + All required parameters must be populated in order to send to Azure. + + :param start_range: Required. Blob start range. Empty means account start. + :type start_range: str + :param end_range: Required. Blob end range. Empty means account end. + :type end_range: str + """ + + _validation = { + 'start_range': {'required': True}, + 'end_range': {'required': True}, + } + + _attribute_map = { + 'start_range': {'key': 'startRange', 'type': 'str'}, + 'end_range': {'key': 'endRange', 'type': 'str'}, + } + + def __init__(self, *, start_range: str, end_range: str, **kwargs) -> None: + super(BlobRestoreRange, self).__init__(**kwargs) + self.start_range = start_range + self.end_range = end_range + + +class BlobRestoreStatus(Model): + """Blob restore status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of blob restore progress. Possible values are: - + InProgress: Indicates that blob restore is ongoing. - Complete: Indicates + that blob restore has been completed successfully. - Failed: Indicates + that blob restore is failed. Possible values include: 'InProgress', + 'Complete', 'Failed' + :vartype status: str or + ~azure.mgmt.storage.v2019_06_01.models.BlobRestoreProgressStatus + :ivar failure_reason: Failure reason when blob restore is failed. + :vartype failure_reason: str + :ivar restore_id: Id for tracking blob restore request. + :vartype restore_id: str + :ivar parameters: Blob restore request parameters. + :vartype parameters: + ~azure.mgmt.storage.v2019_06_01.models.BlobRestoreParameters + """ + + _validation = { + 'status': {'readonly': True}, + 'failure_reason': {'readonly': True}, + 'restore_id': {'readonly': True}, + 'parameters': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'failure_reason': {'key': 'failureReason', 'type': 'str'}, + 'restore_id': {'key': 'restoreId', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': 'BlobRestoreParameters'}, + } + + def __init__(self, **kwargs) -> None: + super(BlobRestoreStatus, self).__init__(**kwargs) + self.status = None + self.failure_reason = None + self.restore_id = None + self.parameters = None + + +class BlobServiceProperties(Resource): + """The properties of a storage account’s Blob service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param cors: Specifies CORS rules for the Blob service. You can include up + to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the Blob service. + :type cors: ~azure.mgmt.storage.v2019_06_01.models.CorsRules + :param default_service_version: DefaultServiceVersion indicates the + default version to use for requests to the Blob service if an incoming + request’s version is not specified. Possible values include version + 2008-10-27 and all more recent versions. + :type default_service_version: str + :param delete_retention_policy: The blob service properties for blob soft + delete. + :type delete_retention_policy: + ~azure.mgmt.storage.v2019_06_01.models.DeleteRetentionPolicy + :param is_versioning_enabled: Versioning is enabled if set to true. + :type is_versioning_enabled: bool + :param automatic_snapshot_policy_enabled: Deprecated in favor of + isVersioningEnabled property. + :type automatic_snapshot_policy_enabled: bool + :param change_feed: The blob service properties for change feed events. + :type change_feed: ~azure.mgmt.storage.v2019_06_01.models.ChangeFeed + :param restore_policy: The blob service properties for blob restore + policy. + :type restore_policy: + ~azure.mgmt.storage.v2019_06_01.models.RestorePolicyProperties + :param container_delete_retention_policy: The blob service properties for + container soft delete. + :type container_delete_retention_policy: + ~azure.mgmt.storage.v2019_06_01.models.DeleteRetentionPolicy + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2019_06_01.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'}, + 'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'is_versioning_enabled': {'key': 'properties.isVersioningEnabled', 'type': 'bool'}, + 'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'}, + 'change_feed': {'key': 'properties.changeFeed', 'type': 'ChangeFeed'}, + 'restore_policy': {'key': 'properties.restorePolicy', 'type': 'RestorePolicyProperties'}, + 'container_delete_retention_policy': {'key': 'properties.containerDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, cors=None, default_service_version: str=None, delete_retention_policy=None, is_versioning_enabled: bool=None, automatic_snapshot_policy_enabled: bool=None, change_feed=None, restore_policy=None, container_delete_retention_policy=None, **kwargs) -> None: + super(BlobServiceProperties, self).__init__(**kwargs) + self.cors = cors + self.default_service_version = default_service_version + self.delete_retention_policy = delete_retention_policy + self.is_versioning_enabled = is_versioning_enabled + self.automatic_snapshot_policy_enabled = automatic_snapshot_policy_enabled + self.change_feed = change_feed + self.restore_policy = restore_policy + self.container_delete_retention_policy = container_delete_retention_policy + self.sku = None + + +class ChangeFeed(Model): + """The blob service properties for change feed events. + + :param enabled: Indicates whether change feed event logging is enabled for + the Blob service. + :type enabled: bool + """ + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(ChangeFeed, self).__init__(**kwargs) + self.enabled = enabled + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: Gets a boolean value that indicates whether the name + is available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: Gets the reason that a storage account name could not be + used. The Reason element is only returned if NameAvailable is false. + Possible values include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.storage.v2019_06_01.models.Reason + :ivar message: Gets an error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None + + +class CloudError(Model): + """An error response from the Storage service. + + :param error: + :type error: ~azure.mgmt.storage.v2019_06_01.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the Storage service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.storage.v2019_06_01.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class CorsRule(Model): + """Specifies a CORS rule for the Blob service. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. Required if CorsRule element is present. + A list of origin domains that will be allowed via CORS, or "*" to allow + all domains + :type allowed_origins: list[str] + :param allowed_methods: Required. Required if CorsRule element is present. + A list of HTTP methods that are allowed to be executed by the origin. + :type allowed_methods: list[str] + :param max_age_in_seconds: Required. Required if CorsRule element is + present. The number of seconds that the client/browser should cache a + preflight response. + :type max_age_in_seconds: int + :param exposed_headers: Required. Required if CorsRule element is present. + A list of response headers to expose to CORS clients. + :type exposed_headers: list[str] + :param allowed_headers: Required. Required if CorsRule element is present. + A list of headers allowed to be part of the cross-origin request. + :type allowed_headers: list[str] + """ + + _validation = { + 'allowed_origins': {'required': True}, + 'allowed_methods': {'required': True}, + 'max_age_in_seconds': {'required': True}, + 'exposed_headers': {'required': True}, + 'allowed_headers': {'required': True}, + } + + _attribute_map = { + 'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'}, + 'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'}, + 'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'}, + 'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'}, + 'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'}, + } + + def __init__(self, *, allowed_origins, allowed_methods, max_age_in_seconds: int, exposed_headers, allowed_headers, **kwargs) -> None: + super(CorsRule, self).__init__(**kwargs) + self.allowed_origins = allowed_origins + self.allowed_methods = allowed_methods + self.max_age_in_seconds = max_age_in_seconds + self.exposed_headers = exposed_headers + self.allowed_headers = allowed_headers + + +class CorsRules(Model): + """Sets the CORS rules. You can include up to five CorsRule elements in the + request. . + + :param cors_rules: The List of CORS rules. You can include up to five + CorsRule elements in the request. + :type cors_rules: list[~azure.mgmt.storage.v2019_06_01.models.CorsRule] + """ + + _attribute_map = { + 'cors_rules': {'key': 'corsRules', 'type': '[CorsRule]'}, + } + + def __init__(self, *, cors_rules=None, **kwargs) -> None: + super(CorsRules, self).__init__(**kwargs) + self.cors_rules = cors_rules + + +class CustomDomain(Model): + """The custom domain assigned to this storage account. This can be set via + Update. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the custom domain name assigned to the + storage account. Name is the CNAME source. + :type name: str + :param use_sub_domain_name: Indicates whether indirect CName validation is + enabled. Default value is false. This should only be set on updates. + :type use_sub_domain_name: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'}, + } + + def __init__(self, *, name: str, use_sub_domain_name: bool=None, **kwargs) -> None: + super(CustomDomain, self).__init__(**kwargs) + self.name = name + self.use_sub_domain_name = use_sub_domain_name + + +class DateAfterCreation(Model): + """Object to define the number of days after creation. + + All required parameters must be populated in order to send to Azure. + + :param days_after_creation_greater_than: Required. Value indicating the + age in days after creation + :type days_after_creation_greater_than: float + """ + + _validation = { + 'days_after_creation_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_creation_greater_than': {'key': 'daysAfterCreationGreaterThan', 'type': 'float'}, + } + + def __init__(self, *, days_after_creation_greater_than: float, **kwargs) -> None: + super(DateAfterCreation, self).__init__(**kwargs) + self.days_after_creation_greater_than = days_after_creation_greater_than + + +class DateAfterModification(Model): + """Object to define the number of days after last modification. + + All required parameters must be populated in order to send to Azure. + + :param days_after_modification_greater_than: Required. Value indicating + the age in days after last modification + :type days_after_modification_greater_than: float + """ + + _validation = { + 'days_after_modification_greater_than': {'required': True, 'minimum': 0, 'multiple': 1}, + } + + _attribute_map = { + 'days_after_modification_greater_than': {'key': 'daysAfterModificationGreaterThan', 'type': 'float'}, + } + + def __init__(self, *, days_after_modification_greater_than: float, **kwargs) -> None: + super(DateAfterModification, self).__init__(**kwargs) + self.days_after_modification_greater_than = days_after_modification_greater_than + + +class DeleteRetentionPolicy(Model): + """The service properties for soft delete. + + :param enabled: Indicates whether DeleteRetentionPolicy is enabled. + :type enabled: bool + :param days: Indicates the number of days that the deleted item should be + retained. The minimum specified value can be 1 and the maximum value can + be 365. + :type days: int + """ + + _validation = { + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool=None, days: int=None, **kwargs) -> None: + super(DeleteRetentionPolicy, self).__init__(**kwargs) + self.enabled = enabled + self.days = days + + +class Dimension(Model): + """Dimension of blobs, possibly be blob type or access tier. + + :param name: Display name of dimension. + :type name: str + :param display_name: Display name of dimension. + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(Dimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class Encryption(Model): + """The encryption settings on the storage account. + + All required parameters must be populated in order to send to Azure. + + :param services: List of services which support encryption. + :type services: ~azure.mgmt.storage.v2019_06_01.models.EncryptionServices + :param key_source: Required. The encryption keySource (provider). Possible + values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. + Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault'. + Default value: "Microsoft.Storage" . + :type key_source: str or ~azure.mgmt.storage.v2019_06_01.models.KeySource + :param key_vault_properties: Properties provided by key vault. + :type key_vault_properties: + ~azure.mgmt.storage.v2019_06_01.models.KeyVaultProperties + """ + + _validation = { + 'key_source': {'required': True}, + } + + _attribute_map = { + 'services': {'key': 'services', 'type': 'EncryptionServices'}, + 'key_source': {'key': 'keySource', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyvaultproperties', 'type': 'KeyVaultProperties'}, + } + + def __init__(self, *, services=None, key_source="Microsoft.Storage", key_vault_properties=None, **kwargs) -> None: + super(Encryption, self).__init__(**kwargs) + self.services = services + self.key_source = key_source + self.key_vault_properties = key_vault_properties + + +class EncryptionScope(Resource): + """The Encryption Scope resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param source: The provider for the encryption scope. Possible values + (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. Possible + values include: 'Microsoft.Storage', 'Microsoft.KeyVault' + :type source: str or + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeSource + :param state: The state of the encryption scope. Possible values + (case-insensitive): Enabled, Disabled. Possible values include: + 'Enabled', 'Disabled' + :type state: str or + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeState + :ivar creation_time: Gets the creation date and time of the encryption + scope in UTC. + :vartype creation_time: datetime + :ivar last_modified_time: Gets the last modification date and time of the + encryption scope in UTC. + :vartype last_modified_time: datetime + :param key_vault_properties: The key vault properties for the encryption + scope. This is a required field if encryption scope 'source' attribute is + set to 'Microsoft.KeyVault'. + :type key_vault_properties: + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeKeyVaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'source': {'key': 'properties.source', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'EncryptionScopeKeyVaultProperties'}, + } + + def __init__(self, *, source=None, state=None, key_vault_properties=None, **kwargs) -> None: + super(EncryptionScope, self).__init__(**kwargs) + self.source = source + self.state = state + self.creation_time = None + self.last_modified_time = None + self.key_vault_properties = key_vault_properties + + +class EncryptionScopeKeyVaultProperties(Model): + """The key vault properties for the encryption scope. This is a required field + if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'. + + :param key_uri: The object identifier for a key vault key object. When + applied, the encryption scope will use the key referenced by the + identifier to enable customer-managed key support on this encryption + scope. + :type key_uri: str + """ + + _attribute_map = { + 'key_uri': {'key': 'keyUri', 'type': 'str'}, + } + + def __init__(self, *, key_uri: str=None, **kwargs) -> None: + super(EncryptionScopeKeyVaultProperties, self).__init__(**kwargs) + self.key_uri = key_uri + + +class EncryptionService(Model): + """A service that allows server-side encryption to be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: A boolean indicating whether or not the service encrypts + the data as it is stored. + :type enabled: bool + :ivar last_enabled_time: Gets a rough estimate of the date/time when the + encryption was last enabled by the user. Only returned when encryption is + enabled. There might be some unencrypted blobs which were written after + this time, as it is just a rough estimate. + :vartype last_enabled_time: datetime + :param key_type: Encryption key type to be used for the encryption + service. 'Account' key type implies that an account-scoped encryption key + will be used. 'Service' key type implies that a default service key is + used. Possible values include: 'Service', 'Account' + :type key_type: str or ~azure.mgmt.storage.v2019_06_01.models.KeyType + """ + + _validation = { + 'last_enabled_time': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'}, + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, key_type=None, **kwargs) -> None: + super(EncryptionService, self).__init__(**kwargs) + self.enabled = enabled + self.last_enabled_time = None + self.key_type = key_type + + +class EncryptionServices(Model): + """A list of services that support encryption. + + :param blob: The encryption function of the blob storage service. + :type blob: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService + :param file: The encryption function of the file storage service. + :type file: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService + :param table: The encryption function of the table storage service. + :type table: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService + :param queue: The encryption function of the queue storage service. + :type queue: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService + """ + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'EncryptionService'}, + 'file': {'key': 'file', 'type': 'EncryptionService'}, + 'table': {'key': 'table', 'type': 'EncryptionService'}, + 'queue': {'key': 'queue', 'type': 'EncryptionService'}, + } + + def __init__(self, *, blob=None, file=None, table=None, queue=None, **kwargs) -> None: + super(EncryptionServices, self).__init__(**kwargs) + self.blob = blob + self.file = file + self.table = table + self.queue = queue + + +class Endpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + :param microsoft_endpoints: Gets the microsoft routing storage endpoints. + :type microsoft_endpoints: + ~azure.mgmt.storage.v2019_06_01.models.StorageAccountMicrosoftEndpoints + :param internet_endpoints: Gets the internet routing storage endpoints + :type internet_endpoints: + ~azure.mgmt.storage.v2019_06_01.models.StorageAccountInternetEndpoints + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + 'microsoft_endpoints': {'key': 'microsoftEndpoints', 'type': 'StorageAccountMicrosoftEndpoints'}, + 'internet_endpoints': {'key': 'internetEndpoints', 'type': 'StorageAccountInternetEndpoints'}, + } + + def __init__(self, *, microsoft_endpoints=None, internet_endpoints=None, **kwargs) -> None: + super(Endpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + self.microsoft_endpoints = microsoft_endpoints + self.internet_endpoints = internet_endpoints + + +class ErrorResponse(Model): + """An error response from the storage resource provider. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :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(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class FileServiceItems(Model): + """FileServiceItems. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: List of file services returned. + :vartype value: + list[~azure.mgmt.storage.v2019_06_01.models.FileServiceProperties] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[FileServiceProperties]'}, + } + + def __init__(self, **kwargs) -> None: + super(FileServiceItems, self).__init__(**kwargs) + self.value = None + + +class FileServiceProperties(Resource): + """The properties of File services in storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param cors: Specifies CORS rules for the File service. You can include up + to five CorsRule elements in the request. If no CorsRule elements are + included in the request body, all CORS rules will be deleted, and CORS + will be disabled for the File service. + :type cors: ~azure.mgmt.storage.v2019_06_01.models.CorsRules + :param share_delete_retention_policy: The file service properties for + share soft delete. + :type share_delete_retention_policy: + ~azure.mgmt.storage.v2019_06_01.models.DeleteRetentionPolicy + :ivar sku: Sku name and tier. + :vartype sku: ~azure.mgmt.storage.v2019_06_01.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'sku': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'cors': {'key': 'properties.cors', 'type': 'CorsRules'}, + 'share_delete_retention_policy': {'key': 'properties.shareDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, cors=None, share_delete_retention_policy=None, **kwargs) -> None: + super(FileServiceProperties, self).__init__(**kwargs) + self.cors = cors + self.share_delete_retention_policy = share_delete_retention_policy + self.sku = None + + +class FileShare(AzureEntityResource): + """Properties of the file share, including Id, resource name, resource type, + Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar last_modified_time: Returns the date and time the share was last + modified. + :vartype last_modified_time: datetime + :param metadata: A name-value pair to associate with the share as + metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be + greater than 0, and less than or equal to 5TB (5120). For Large File + Shares, the maximum size is 102400. + :type share_quota: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + } + + def __init__(self, *, metadata=None, share_quota: int=None, **kwargs) -> None: + super(FileShare, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = metadata + self.share_quota = share_quota + + +class FileShareItem(AzureEntityResource): + """The file share properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :ivar last_modified_time: Returns the date and time the share was last + modified. + :vartype last_modified_time: datetime + :param metadata: A name-value pair to associate with the share as + metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must be + greater than 0, and less than or equal to 5TB (5120). For Large File + Shares, the maximum size is 102400. + :type share_quota: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'share_quota': {'maximum': 102400, 'minimum': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'share_quota': {'key': 'properties.shareQuota', 'type': 'int'}, + } + + def __init__(self, *, metadata=None, share_quota: int=None, **kwargs) -> None: + super(FileShareItem, self).__init__(**kwargs) + self.last_modified_time = None + self.metadata = metadata + self.share_quota = share_quota + + +class GeoReplicationStats(Model): + """Statistics related to replication for storage account's Blob, Table, Queue + and File services. It is only available when geo-redundant replication is + enabled for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The status of the secondary location. Possible values are: - + Live: Indicates that the secondary location is active and operational. - + Bootstrap: Indicates initial synchronization from the primary location to + the secondary location is in progress.This typically occurs when + replication is first enabled. - Unavailable: Indicates that the secondary + location is temporarily unavailable. Possible values include: 'Live', + 'Bootstrap', 'Unavailable' + :vartype status: str or + ~azure.mgmt.storage.v2019_06_01.models.GeoReplicationStatus + :ivar last_sync_time: All primary writes preceding this UTC date/time + value are guaranteed to be available for read operations. Primary writes + following this point in time may or may not be available for reads. + Element may be default value if value of LastSyncTime is not available, + this can happen if secondary is offline or we are in bootstrap. + :vartype last_sync_time: datetime + :ivar can_failover: A boolean flag which indicates whether or not account + failover is supported for the account. + :vartype can_failover: bool + """ + + _validation = { + 'status': {'readonly': True}, + 'last_sync_time': {'readonly': True}, + 'can_failover': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'last_sync_time': {'key': 'lastSyncTime', 'type': 'iso-8601'}, + 'can_failover': {'key': 'canFailover', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(GeoReplicationStats, self).__init__(**kwargs) + self.status = None + self.last_sync_time = None + self.can_failover = None + + +class Identity(Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: Required. The identity type. Default value: "SystemAssigned" . + :vartype type: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "SystemAssigned" + + def __init__(self, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + + +class ImmutabilityPolicy(AzureEntityResource): + """The ImmutabilityPolicy property of a blob container, including Id, resource + name, resource type, Etag. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed + for unlocked time-based retention policies. When enabled, new blocks can + be written to an append blob while maintaining immutability protection and + compliance. Only new blocks can be added and any existing blocks cannot be + modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int=None, allow_protected_append_writes: bool=None, **kwargs) -> None: + super(ImmutabilityPolicy, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + self.allow_protected_append_writes = allow_protected_append_writes + + +class ImmutabilityPolicyProperties(Model): + """The properties of an ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :type immutability_period_since_creation_in_days: int + :ivar state: The ImmutabilityPolicy state of a blob container, possible + values include: Locked and Unlocked. Possible values include: 'Locked', + 'Unlocked' + :vartype state: str or + ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyState + :param allow_protected_append_writes: This property can only be changed + for unlocked time-based retention policies. When enabled, new blocks can + be written to an append blob while maintaining immutability protection and + compliance. Only new blocks can be added and any existing blocks cannot be + modified or deleted. This property cannot be changed with + ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool + :ivar etag: ImmutabilityPolicy Etag. + :vartype etag: str + :ivar update_history: The ImmutabilityPolicy update history of the blob + container. + :vartype update_history: + list[~azure.mgmt.storage.v2019_06_01.models.UpdateHistoryProperty] + """ + + _validation = { + 'state': {'readonly': True}, + 'etag': {'readonly': True}, + 'update_history': {'readonly': True}, + } + + _attribute_map = { + 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'}, + } + + def __init__(self, *, immutability_period_since_creation_in_days: int=None, allow_protected_append_writes: bool=None, **kwargs) -> None: + super(ImmutabilityPolicyProperties, self).__init__(**kwargs) + self.immutability_period_since_creation_in_days = immutability_period_since_creation_in_days + self.state = None + self.allow_protected_append_writes = allow_protected_append_writes + self.etag = None + self.update_history = None + + +class IPRule(Model): + """IP rule with specific IP or IP range in CIDR format. + + All required parameters must be populated in order to send to Azure. + + :param ip_address_or_range: Required. Specifies the IP or IP range in CIDR + format. Only IPV4 address is allowed. + :type ip_address_or_range: str + :param action: The action of IP ACL rule. Possible values include: + 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2019_06_01.models.Action + """ + + _validation = { + 'ip_address_or_range': {'required': True}, + } + + _attribute_map = { + 'ip_address_or_range': {'key': 'value', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, ip_address_or_range: str, action="Allow", **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.ip_address_or_range = ip_address_or_range + self.action = action + + +class KeyVaultProperties(Model): + """Properties of key vault. + + :param key_name: The name of KeyVault key. + :type key_name: str + :param key_version: The version of KeyVault key. + :type key_version: str + :param key_vault_uri: The Uri of KeyVault. + :type key_vault_uri: str + """ + + _attribute_map = { + 'key_name': {'key': 'keyname', 'type': 'str'}, + 'key_version': {'key': 'keyversion', 'type': 'str'}, + 'key_vault_uri': {'key': 'keyvaulturi', 'type': 'str'}, + } + + def __init__(self, *, key_name: str=None, key_version: str=None, key_vault_uri: str=None, **kwargs) -> None: + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_name = key_name + self.key_version = key_version + self.key_vault_uri = key_vault_uri + + +class LeaseContainerRequest(Model): + """Lease Container request schema. + + All required parameters must be populated in order to send to Azure. + + :param action: Required. Specifies the lease action. Can be one of the + available actions. Possible values include: 'Acquire', 'Renew', 'Change', + 'Release', 'Break' + :type action: str or ~azure.mgmt.storage.v2019_06_01.models.enum + :param lease_id: Identifies the lease. Can be specified in any valid GUID + string format. + :type lease_id: str + :param break_period: Optional. For a break action, proposed duration the + lease should continue before it is broken, in seconds, between 0 and 60. + :type break_period: int + :param lease_duration: Required for acquire. Specifies the duration of the + lease, in seconds, or negative one (-1) for a lease that never expires. + :type lease_duration: int + :param proposed_lease_id: Optional for acquire, required for change. + Proposed lease ID, in a GUID string format. + :type proposed_lease_id: str + """ + + _validation = { + 'action': {'required': True}, + } + + _attribute_map = { + 'action': {'key': 'action', 'type': 'str'}, + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'break_period': {'key': 'breakPeriod', 'type': 'int'}, + 'lease_duration': {'key': 'leaseDuration', 'type': 'int'}, + 'proposed_lease_id': {'key': 'proposedLeaseId', 'type': 'str'}, + } + + def __init__(self, *, action, lease_id: str=None, break_period: int=None, lease_duration: int=None, proposed_lease_id: str=None, **kwargs) -> None: + super(LeaseContainerRequest, self).__init__(**kwargs) + self.action = action + self.lease_id = lease_id + self.break_period = break_period + self.lease_duration = lease_duration + self.proposed_lease_id = proposed_lease_id + + +class LeaseContainerResponse(Model): + """Lease Container response schema. + + :param lease_id: Returned unique lease ID that must be included with any + request to delete the container, or to renew, change, or release the + lease. + :type lease_id: str + :param lease_time_seconds: Approximate time remaining in the lease period, + in seconds. + :type lease_time_seconds: str + """ + + _attribute_map = { + 'lease_id': {'key': 'leaseId', 'type': 'str'}, + 'lease_time_seconds': {'key': 'leaseTimeSeconds', 'type': 'str'}, + } + + def __init__(self, *, lease_id: str=None, lease_time_seconds: str=None, **kwargs) -> None: + super(LeaseContainerResponse, self).__init__(**kwargs) + self.lease_id = lease_id + self.lease_time_seconds = lease_time_seconds + + +class LegalHold(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: Required. Each tag should be 3 to 23 alphanumeric characters + and is normalized to lower case at SRP. + :type tags: list[str] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + 'tags': {'required': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[str]'}, + } + + def __init__(self, *, tags, **kwargs) -> None: + super(LegalHold, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + + +class LegalHoldProperties(Model): + """The LegalHold property of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :param tags: The list of LegalHold tags of a blob container. + :type tags: list[~azure.mgmt.storage.v2019_06_01.models.TagProperty] + """ + + _validation = { + 'has_legal_hold': {'readonly': True}, + } + + _attribute_map = { + 'has_legal_hold': {'key': 'hasLegalHold', 'type': 'bool'}, + 'tags': {'key': 'tags', 'type': '[TagProperty]'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(LegalHoldProperties, self).__init__(**kwargs) + self.has_legal_hold = None + self.tags = tags + + +class ListAccountSasResponse(Model): + """The List SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar account_sas_token: List SAS credentials of storage account. + :vartype account_sas_token: str + """ + + _validation = { + 'account_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'account_sas_token': {'key': 'accountSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListAccountSasResponse, self).__init__(**kwargs) + self.account_sas_token = None + + +class ListContainerItem(AzureEntityResource): + """The blob container properties be listed out. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar etag: Resource Etag. + :vartype etag: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2019_06_01.models.PublicAccess + :ivar last_modified_time: Returns the date and time the container was last + modified. + :vartype last_modified_time: datetime + :ivar lease_status: The lease status of the container. Possible values + include: 'Locked', 'Unlocked' + :vartype lease_status: str or + ~azure.mgmt.storage.v2019_06_01.models.LeaseStatus + :ivar lease_state: Lease state of the container. Possible values include: + 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' + :vartype lease_state: str or + ~azure.mgmt.storage.v2019_06_01.models.LeaseState + :ivar lease_duration: Specifies whether the lease on a container is of + infinite or fixed duration, only when the container is leased. Possible + values include: 'Infinite', 'Fixed' + :vartype lease_duration: str or + ~azure.mgmt.storage.v2019_06_01.models.LeaseDuration + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, str] + :ivar immutability_policy: The ImmutabilityPolicy property of the + container. + :vartype immutability_policy: + ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyProperties + :ivar legal_hold: The LegalHold property of the container. + :vartype legal_hold: + ~azure.mgmt.storage.v2019_06_01.models.LegalHoldProperties + :ivar has_legal_hold: The hasLegalHold public property is set to true by + SRP if there are at least one existing tag. The hasLegalHold public + property is set to false by SRP if all existing legal hold tags are + cleared out. There can be a maximum of 1000 blob containers with + hasLegalHold=true for a given account. + :vartype has_legal_hold: bool + :ivar has_immutability_policy: The hasImmutabilityPolicy public property + is set to true by SRP if ImmutabilityPolicy has been created for this + container. The hasImmutabilityPolicy public property is set to false by + SRP if ImmutabilityPolicy has not been created for this container. + :vartype has_immutability_policy: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'lease_status': {'readonly': True}, + 'lease_state': {'readonly': True}, + 'lease_duration': {'readonly': True}, + 'immutability_policy': {'readonly': True}, + 'legal_hold': {'readonly': True}, + 'has_legal_hold': {'readonly': True}, + 'has_immutability_policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'public_access': {'key': 'properties.publicAccess', 'type': 'PublicAccess'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'lease_status': {'key': 'properties.leaseStatus', 'type': 'str'}, + 'lease_state': {'key': 'properties.leaseState', 'type': 'str'}, + 'lease_duration': {'key': 'properties.leaseDuration', 'type': 'str'}, + 'metadata': {'key': 'properties.metadata', 'type': '{str}'}, + 'immutability_policy': {'key': 'properties.immutabilityPolicy', 'type': 'ImmutabilityPolicyProperties'}, + 'legal_hold': {'key': 'properties.legalHold', 'type': 'LegalHoldProperties'}, + 'has_legal_hold': {'key': 'properties.hasLegalHold', 'type': 'bool'}, + 'has_immutability_policy': {'key': 'properties.hasImmutabilityPolicy', 'type': 'bool'}, + } + + def __init__(self, *, public_access=None, metadata=None, **kwargs) -> None: + super(ListContainerItem, self).__init__(**kwargs) + self.public_access = public_access + self.last_modified_time = None + self.lease_status = None + self.lease_state = None + self.lease_duration = None + self.metadata = metadata + self.immutability_policy = None + self.legal_hold = None + self.has_legal_hold = None + self.has_immutability_policy = None + + +class ListServiceSasResponse(Model): + """The List service SAS credentials operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar service_sas_token: List service SAS credentials of specific + resource. + :vartype service_sas_token: str + """ + + _validation = { + 'service_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'service_sas_token': {'key': 'serviceSasToken', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ListServiceSasResponse, self).__init__(**kwargs) + self.service_sas_token = None + + +class ManagementPolicy(Resource): + """The Get Storage Account ManagementPolicies operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar last_modified_time: Returns the date and time the ManagementPolicies + was last modified. + :vartype last_modified_time: datetime + :param policy: Required. The Storage Account ManagementPolicy, in JSON + format. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: + ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicySchema + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'policy': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'policy': {'key': 'properties.policy', 'type': 'ManagementPolicySchema'}, + } + + def __init__(self, *, policy, **kwargs) -> None: + super(ManagementPolicy, self).__init__(**kwargs) + self.last_modified_time = None + self.policy = policy + + +class ManagementPolicyAction(Model): + """Actions are applied to the filtered blobs when the execution condition is + met. + + :param base_blob: The management policy action for base blob + :type base_blob: + ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyBaseBlob + :param snapshot: The management policy action for snapshot + :type snapshot: + ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicySnapShot + """ + + _attribute_map = { + 'base_blob': {'key': 'baseBlob', 'type': 'ManagementPolicyBaseBlob'}, + 'snapshot': {'key': 'snapshot', 'type': 'ManagementPolicySnapShot'}, + } + + def __init__(self, *, base_blob=None, snapshot=None, **kwargs) -> None: + super(ManagementPolicyAction, self).__init__(**kwargs) + self.base_blob = base_blob + self.snapshot = snapshot + + +class ManagementPolicyBaseBlob(Model): + """Management policy action for base blob. + + :param tier_to_cool: The function to tier blobs to cool storage. Support + blobs currently at Hot tier + :type tier_to_cool: + ~azure.mgmt.storage.v2019_06_01.models.DateAfterModification + :param tier_to_archive: The function to tier blobs to archive storage. + Support blobs currently at Hot or Cool tier + :type tier_to_archive: + ~azure.mgmt.storage.v2019_06_01.models.DateAfterModification + :param delete: The function to delete the blob + :type delete: ~azure.mgmt.storage.v2019_06_01.models.DateAfterModification + """ + + _attribute_map = { + 'tier_to_cool': {'key': 'tierToCool', 'type': 'DateAfterModification'}, + 'tier_to_archive': {'key': 'tierToArchive', 'type': 'DateAfterModification'}, + 'delete': {'key': 'delete', 'type': 'DateAfterModification'}, + } + + def __init__(self, *, tier_to_cool=None, tier_to_archive=None, delete=None, **kwargs) -> None: + super(ManagementPolicyBaseBlob, self).__init__(**kwargs) + self.tier_to_cool = tier_to_cool + self.tier_to_archive = tier_to_archive + self.delete = delete + + +class ManagementPolicyDefinition(Model): + """An object that defines the Lifecycle rule. Each definition is made up with + a filters set and an actions set. + + All required parameters must be populated in order to send to Azure. + + :param actions: Required. An object that defines the action set. + :type actions: + ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyAction + :param filters: An object that defines the filter set. + :type filters: + ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyFilter + """ + + _validation = { + 'actions': {'required': True}, + } + + _attribute_map = { + 'actions': {'key': 'actions', 'type': 'ManagementPolicyAction'}, + 'filters': {'key': 'filters', 'type': 'ManagementPolicyFilter'}, + } + + def __init__(self, *, actions, filters=None, **kwargs) -> None: + super(ManagementPolicyDefinition, self).__init__(**kwargs) + self.actions = actions + self.filters = filters + + +class ManagementPolicyFilter(Model): + """Filters limit rule actions to a subset of blobs within the storage account. + If multiple filters are defined, a logical AND is performed on all filters. + . + + All required parameters must be populated in order to send to Azure. + + :param prefix_match: An array of strings for prefixes to be match. + :type prefix_match: list[str] + :param blob_types: Required. An array of predefined enum values. Only + blockBlob is supported. + :type blob_types: list[str] + """ + + _validation = { + 'blob_types': {'required': True}, + } + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'blob_types': {'key': 'blobTypes', 'type': '[str]'}, + } + + def __init__(self, *, blob_types, prefix_match=None, **kwargs) -> None: + super(ManagementPolicyFilter, self).__init__(**kwargs) + self.prefix_match = prefix_match + self.blob_types = blob_types + + +class ManagementPolicyRule(Model): + """An object that wraps the Lifecycle rule. Each rule is uniquely defined by + name. + + 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 enabled: Rule is enabled if set to true. + :type enabled: bool + :param name: Required. A rule name can contain any combination of alpha + numeric characters. Rule name is case-sensitive. It must be unique within + a policy. + :type name: str + :ivar type: Required. The valid value is Lifecycle. Default value: + "Lifecycle" . + :vartype type: str + :param definition: Required. An object that defines the Lifecycle rule. + :type definition: + ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyDefinition + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + 'definition': {'required': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'definition': {'key': 'definition', 'type': 'ManagementPolicyDefinition'}, + } + + type = "Lifecycle" + + def __init__(self, *, name: str, definition, enabled: bool=None, **kwargs) -> None: + super(ManagementPolicyRule, self).__init__(**kwargs) + self.enabled = enabled + self.name = name + self.definition = definition + + +class ManagementPolicySchema(Model): + """The Storage Account ManagementPolicies Rules. See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + + All required parameters must be populated in order to send to Azure. + + :param rules: Required. The Storage Account ManagementPolicies Rules. See + more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type rules: + list[~azure.mgmt.storage.v2019_06_01.models.ManagementPolicyRule] + """ + + _validation = { + 'rules': {'required': True}, + } + + _attribute_map = { + 'rules': {'key': 'rules', 'type': '[ManagementPolicyRule]'}, + } + + def __init__(self, *, rules, **kwargs) -> None: + super(ManagementPolicySchema, self).__init__(**kwargs) + self.rules = rules + + +class ManagementPolicySnapShot(Model): + """Management policy action for snapshot. + + :param delete: The function to delete the blob snapshot + :type delete: ~azure.mgmt.storage.v2019_06_01.models.DateAfterCreation + """ + + _attribute_map = { + 'delete': {'key': 'delete', 'type': 'DateAfterCreation'}, + } + + def __init__(self, *, delete=None, **kwargs) -> None: + super(ManagementPolicySnapShot, self).__init__(**kwargs) + self.delete = delete + + +class MetricSpecification(Model): + """Metric specification of operation. + + :param name: Name of metric specification. + :type name: str + :param display_name: Display name of metric specification. + :type display_name: str + :param display_description: Display description of metric specification. + :type display_description: str + :param unit: Unit could be Bytes or Count. + :type unit: str + :param dimensions: Dimensions of blobs, including blob type and access + tier. + :type dimensions: list[~azure.mgmt.storage.v2019_06_01.models.Dimension] + :param aggregation_type: Aggregation type could be Average. + :type aggregation_type: str + :param fill_gap_with_zero: The property to decide fill gap with zero or + not. + :type fill_gap_with_zero: bool + :param category: The category this metric specification belong to, could + be Capacity. + :type category: str + :param resource_id_dimension_name_override: Account Resource Id. + :type resource_id_dimension_name_override: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[Dimension]'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'category': {'key': 'category', 'type': 'str'}, + 'resource_id_dimension_name_override': {'key': 'resourceIdDimensionNameOverride', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, dimensions=None, aggregation_type: str=None, fill_gap_with_zero: bool=None, category: str=None, resource_id_dimension_name_override: str=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.dimensions = dimensions + self.aggregation_type = aggregation_type + self.fill_gap_with_zero = fill_gap_with_zero + self.category = category + self.resource_id_dimension_name_override = resource_id_dimension_name_override + + +class NetworkRuleSet(Model): + """Network rule set. + + All required parameters must be populated in order to send to Azure. + + :param bypass: Specifies whether traffic is bypassed for + Logging/Metrics/AzureServices. Possible values are any combination of + Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None + to bypass none of those traffics. Possible values include: 'None', + 'Logging', 'Metrics', 'AzureServices'. Default value: "AzureServices" . + :type bypass: str or ~azure.mgmt.storage.v2019_06_01.models.Bypass + :param virtual_network_rules: Sets the virtual network rules + :type virtual_network_rules: + list[~azure.mgmt.storage.v2019_06_01.models.VirtualNetworkRule] + :param ip_rules: Sets the IP ACL rules + :type ip_rules: list[~azure.mgmt.storage.v2019_06_01.models.IPRule] + :param default_action: Required. Specifies the default action of allow or + deny when no other rules match. Possible values include: 'Allow', 'Deny'. + Default value: "Allow" . + :type default_action: str or + ~azure.mgmt.storage.v2019_06_01.models.DefaultAction + """ + + _validation = { + 'default_action': {'required': True}, + } + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'default_action': {'key': 'defaultAction', 'type': 'DefaultAction'}, + } + + def __init__(self, *, bypass="AzureServices", virtual_network_rules=None, ip_rules=None, default_action="Allow", **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.virtual_network_rules = virtual_network_rules + self.ip_rules = ip_rules + self.default_action = default_action + + +class ObjectReplicationPolicy(Resource): + """The replication policy between two storage accounts. Multiple rules can be + defined in one policy. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar policy_id: A unique id for object replication policy. + :vartype policy_id: str + :ivar enabled_time: Indicates when the policy is enabled on the source + account. + :vartype enabled_time: datetime + :param source_account: Required. Required. Source account name. + :type source_account: str + :param destination_account: Required. Required. Destination account name. + :type destination_account: str + :param rules: The storage account object replication rules. + :type rules: + list[~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicyRule] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'policy_id': {'readonly': True}, + 'enabled_time': {'readonly': True}, + 'source_account': {'required': True}, + 'destination_account': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'policy_id': {'key': 'properties.policyId', 'type': 'str'}, + 'enabled_time': {'key': 'properties.enabledTime', 'type': 'iso-8601'}, + 'source_account': {'key': 'properties.sourceAccount', 'type': 'str'}, + 'destination_account': {'key': 'properties.destinationAccount', 'type': 'str'}, + 'rules': {'key': 'properties.rules', 'type': '[ObjectReplicationPolicyRule]'}, + } + + def __init__(self, *, source_account: str, destination_account: str, rules=None, **kwargs) -> None: + super(ObjectReplicationPolicy, self).__init__(**kwargs) + self.policy_id = None + self.enabled_time = None + self.source_account = source_account + self.destination_account = destination_account + self.rules = rules + + +class ObjectReplicationPolicyFilter(Model): + """Filters limit replication to a subset of blobs within the storage account. + A logical OR is performed on values in the filter. If multiple filters are + defined, a logical AND is performed on all filters. + + :param prefix_match: Optional. Filters the results to replicate only blobs + whose names begin with the specified prefix. + :type prefix_match: list[str] + :param min_creation_time: Blobs created after the time will be replicated + to the destination. It must be in datetime format + 'yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'. Example: 2020-02-19T16:05:00Z + :type min_creation_time: str + """ + + _attribute_map = { + 'prefix_match': {'key': 'prefixMatch', 'type': '[str]'}, + 'min_creation_time': {'key': 'minCreationTime', 'type': 'str'}, + } + + def __init__(self, *, prefix_match=None, min_creation_time: str=None, **kwargs) -> None: + super(ObjectReplicationPolicyFilter, self).__init__(**kwargs) + self.prefix_match = prefix_match + self.min_creation_time = min_creation_time + + +class ObjectReplicationPolicyRule(Model): + """The replication policy rule between two containers. + + All required parameters must be populated in order to send to Azure. + + :param rule_id: Rule Id is auto-generated for each new rule on destination + account. It is required for put policy on source account. + :type rule_id: str + :param source_container: Required. Required. Source container name. + :type source_container: str + :param destination_container: Required. Required. Destination container + name. + :type destination_container: str + :param filters: Optional. An object that defines the filter set. + :type filters: + ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicyFilter + """ + + _validation = { + 'source_container': {'required': True}, + 'destination_container': {'required': True}, + } + + _attribute_map = { + 'rule_id': {'key': 'ruleId', 'type': 'str'}, + 'source_container': {'key': 'sourceContainer', 'type': 'str'}, + 'destination_container': {'key': 'destinationContainer', 'type': 'str'}, + 'filters': {'key': 'filters', 'type': 'ObjectReplicationPolicyFilter'}, + } + + def __init__(self, *, source_container: str, destination_container: str, rule_id: str=None, filters=None, **kwargs) -> None: + super(ObjectReplicationPolicyRule, self).__init__(**kwargs) + self.rule_id = rule_id + self.source_container = source_container + self.destination_container = destination_container + self.filters = filters + + +class Operation(Model): + """Storage REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.storage.v2019_06_01.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.storage.v2019_06_01.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Storage. + :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 + :param description: Description of the operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class PrivateEndpoint(Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The ARM identifier for Private Endpoint + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: + ~azure.mgmt.storage.v2019_06_01.models.PrivateEndpoint + :param private_link_service_connection_state: Required. A collection of + information about the state of the connection between service consumer and + provider. + :type private_link_service_connection_state: + ~azure.mgmt.storage.v2019_06_01.models.PrivateLinkServiceConnectionState + :param provisioning_state: The provisioning state of the private endpoint + connection resource. Possible values include: 'Succeeded', 'Creating', + 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.storage.v2019_06_01.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'private_link_service_connection_state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, private_link_service_connection_state, private_endpoint=None, provisioning_state=None, **kwargs) -> None: + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = provisioning_state + + +class PrivateLinkResource(Resource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS + zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__(self, *, required_zone_names=None, **kwargs) -> None: + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names + + +class PrivateLinkResourceListResult(Model): + """A list of private link resources. + + :param value: Array of private link resources + :type value: + list[~azure.mgmt.storage.v2019_06_01.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(Model): + """A collection of information about the state of the connection between + service consumer and provider. + + :param status: Indicates whether the connection has been + Approved/Rejected/Removed by the owner of the service. Possible values + include: 'Pending', 'Approved', 'Rejected' + :type status: str or + ~azure.mgmt.storage.v2019_06_01.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param action_required: A message indicating if changes on the service + provider require any updates on the consumer. + :type action_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'action_required': {'key': 'actionRequired', 'type': 'str'}, + } + + def __init__(self, *, status=None, description: str=None, action_required: str=None, **kwargs) -> None: + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.action_required = action_required + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + + +class RestorePolicyProperties(Model): + """The blob service properties for blob restore policy. + + All required parameters must be populated in order to send to Azure. + + :param enabled: Required. Blob restore is enabled if set to true. + :type enabled: bool + :param days: how long this blob can be restored. It should be great than + zero and less than DeleteRetentionPolicy.days. + :type days: int + """ + + _validation = { + 'enabled': {'required': True}, + 'days': {'maximum': 365, 'minimum': 1}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'days': {'key': 'days', 'type': 'int'}, + } + + def __init__(self, *, enabled: bool, days: int=None, **kwargs) -> None: + super(RestorePolicyProperties, self).__init__(**kwargs) + self.enabled = enabled + self.days = days + + +class Restriction(Model): + """The restriction because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. As of now only possible value for + this is location. + :vartype type: str + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :param reason_code: The reason for the restriction. As of now this can be + "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU + has requiredQuotas parameter as the subscription does not belong to that + quota. The "NotAvailableForSubscription" is related to capacity at DC. + Possible values include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.storage.v2019_06_01.models.ReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, reason_code=None, **kwargs) -> None: + super(Restriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = reason_code + + +class RoutingPreference(Model): + """Routing preference defines the type of network, either microsoft or + internet routing to be used to deliver the user data, the default option is + microsoft routing. + + :param routing_choice: Routing Choice defines the kind of network routing + opted by the user. Possible values include: 'MicrosoftRouting', + 'InternetRouting' + :type routing_choice: str or + ~azure.mgmt.storage.v2019_06_01.models.RoutingChoice + :param publish_microsoft_endpoints: A boolean flag which indicates whether + microsoft routing storage endpoints are to be published + :type publish_microsoft_endpoints: bool + :param publish_internet_endpoints: A boolean flag which indicates whether + internet routing storage endpoints are to be published + :type publish_internet_endpoints: bool + """ + + _attribute_map = { + 'routing_choice': {'key': 'routingChoice', 'type': 'str'}, + 'publish_microsoft_endpoints': {'key': 'publishMicrosoftEndpoints', 'type': 'bool'}, + 'publish_internet_endpoints': {'key': 'publishInternetEndpoints', 'type': 'bool'}, + } + + def __init__(self, *, routing_choice=None, publish_microsoft_endpoints: bool=None, publish_internet_endpoints: bool=None, **kwargs) -> None: + super(RoutingPreference, self).__init__(**kwargs) + self.routing_choice = routing_choice + self.publish_microsoft_endpoints = publish_microsoft_endpoints + self.publish_internet_endpoints = publish_internet_endpoints + + +class ServiceSasParameters(Model): + """The parameters to list service SAS credentials of a specific resource. + + All required parameters must be populated in order to send to Azure. + + :param canonicalized_resource: Required. The canonical path to the signed + resource. + :type canonicalized_resource: str + :param resource: The signed services accessible with the service SAS. + Possible values include: Blob (b), Container (c), File (f), Share (s). + Possible values include: 'b', 'c', 'f', 's' + :type resource: str or + ~azure.mgmt.storage.v2019_06_01.models.SignedResource + :param permissions: The signed permissions for the service SAS. Possible + values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create + (c), Update (u) and Process (p). Possible values include: 'r', 'd', 'w', + 'l', 'a', 'c', 'u', 'p' + :type permissions: str or + ~azure.mgmt.storage.v2019_06_01.models.Permissions + :param ip_address_or_range: An IP address or a range of IP addresses from + which to accept requests. + :type ip_address_or_range: str + :param protocols: The protocol permitted for a request made with the + account SAS. Possible values include: 'https,http', 'https' + :type protocols: str or + ~azure.mgmt.storage.v2019_06_01.models.HttpProtocol + :param shared_access_start_time: The time at which the SAS becomes valid. + :type shared_access_start_time: datetime + :param shared_access_expiry_time: The time at which the shared access + signature becomes invalid. + :type shared_access_expiry_time: datetime + :param identifier: A unique value up to 64 characters in length that + correlates to an access policy specified for the container, queue, or + table. + :type identifier: str + :param partition_key_start: The start of partition key. + :type partition_key_start: str + :param partition_key_end: The end of partition key. + :type partition_key_end: str + :param row_key_start: The start of row key. + :type row_key_start: str + :param row_key_end: The end of row key. + :type row_key_end: str + :param key_to_sign: The key to sign the account SAS token with. + :type key_to_sign: str + :param cache_control: The response header override for cache control. + :type cache_control: str + :param content_disposition: The response header override for content + disposition. + :type content_disposition: str + :param content_encoding: The response header override for content + encoding. + :type content_encoding: str + :param content_language: The response header override for content + language. + :type content_language: str + :param content_type: The response header override for content type. + :type content_type: str + """ + + _validation = { + 'canonicalized_resource': {'required': True}, + 'identifier': {'max_length': 64}, + } + + _attribute_map = { + 'canonicalized_resource': {'key': 'canonicalizedResource', 'type': 'str'}, + 'resource': {'key': 'signedResource', 'type': 'str'}, + 'permissions': {'key': 'signedPermission', 'type': 'str'}, + 'ip_address_or_range': {'key': 'signedIp', 'type': 'str'}, + 'protocols': {'key': 'signedProtocol', 'type': 'HttpProtocol'}, + 'shared_access_start_time': {'key': 'signedStart', 'type': 'iso-8601'}, + 'shared_access_expiry_time': {'key': 'signedExpiry', 'type': 'iso-8601'}, + 'identifier': {'key': 'signedIdentifier', 'type': 'str'}, + 'partition_key_start': {'key': 'startPk', 'type': 'str'}, + 'partition_key_end': {'key': 'endPk', 'type': 'str'}, + 'row_key_start': {'key': 'startRk', 'type': 'str'}, + 'row_key_end': {'key': 'endRk', 'type': 'str'}, + 'key_to_sign': {'key': 'keyToSign', 'type': 'str'}, + 'cache_control': {'key': 'rscc', 'type': 'str'}, + 'content_disposition': {'key': 'rscd', 'type': 'str'}, + 'content_encoding': {'key': 'rsce', 'type': 'str'}, + 'content_language': {'key': 'rscl', 'type': 'str'}, + 'content_type': {'key': 'rsct', 'type': 'str'}, + } + + def __init__(self, *, canonicalized_resource: str, resource=None, permissions=None, ip_address_or_range: str=None, protocols=None, shared_access_start_time=None, shared_access_expiry_time=None, identifier: str=None, partition_key_start: str=None, partition_key_end: str=None, row_key_start: str=None, row_key_end: str=None, key_to_sign: str=None, cache_control: str=None, content_disposition: str=None, content_encoding: str=None, content_language: str=None, content_type: str=None, **kwargs) -> None: + super(ServiceSasParameters, self).__init__(**kwargs) + self.canonicalized_resource = canonicalized_resource + self.resource = resource + self.permissions = permissions + self.ip_address_or_range = ip_address_or_range + self.protocols = protocols + self.shared_access_start_time = shared_access_start_time + self.shared_access_expiry_time = shared_access_expiry_time + self.identifier = identifier + self.partition_key_start = partition_key_start + self.partition_key_end = partition_key_end + self.row_key_start = row_key_start + self.row_key_end = row_key_end + self.key_to_sign = key_to_sign + self.cache_control = cache_control + self.content_disposition = content_disposition + self.content_encoding = content_encoding + self.content_language = content_language + self.content_type = content_type + + +class ServiceSpecification(Model): + """One property of operation, include metric specifications. + + :param metric_specifications: Metric specifications of operation. + :type metric_specifications: + list[~azure.mgmt.storage.v2019_06_01.models.MetricSpecification] + """ + + _attribute_map = { + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.metric_specifications = metric_specifications + + +class Sku(Model): + """The SKU of the storage account. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS' + :type name: str or ~azure.mgmt.storage.v2019_06_01.models.SkuName + :param tier: Possible values include: 'Standard', 'Premium' + :type tier: str or ~azure.mgmt.storage.v2019_06_01.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, *, name, tier=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +class SKUCapability(Model): + """The capability information in the specified SKU, including file encryption, + network ACLs, change notification, etc. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of capability, The capability information in the + specified SKU, including file encryption, network ACLs, change + notification, etc. + :vartype name: str + :ivar value: A string value to indicate states of given capability. + Possibly 'true' or 'false'. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SKUCapability, self).__init__(**kwargs) + self.name = None + self.value = None + + +class SkuInformation(Model): + """Storage SKU and its properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Possible values include: 'Standard_LRS', + 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', + 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS' + :type name: str or ~azure.mgmt.storage.v2019_06_01.models.SkuName + :param tier: Possible values include: 'Standard', 'Premium' + :type tier: str or ~azure.mgmt.storage.v2019_06_01.models.SkuTier + :ivar resource_type: The type of the resource, usually it is + 'storageAccounts'. + :vartype resource_type: str + :ivar kind: Indicates the type of storage account. Possible values + include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2019_06_01.models.Kind + :ivar locations: The set of locations that the SKU is available. This will + be supported and registered Azure Geo Regions (e.g. West US, East US, + Southeast Asia, etc.). + :vartype locations: list[str] + :ivar capabilities: The capability information in the specified SKU, + including file encryption, network ACLs, change notification, etc. + :vartype capabilities: + list[~azure.mgmt.storage.v2019_06_01.models.SKUCapability] + :param restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.storage.v2019_06_01.models.Restriction] + """ + + _validation = { + 'name': {'required': True}, + 'resource_type': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[SKUCapability]'}, + 'restrictions': {'key': 'restrictions', 'type': '[Restriction]'}, + } + + def __init__(self, *, name, tier=None, restrictions=None, **kwargs) -> None: + super(SkuInformation, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.resource_type = None + self.kind = None + self.locations = None + self.capabilities = None + self.restrictions = restrictions + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class StorageAccount(TrackedResource): + """The storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :ivar sku: Gets the SKU. + :vartype sku: ~azure.mgmt.storage.v2019_06_01.models.Sku + :ivar kind: Gets the Kind. Possible values include: 'Storage', + 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :vartype kind: str or ~azure.mgmt.storage.v2019_06_01.models.Kind + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2019_06_01.models.Identity + :ivar provisioning_state: Gets the status of the storage account at the + time the operation was called. Possible values include: 'Creating', + 'ResolvingDNS', 'Succeeded' + :vartype provisioning_state: str or + ~azure.mgmt.storage.v2019_06_01.models.ProvisioningState + :ivar primary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object. Note that Standard_ZRS + and Premium_LRS accounts only return the blob endpoint. + :vartype primary_endpoints: + ~azure.mgmt.storage.v2019_06_01.models.Endpoints + :ivar primary_location: Gets the location of the primary data center for + the storage account. + :vartype primary_location: str + :ivar status_of_primary: Gets the status indicating whether the primary + location of the storage account is available or unavailable. Possible + values include: 'available', 'unavailable' + :vartype status_of_primary: str or + ~azure.mgmt.storage.v2019_06_01.models.AccountStatus + :ivar last_geo_failover_time: Gets the timestamp of the most recent + instance of a failover to the secondary location. Only the most recent + timestamp is retained. This element is not returned if there has never + been a failover instance. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype last_geo_failover_time: datetime + :ivar secondary_location: Gets the location of the geo-replicated + secondary for the storage account. Only available if the accountType is + Standard_GRS or Standard_RAGRS. + :vartype secondary_location: str + :ivar status_of_secondary: Gets the status indicating whether the + secondary location of the storage account is available or unavailable. + Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible + values include: 'available', 'unavailable' + :vartype status_of_secondary: str or + ~azure.mgmt.storage.v2019_06_01.models.AccountStatus + :ivar creation_time: Gets the creation date and time of the storage + account in UTC. + :vartype creation_time: datetime + :ivar custom_domain: Gets the custom domain the user assigned to this + storage account. + :vartype custom_domain: + ~azure.mgmt.storage.v2019_06_01.models.CustomDomain + :ivar secondary_endpoints: Gets the URLs that are used to perform a + retrieval of a public blob, queue, or table object from the secondary + location of the storage account. Only available if the SKU name is + Standard_RAGRS. + :vartype secondary_endpoints: + ~azure.mgmt.storage.v2019_06_01.models.Endpoints + :ivar encryption: Gets the encryption settings on the account. If + unspecified, the account is unencrypted. + :vartype encryption: ~azure.mgmt.storage.v2019_06_01.models.Encryption + :ivar access_tier: Required for storage accounts where kind = BlobStorage. + The access tier used for billing. Possible values include: 'Hot', 'Cool' + :vartype access_tier: str or + ~azure.mgmt.storage.v2019_06_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2019_06_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :ivar network_rule_set: Network rule set + :vartype network_rule_set: + ~azure.mgmt.storage.v2019_06_01.models.NetworkRuleSet + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + :ivar geo_replication_stats: Geo Replication Stats + :vartype geo_replication_stats: + ~azure.mgmt.storage.v2019_06_01.models.GeoReplicationStats + :ivar failover_in_progress: If the failover is in progress, the value will + be true, otherwise, it will be null. + :vartype failover_in_progress: bool + :param large_file_shares_state: Allow large file shares if sets to + Enabled. It cannot be disabled once it is enabled. Possible values + include: 'Disabled', 'Enabled' + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2019_06_01.models.LargeFileSharesState + :ivar private_endpoint_connections: List of private endpoint connection + associated with the specified storage account + :vartype private_endpoint_connections: + list[~azure.mgmt.storage.v2019_06_01.models.PrivateEndpointConnection] + :param routing_preference: Maintains information about the network routing + choice opted by the user for data transfer + :type routing_preference: + ~azure.mgmt.storage.v2019_06_01.models.RoutingPreference + :ivar blob_restore_status: Blob restore status + :vartype blob_restore_status: + ~azure.mgmt.storage.v2019_06_01.models.BlobRestoreStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'readonly': True}, + 'kind': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'primary_endpoints': {'readonly': True}, + 'primary_location': {'readonly': True}, + 'status_of_primary': {'readonly': True}, + 'last_geo_failover_time': {'readonly': True}, + 'secondary_location': {'readonly': True}, + 'status_of_secondary': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'custom_domain': {'readonly': True}, + 'secondary_endpoints': {'readonly': True}, + 'encryption': {'readonly': True}, + 'access_tier': {'readonly': True}, + 'network_rule_set': {'readonly': True}, + 'geo_replication_stats': {'readonly': True}, + 'failover_in_progress': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'blob_restore_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'}, + 'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'}, + 'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'AccountStatus'}, + 'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'}, + 'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'}, + 'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'AccountStatus'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'geo_replication_stats': {'key': 'properties.geoReplicationStats', 'type': 'GeoReplicationStats'}, + 'failover_in_progress': {'key': 'properties.failoverInProgress', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'blob_restore_status': {'key': 'properties.blobRestoreStatus', 'type': 'BlobRestoreStatus'}, + } + + def __init__(self, *, location: str, tags=None, identity=None, azure_files_identity_based_authentication=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, large_file_shares_state=None, routing_preference=None, **kwargs) -> None: + super(StorageAccount, self).__init__(tags=tags, location=location, **kwargs) + self.sku = None + self.kind = None + self.identity = identity + self.provisioning_state = None + self.primary_endpoints = None + self.primary_location = None + self.status_of_primary = None + self.last_geo_failover_time = None + self.secondary_location = None + self.status_of_secondary = None + self.creation_time = None + self.custom_domain = None + self.secondary_endpoints = None + self.encryption = None + self.access_tier = None + self.azure_files_identity_based_authentication = azure_files_identity_based_authentication + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = None + self.is_hns_enabled = is_hns_enabled + self.geo_replication_stats = None + self.failover_in_progress = None + self.large_file_shares_state = large_file_shares_state + self.private_endpoint_connections = None + self.routing_preference = routing_preference + self.blob_restore_status = None + + +class StorageAccountCheckNameAvailabilityParameters(Model): + """The parameters used to check the availability of the storage account name. + + 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 name: Required. The storage account name. + :type name: str + :ivar type: Required. The type of resource, + Microsoft.Storage/storageAccounts. Default value: + "Microsoft.Storage/storageAccounts" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.Storage/storageAccounts" + + def __init__(self, *, name: str, **kwargs) -> None: + super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name + + +class StorageAccountCreateParameters(Model): + """The parameters used when creating a storage account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU name. + :type sku: ~azure.mgmt.storage.v2019_06_01.models.Sku + :param kind: Required. Required. Indicates the type of storage account. + Possible values include: 'Storage', 'StorageV2', 'BlobStorage', + 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2019_06_01.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update, the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used for viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key with a length no greater than 128 + characters and a value with a length no greater than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2019_06_01.models.Identity + :param custom_domain: User domain assigned to the storage account. Name is + the CNAME source. Only one custom domain is supported per storage account + at this time. To clear the existing custom domain, use an empty string for + the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2019_06_01.models.CustomDomain + :param encryption: Not applicable. Azure Storage encryption is enabled for + all storage accounts and cannot be disabled. + :type encryption: ~azure.mgmt.storage.v2019_06_01.models.Encryption + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2019_06_01.models.NetworkRuleSet + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2019_06_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2019_06_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. The default value is true since API version + 2019-04-01. + :type enable_https_traffic_only: bool + :param is_hns_enabled: Account HierarchicalNamespace enabled if sets to + true. + :type is_hns_enabled: bool + :param large_file_shares_state: Allow large file shares if sets to + Enabled. It cannot be disabled once it is enabled. Possible values + include: 'Disabled', 'Enabled' + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2019_06_01.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing + choice opted by the user for data transfer + :type routing_preference: + ~azure.mgmt.storage.v2019_06_01.models.RoutingPreference + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'is_hns_enabled': {'key': 'properties.isHnsEnabled', 'type': 'bool'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + } + + def __init__(self, *, sku, kind, location: str, tags=None, identity=None, custom_domain=None, encryption=None, network_rule_set=None, access_tier=None, azure_files_identity_based_authentication=None, enable_https_traffic_only: bool=None, is_hns_enabled: bool=None, large_file_shares_state=None, routing_preference=None, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.network_rule_set = network_rule_set + self.access_tier = access_tier + self.azure_files_identity_based_authentication = azure_files_identity_based_authentication + self.enable_https_traffic_only = enable_https_traffic_only + self.is_hns_enabled = is_hns_enabled + self.large_file_shares_state = large_file_shares_state + self.routing_preference = routing_preference + + +class StorageAccountInternetEndpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, file, web + or dfs object via a internet routing endpoint. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountInternetEndpoints, self).__init__(**kwargs) + self.blob = None + self.file = None + self.web = None + self.dfs = None + + +class StorageAccountKey(Model): + """An access key for the storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key_name: Name of the key. + :vartype key_name: str + :ivar value: Base 64-encoded value of the key. + :vartype value: str + :ivar permissions: Permissions for the key -- read-only or full + permissions. Possible values include: 'Read', 'Full' + :vartype permissions: str or + ~azure.mgmt.storage.v2019_06_01.models.KeyPermission + """ + + _validation = { + 'key_name': {'readonly': True}, + 'value': {'readonly': True}, + 'permissions': {'readonly': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'KeyPermission'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountKey, self).__init__(**kwargs) + self.key_name = None + self.value = None + self.permissions = None + + +class StorageAccountListKeysResult(Model): + """The response from the ListKeys operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar keys: Gets the list of storage account keys and their properties for + the specified storage account. + :vartype keys: + list[~azure.mgmt.storage.v2019_06_01.models.StorageAccountKey] + """ + + _validation = { + 'keys': {'readonly': True}, + } + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[StorageAccountKey]'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountListKeysResult, self).__init__(**kwargs) + self.keys = None + + +class StorageAccountMicrosoftEndpoints(Model): + """The URIs that are used to perform a retrieval of a public blob, queue, + table, web or dfs object via a microsoft routing endpoint. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar blob: Gets the blob endpoint. + :vartype blob: str + :ivar queue: Gets the queue endpoint. + :vartype queue: str + :ivar table: Gets the table endpoint. + :vartype table: str + :ivar file: Gets the file endpoint. + :vartype file: str + :ivar web: Gets the web endpoint. + :vartype web: str + :ivar dfs: Gets the dfs endpoint. + :vartype dfs: str + """ + + _validation = { + 'blob': {'readonly': True}, + 'queue': {'readonly': True}, + 'table': {'readonly': True}, + 'file': {'readonly': True}, + 'web': {'readonly': True}, + 'dfs': {'readonly': True}, + } + + _attribute_map = { + 'blob': {'key': 'blob', 'type': 'str'}, + 'queue': {'key': 'queue', 'type': 'str'}, + 'table': {'key': 'table', 'type': 'str'}, + 'file': {'key': 'file', 'type': 'str'}, + 'web': {'key': 'web', 'type': 'str'}, + 'dfs': {'key': 'dfs', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountMicrosoftEndpoints, self).__init__(**kwargs) + self.blob = None + self.queue = None + self.table = None + self.file = None + self.web = None + self.dfs = None + + +class StorageAccountRegenerateKeyParameters(Model): + """The parameters used to regenerate the storage account key. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The name of storage keys that want to be + regenerated, possible values are key1, key2, kerb1, kerb2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name + + +class StorageAccountUpdateParameters(Model): + """The parameters that can be provided when updating the storage account + properties. + + :param sku: Gets or sets the SKU name. Note that the SKU name cannot be + updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can accounts of + those SKU names be updated to any other value. + :type sku: ~azure.mgmt.storage.v2019_06_01.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater in length than 128 + characters and a value no greater in length than 256 characters. + :type tags: dict[str, str] + :param identity: The identity of the resource. + :type identity: ~azure.mgmt.storage.v2019_06_01.models.Identity + :param custom_domain: Custom domain assigned to the storage account by the + user. Name is the CNAME source. Only one custom domain is supported per + storage account at this time. To clear the existing custom domain, use an + empty string for the custom domain name property. + :type custom_domain: ~azure.mgmt.storage.v2019_06_01.models.CustomDomain + :param encryption: Provides the encryption settings on the account. The + default setting is unencrypted. + :type encryption: ~azure.mgmt.storage.v2019_06_01.models.Encryption + :param access_tier: Required for storage accounts where kind = + BlobStorage. The access tier used for billing. Possible values include: + 'Hot', 'Cool' + :type access_tier: str or + ~azure.mgmt.storage.v2019_06_01.models.AccessTier + :param azure_files_identity_based_authentication: Provides the identity + based authentication settings for Azure Files. + :type azure_files_identity_based_authentication: + ~azure.mgmt.storage.v2019_06_01.models.AzureFilesIdentityBasedAuthentication + :param enable_https_traffic_only: Allows https traffic only to storage + service if sets to true. + :type enable_https_traffic_only: bool + :param network_rule_set: Network rule set + :type network_rule_set: + ~azure.mgmt.storage.v2019_06_01.models.NetworkRuleSet + :param large_file_shares_state: Allow large file shares if sets to + Enabled. It cannot be disabled once it is enabled. Possible values + include: 'Disabled', 'Enabled' + :type large_file_shares_state: str or + ~azure.mgmt.storage.v2019_06_01.models.LargeFileSharesState + :param routing_preference: Maintains information about the network routing + choice opted by the user for data transfer + :type routing_preference: + ~azure.mgmt.storage.v2019_06_01.models.RoutingPreference + :param kind: Optional. Indicates the type of storage account. Currently + only StorageV2 value supported by server. Possible values include: + 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' + :type kind: str or ~azure.mgmt.storage.v2019_06_01.models.Kind + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'}, + 'encryption': {'key': 'properties.encryption', 'type': 'Encryption'}, + 'access_tier': {'key': 'properties.accessTier', 'type': 'AccessTier'}, + 'azure_files_identity_based_authentication': {'key': 'properties.azureFilesIdentityBasedAuthentication', 'type': 'AzureFilesIdentityBasedAuthentication'}, + 'enable_https_traffic_only': {'key': 'properties.supportsHttpsTrafficOnly', 'type': 'bool'}, + 'network_rule_set': {'key': 'properties.networkAcls', 'type': 'NetworkRuleSet'}, + 'large_file_shares_state': {'key': 'properties.largeFileSharesState', 'type': 'str'}, + 'routing_preference': {'key': 'properties.routingPreference', 'type': 'RoutingPreference'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, sku=None, tags=None, identity=None, custom_domain=None, encryption=None, access_tier=None, azure_files_identity_based_authentication=None, enable_https_traffic_only: bool=None, network_rule_set=None, large_file_shares_state=None, routing_preference=None, kind=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + self.identity = identity + self.custom_domain = custom_domain + self.encryption = encryption + self.access_tier = access_tier + self.azure_files_identity_based_authentication = azure_files_identity_based_authentication + self.enable_https_traffic_only = enable_https_traffic_only + self.network_rule_set = network_rule_set + self.large_file_shares_state = large_file_shares_state + self.routing_preference = routing_preference + self.kind = kind + + +class TagProperty(Model): + """A tag of the LegalHold of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar tag: The tag value. + :vartype tag: str + :ivar timestamp: Returns the date and time the tag was added. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who added the + tag. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who added the tag. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who added the tag. + :vartype upn: str + """ + + _validation = { + 'tag': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'tag': {'key': 'tag', 'type': 'str'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TagProperty, self).__init__(**kwargs) + self.tag = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class UpdateHistoryProperty(Model): + """An update history of the ImmutabilityPolicy of a blob container. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar update: The ImmutabilityPolicy update type of a blob container, + possible values include: put, lock and extend. Possible values include: + 'put', 'lock', 'extend' + :vartype update: str or + ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyUpdateType + :ivar immutability_period_since_creation_in_days: The immutability period + for the blobs in the container since the policy creation, in days. + :vartype immutability_period_since_creation_in_days: int + :ivar timestamp: Returns the date and time the ImmutabilityPolicy was + updated. + :vartype timestamp: datetime + :ivar object_identifier: Returns the Object ID of the user who updated the + ImmutabilityPolicy. + :vartype object_identifier: str + :ivar tenant_id: Returns the Tenant ID that issued the token for the user + who updated the ImmutabilityPolicy. + :vartype tenant_id: str + :ivar upn: Returns the User Principal Name of the user who updated the + ImmutabilityPolicy. + :vartype upn: str + """ + + _validation = { + 'update': {'readonly': True}, + 'immutability_period_since_creation_in_days': {'readonly': True}, + 'timestamp': {'readonly': True}, + 'object_identifier': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'upn': {'readonly': True}, + } + + _attribute_map = { + 'update': {'key': 'update', 'type': 'str'}, + 'immutability_period_since_creation_in_days': {'key': 'immutabilityPeriodSinceCreationInDays', 'type': 'int'}, + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + 'object_identifier': {'key': 'objectIdentifier', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'upn': {'key': 'upn', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UpdateHistoryProperty, self).__init__(**kwargs) + self.update = None + self.immutability_period_since_creation_in_days = None + self.timestamp = None + self.object_identifier = None + self.tenant_id = None + self.upn = None + + +class Usage(Model): + """Describes Storage Resource Usage. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar unit: Gets the unit of measurement. Possible values include: + 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + 'BytesPerSecond' + :vartype unit: str or ~azure.mgmt.storage.v2019_06_01.models.UsageUnit + :ivar current_value: Gets the current count of the allocated resources in + the subscription. + :vartype current_value: int + :ivar limit: Gets the maximum count of the resources that can be allocated + in the subscription. + :vartype limit: int + :ivar name: Gets the name of the type of usage. + :vartype name: ~azure.mgmt.storage.v2019_06_01.models.UsageName + """ + + _validation = { + 'unit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'UsageUnit'}, + 'current_value': {'key': 'currentValue', 'type': 'int'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'UsageName'}, + } + + def __init__(self, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = None + self.current_value = None + self.limit = None + self.name = None + + +class UsageName(Model): + """The usage names that can be used; currently limited to StorageAccount. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets a string describing the resource name. + :vartype value: str + :ivar localized_value: Gets a localized string describing the resource + name. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UsageName, self).__init__(**kwargs) + self.value = None + self.localized_value = None + + +class VirtualNetworkRule(Model): + """Virtual Network rule. + + All required parameters must be populated in order to send to Azure. + + :param virtual_network_resource_id: Required. Resource ID of a subnet, for + example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + :type virtual_network_resource_id: str + :param action: The action of virtual network rule. Possible values + include: 'Allow'. Default value: "Allow" . + :type action: str or ~azure.mgmt.storage.v2019_06_01.models.Action + :param state: Gets the state of virtual network rule. Possible values + include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + 'networkSourceDeleted' + :type state: str or ~azure.mgmt.storage.v2019_06_01.models.State + """ + + _validation = { + 'virtual_network_resource_id': {'required': True}, + } + + _attribute_map = { + 'virtual_network_resource_id': {'key': 'id', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'Action'}, + 'state': {'key': 'state', 'type': 'State'}, + } + + def __init__(self, *, virtual_network_resource_id: str, action="Allow", state=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.virtual_network_resource_id = virtual_network_resource_id + self.action = action + self.state = state diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/models/_paged_models.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/models/_paged_models.py new file mode 100644 index 00000000000..d82ca88ae5a --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/models/_paged_models.py @@ -0,0 +1,131 @@ +# 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) +class SkuInformationPaged(Paged): + """ + A paging container for iterating over a list of :class:`SkuInformation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SkuInformation]'} + } + + def __init__(self, *args, **kwargs): + + super(SkuInformationPaged, self).__init__(*args, **kwargs) +class StorageAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageAccountPaged, self).__init__(*args, **kwargs) +class UsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`Usage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Usage]'} + } + + def __init__(self, *args, **kwargs): + + super(UsagePaged, self).__init__(*args, **kwargs) +class ObjectReplicationPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`ObjectReplicationPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ObjectReplicationPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(ObjectReplicationPolicyPaged, self).__init__(*args, **kwargs) +class EncryptionScopePaged(Paged): + """ + A paging container for iterating over a list of :class:`EncryptionScope ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EncryptionScope]'} + } + + def __init__(self, *args, **kwargs): + + super(EncryptionScopePaged, self).__init__(*args, **kwargs) +class BlobServicePropertiesPaged(Paged): + """ + A paging container for iterating over a list of :class:`BlobServiceProperties ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BlobServiceProperties]'} + } + + def __init__(self, *args, **kwargs): + + super(BlobServicePropertiesPaged, self).__init__(*args, **kwargs) +class ListContainerItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`ListContainerItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ListContainerItem]'} + } + + def __init__(self, *args, **kwargs): + + super(ListContainerItemPaged, self).__init__(*args, **kwargs) +class FileShareItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`FileShareItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[FileShareItem]'} + } + + def __init__(self, *args, **kwargs): + + super(FileShareItemPaged, self).__init__(*args, **kwargs) diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/models/_storage_management_client_enums.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/models/_storage_management_client_enums.py new file mode 100644 index 00000000000..19601af72a5 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/models/_storage_management_client_enums.py @@ -0,0 +1,279 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ReasonCode(str, Enum): + + quota_id = "QuotaId" + not_available_for_subscription = "NotAvailableForSubscription" + + +class SkuName(str, Enum): + + standard_lrs = "Standard_LRS" + standard_grs = "Standard_GRS" + standard_ragrs = "Standard_RAGRS" + standard_zrs = "Standard_ZRS" + premium_lrs = "Premium_LRS" + premium_zrs = "Premium_ZRS" + standard_gzrs = "Standard_GZRS" + standard_ragzrs = "Standard_RAGZRS" + + +class SkuTier(str, Enum): + + standard = "Standard" + premium = "Premium" + + +class Kind(str, Enum): + + storage = "Storage" + storage_v2 = "StorageV2" + blob_storage = "BlobStorage" + file_storage = "FileStorage" + block_blob_storage = "BlockBlobStorage" + + +class Reason(str, Enum): + + account_name_invalid = "AccountNameInvalid" + already_exists = "AlreadyExists" + + +class KeyType(str, Enum): + + service = "Service" + account = "Account" + + +class KeySource(str, Enum): + + microsoft_storage = "Microsoft.Storage" + microsoft_keyvault = "Microsoft.Keyvault" + + +class Action(str, Enum): + + allow = "Allow" + + +class State(str, Enum): + + provisioning = "provisioning" + deprovisioning = "deprovisioning" + succeeded = "succeeded" + failed = "failed" + network_source_deleted = "networkSourceDeleted" + + +class Bypass(str, Enum): + + none = "None" + logging = "Logging" + metrics = "Metrics" + azure_services = "AzureServices" + + +class DefaultAction(str, Enum): + + allow = "Allow" + deny = "Deny" + + +class DirectoryServiceOptions(str, Enum): + + none = "None" + aadds = "AADDS" + ad = "AD" + + +class AccessTier(str, Enum): + + hot = "Hot" + cool = "Cool" + + +class LargeFileSharesState(str, Enum): + + disabled = "Disabled" + enabled = "Enabled" + + +class RoutingChoice(str, Enum): + + microsoft_routing = "MicrosoftRouting" + internet_routing = "InternetRouting" + + +class GeoReplicationStatus(str, Enum): + + live = "Live" + bootstrap = "Bootstrap" + unavailable = "Unavailable" + + +class BlobRestoreProgressStatus(str, Enum): + + in_progress = "InProgress" + complete = "Complete" + failed = "Failed" + + +class ProvisioningState(str, Enum): + + creating = "Creating" + resolving_dns = "ResolvingDNS" + succeeded = "Succeeded" + + +class AccountStatus(str, Enum): + + available = "available" + unavailable = "unavailable" + + +class PrivateEndpointServiceConnectionStatus(str, Enum): + + pending = "Pending" + approved = "Approved" + rejected = "Rejected" + + +class PrivateEndpointConnectionProvisioningState(str, Enum): + + succeeded = "Succeeded" + creating = "Creating" + deleting = "Deleting" + failed = "Failed" + + +class KeyPermission(str, Enum): + + read = "Read" + full = "Full" + + +class UsageUnit(str, Enum): + + count = "Count" + bytes = "Bytes" + seconds = "Seconds" + percent = "Percent" + counts_per_second = "CountsPerSecond" + bytes_per_second = "BytesPerSecond" + + +class Services(str, Enum): + + b = "b" + q = "q" + t = "t" + f = "f" + + +class SignedResourceTypes(str, Enum): + + s = "s" + c = "c" + o = "o" + + +class Permissions(str, Enum): + + r = "r" + d = "d" + w = "w" + l = "l" + a = "a" + c = "c" + u = "u" + p = "p" + + +class HttpProtocol(str, Enum): + + httpshttp = "https,http" + https = "https" + + +class SignedResource(str, Enum): + + b = "b" + c = "c" + f = "f" + s = "s" + + +class EncryptionScopeSource(str, Enum): + + microsoft_storage = "Microsoft.Storage" + microsoft_key_vault = "Microsoft.KeyVault" + + +class EncryptionScopeState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class PublicAccess(str, Enum): + + container = "Container" + blob = "Blob" + none = "None" + + +class LeaseStatus(str, Enum): + + locked = "Locked" + unlocked = "Unlocked" + + +class LeaseState(str, Enum): + + available = "Available" + leased = "Leased" + expired = "Expired" + breaking = "Breaking" + broken = "Broken" + + +class LeaseDuration(str, Enum): + + infinite = "Infinite" + fixed = "Fixed" + + +class ImmutabilityPolicyState(str, Enum): + + locked = "Locked" + unlocked = "Unlocked" + + +class ImmutabilityPolicyUpdateType(str, Enum): + + put = "put" + lock = "lock" + extend = "extend" + + +class StorageAccountExpand(str, Enum): + + geo_replication_stats = "geoReplicationStats" + blob_restore_status = "blobRestoreStatus" + + +class ListKeyExpand(str, Enum): + + kerb = "kerb" diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/__init__.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/__init__.py new file mode 100644 index 00000000000..e0f83184844 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/__init__.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._skus_operations import SkusOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._usages_operations import UsagesOperations +from ._management_policies_operations import ManagementPoliciesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._object_replication_policies_operations import ObjectReplicationPoliciesOperations +from ._encryption_scopes_operations import EncryptionScopesOperations +from ._blob_services_operations import BlobServicesOperations +from ._blob_containers_operations import BlobContainersOperations +from ._file_services_operations import FileServicesOperations +from ._file_shares_operations import FileSharesOperations + +__all__ = [ + 'Operations', + 'SkusOperations', + 'StorageAccountsOperations', + 'UsagesOperations', + 'ManagementPoliciesOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', + 'ObjectReplicationPoliciesOperations', + 'EncryptionScopesOperations', + 'BlobServicesOperations', + 'BlobContainersOperations', + 'FileServicesOperations', + 'FileSharesOperations', +] diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_blob_containers_operations.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_blob_containers_operations.py new file mode 100644 index 00000000000..f074275eef8 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_blob_containers_operations.py @@ -0,0 +1,1155 @@ +# 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 BlobContainersOperations(object): + """BlobContainersOperations 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: The API version to use for this operation. Constant value: "2019-06-01". + :ivar immutability_policy_name: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + self.immutability_policy_name = "default" + + self.config = config + + def list( + self, resource_group_name, account_name, maxpagesize=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists all containers and does not support a prefix like data plane. + Also SRP today does not return continuation token. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param maxpagesize: Optional. Specified maximum number of containers + that can be included in the list. + :type maxpagesize: str + :param filter: Optional. When specified, only container names starting + with the filter will be listed. + :type filter: 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: An iterator like instance of ListContainerItem + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.ListContainerItemPaged[~azure.mgmt.storage.v2019_06_01.models.ListContainerItem] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, '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.ListContainerItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'} + + def create( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Creates a new container under the specified account as described by + request body. The container resource includes metadata and properties + for that container. It does not include a list of the blobs contained + by the container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2019_06_01.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, 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: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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(blob_container, 'BlobContainer') + + # 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, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BlobContainer', response) + if response.status_code == 201: + deserialized = self._deserialize('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def update( + self, resource_group_name, account_name, container_name, public_access=None, metadata=None, custom_headers=None, raw=False, **operation_config): + """Updates container properties as specified in request body. Properties + not mentioned in the request will be unchanged. Update fails if the + specified container doesn't already exist. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param public_access: Specifies whether data in the container may be + accessed publicly and the level of access. Possible values include: + 'Container', 'Blob', 'None' + :type public_access: str or + ~azure.mgmt.storage.v2019_06_01.models.PublicAccess + :param metadata: A name-value pair to associate with the container as + metadata. + :type metadata: dict[str, 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: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + blob_container = models.BlobContainer(public_access=public_access, metadata=metadata) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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(blob_container, 'BlobContainer') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def get( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Gets properties of a specified container. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_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: BlobContainer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobContainer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BlobContainer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def delete( + self, resource_group_name, account_name, container_name, custom_headers=None, raw=False, **operation_config): + """Deletes specified container under its account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_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:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'} + + def set_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Sets legal hold tags. Setting the same tag results in an idempotent + operation. SetLegalHold follows an append pattern and does not clear + out the existing tags that are not specified in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[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: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.set_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'} + + def clear_legal_hold( + self, resource_group_name, account_name, container_name, tags, custom_headers=None, raw=False, **operation_config): + """Clears legal hold tags. Clearing the same or non-existent tag results + in an idempotent operation. ClearLegalHold clears out only the + specified tags in the request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param tags: Each tag should be 3 to 23 alphanumeric characters and is + normalized to lower case at SRP. + :type tags: list[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: LegalHold or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.LegalHold or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + legal_hold = models.LegalHold(tags=tags) + + # Construct URL + url = self.clear_legal_hold.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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(legal_hold, 'LegalHold') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LegalHold', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + clear_legal_hold.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'} + + def create_or_update_immutability_policy( + self, resource_group_name, account_name, container_name, if_match=None, immutability_period_since_creation_in_days=None, allow_protected_append_writes=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates an unlocked immutability policy. ETag in If-Match is + honored if given but not required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :param allow_protected_append_writes: This property can only be + changed for unlocked time-based retention policies. When enabled, new + blocks can be written to an append blob while maintaining immutability + protection and compliance. Only new blocks can be added and any + existing blocks cannot be modified or deleted. This property cannot be + changed with ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool + :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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None or allow_protected_append_writes is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days, allow_protected_append_writes=allow_protected_append_writes) + + # Construct URL + url = self.create_or_update_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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 if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + create_or_update_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def get_immutability_policy( + self, resource_group_name, account_name, container_name, if_match=None, custom_headers=None, raw=False, **operation_config): + """Gets the existing immutability policy along with the corresponding ETag + in response headers and body. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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 if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def delete_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Aborts an unlocked immutability policy. The response of delete has + immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is + required for this operation. Deleting a locked immutability policy is + not allowed, only way is to delete the container after deleting all + blobs inside the container. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'immutabilityPolicyName': self._serialize.url("self.immutability_policy_name", self.immutability_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + delete_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'} + + def lock_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, custom_headers=None, raw=False, **operation_config): + """Sets the ImmutabilityPolicy to Locked state. The only action allowed on + a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is + required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: 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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.lock_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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.post(url, query_parameters, header_parameters) + 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + lock_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'} + + def extend_immutability_policy( + self, resource_group_name, account_name, container_name, if_match, immutability_period_since_creation_in_days=None, allow_protected_append_writes=None, custom_headers=None, raw=False, **operation_config): + """Extends the immutabilityPeriodSinceCreationInDays of a locked + immutabilityPolicy. The only action allowed on a Locked policy will be + this action. ETag in If-Match is required for this operation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param if_match: The entity state (ETag) version of the immutability + policy to update. A value of "*" can be used to apply the operation + only if the immutability policy already exists. If omitted, this + operation will always be applied. + :type if_match: str + :param immutability_period_since_creation_in_days: The immutability + period for the blobs in the container since the policy creation, in + days. + :type immutability_period_since_creation_in_days: int + :param allow_protected_append_writes: This property can only be + changed for unlocked time-based retention policies. When enabled, new + blocks can be written to an append blob while maintaining immutability + protection and compliance. Only new blocks can be added and any + existing blocks cannot be modified or deleted. This property cannot be + changed with ExtendImmutabilityPolicy API + :type allow_protected_append_writes: bool + :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: ImmutabilityPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = None + if immutability_period_since_creation_in_days is not None or allow_protected_append_writes is not None: + parameters = models.ImmutabilityPolicy(immutability_period_since_creation_in_days=immutability_period_since_creation_in_days, allow_protected_append_writes=allow_protected_append_writes) + + # Construct URL + url = self.extend_immutability_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'ImmutabilityPolicy') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ImmutabilityPolicy', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + extend_immutability_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'} + + def lease( + self, resource_group_name, account_name, container_name, parameters=None, custom_headers=None, raw=False, **operation_config): + """The Lease Container operation establishes and manages a lock on a + container for delete operations. The lock duration can be 15 to 60 + seconds, or can be infinite. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param container_name: The name of the blob container within the + specified storage account. Blob container names must be between 3 and + 63 characters in length and use numbers, lower-case letters and dash + (-) only. Every dash (-) character must be immediately preceded and + followed by a letter or number. + :type container_name: str + :param parameters: Lease Container request body. + :type parameters: + ~azure.mgmt.storage.v2019_06_01.models.LeaseContainerRequest + :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: LeaseContainerResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.LeaseContainerResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.lease.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'containerName': self._serialize.url("container_name", container_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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 + if parameters is not None: + body_content = self._serialize.body(parameters, 'LeaseContainerRequest') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LeaseContainerResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + lease.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'} diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_blob_services_operations.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_blob_services_operations.py new file mode 100644 index 00000000000..2e3af3f0af3 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_blob_services_operations.py @@ -0,0 +1,261 @@ +# 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 BlobServicesOperations(object): + """BlobServicesOperations 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: The API version to use for this operation. Constant value: "2019-06-01". + :ivar blob_services_name: The name of the blob Service within the specified storage account. Blob Service Name must be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + self.blob_services_name = "default" + + self.config = config + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """List blob services of storage account. It returns a collection of one + object named default. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: An iterator like instance of BlobServiceProperties + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.BlobServicePropertiesPaged[~azure.mgmt.storage.v2019_06_01.models.BlobServiceProperties] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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.BlobServicePropertiesPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices'} + + def set_service_properties( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """Sets the properties of a storage account’s Blob service, including + properties for Storage Analytics and CORS (Cross-Origin Resource + Sharing) rules. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The properties of a storage account’s Blob service, + including properties for Storage Analytics and CORS (Cross-Origin + Resource Sharing) rules. + :type parameters: + ~azure.mgmt.storage.v2019_06_01.models.BlobServiceProperties + :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: BlobServiceProperties or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.set_service_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_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', min_length=1) + + # 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, 'BlobServiceProperties') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BlobServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} + + def get_service_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of a storage account’s Blob service, including + properties for Storage Analytics and CORS (Cross-Origin Resource + Sharing) rules. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: BlobServiceProperties or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.BlobServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_service_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'BlobServicesName': self._serialize.url("self.blob_services_name", self.blob_services_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BlobServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'} diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_encryption_scopes_operations.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_encryption_scopes_operations.py new file mode 100644 index 00000000000..e469ccf7968 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_encryption_scopes_operations.py @@ -0,0 +1,348 @@ +# 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 EncryptionScopesOperations(object): + """EncryptionScopesOperations 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: The API version to use for this operation. Constant value: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def put( + self, resource_group_name, account_name, encryption_scope_name, encryption_scope, custom_headers=None, raw=False, **operation_config): + """Synchronously creates or updates an encryption scope under the + specified storage account. If an encryption scope is already created + and a subsequent request is issued with different properties, the + encryption scope properties will be updated per the specified request. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within + the specified storage account. Encryption scope names must be between + 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded + and followed by a letter or number. + :type encryption_scope_name: str + :param encryption_scope: Encryption scope properties to be used for + the create or update. + :type encryption_scope: + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope + :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: EncryptionScope or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.put.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3) + } + 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', min_length=1) + + # 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(encryption_scope, 'EncryptionScope') + + # 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, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EncryptionScope', response) + if response.status_code == 201: + deserialized = self._deserialize('EncryptionScope', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} + + def patch( + self, resource_group_name, account_name, encryption_scope_name, encryption_scope, custom_headers=None, raw=False, **operation_config): + """Update encryption scope properties as specified in the request body. + Update fails if the specified encryption scope does not already exist. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within + the specified storage account. Encryption scope names must be between + 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded + and followed by a letter or number. + :type encryption_scope_name: str + :param encryption_scope: Encryption scope properties to be used for + the update. + :type encryption_scope: + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope + :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: EncryptionScope or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.patch.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3) + } + 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', min_length=1) + + # 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(encryption_scope, 'EncryptionScope') + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EncryptionScope', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} + + def get( + self, resource_group_name, account_name, encryption_scope_name, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified encryption scope. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param encryption_scope_name: The name of the encryption scope within + the specified storage account. Encryption scope names must be between + 3 and 63 characters in length and use numbers, lower-case letters and + dash (-) only. Every dash (-) character must be immediately preceded + and followed by a letter or number. + :type encryption_scope_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: EncryptionScope or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.EncryptionScope or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'encryptionScopeName': self._serialize.url("encryption_scope_name", encryption_scope_name, 'str', max_length=63, min_length=3) + } + 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', min_length=1) + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EncryptionScope', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'} + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Lists all the encryption scopes available under the specified storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: An iterator like instance of EncryptionScope + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.EncryptionScopePaged[~azure.mgmt.storage.v2019_06_01.models.EncryptionScope] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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.EncryptionScopePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes'} diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_file_services_operations.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_file_services_operations.py new file mode 100644 index 00000000000..693f633a0fa --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_file_services_operations.py @@ -0,0 +1,253 @@ +# 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 FileServicesOperations(object): + """FileServicesOperations 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: The API version to use for this operation. Constant value: "2019-06-01". + :ivar file_services_name: The name of the file Service within the specified storage account. File Service Name must be "default". Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + self.file_services_name = "default" + + self.config = config + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """List all file services in storage accounts. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: FileServiceItems or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileServiceItems or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FileServiceItems', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices'} + + def set_service_properties( + self, resource_group_name, account_name, cors=None, share_delete_retention_policy=None, custom_headers=None, raw=False, **operation_config): + """Sets the properties of file services in storage accounts, including + CORS (Cross-Origin Resource Sharing) rules. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param cors: Specifies CORS rules for the File service. You can + include up to five CorsRule elements in the request. If no CorsRule + elements are included in the request body, all CORS rules will be + deleted, and CORS will be disabled for the File service. + :type cors: ~azure.mgmt.storage.v2019_06_01.models.CorsRules + :param share_delete_retention_policy: The file service properties for + share soft delete. + :type share_delete_retention_policy: + ~azure.mgmt.storage.v2019_06_01.models.DeleteRetentionPolicy + :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: FileServiceProperties or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.FileServiceProperties(cors=cors, share_delete_retention_policy=share_delete_retention_policy) + + # Construct URL + url = self.set_service_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'FileServicesName': self._serialize.url("self.file_services_name", self.file_services_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', min_length=1) + + # 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, 'FileServiceProperties') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FileServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'} + + def get_service_properties( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the properties of file services in storage accounts, including + CORS (Cross-Origin Resource Sharing) rules. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: FileServiceProperties or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileServiceProperties + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_service_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'FileServicesName': self._serialize.url("self.file_services_name", self.file_services_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FileServiceProperties', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_service_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'} diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_file_shares_operations.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_file_shares_operations.py new file mode 100644 index 00000000000..ca0c37d1861 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_file_shares_operations.py @@ -0,0 +1,434 @@ +# 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 FileSharesOperations(object): + """FileSharesOperations 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: The API version to use for this operation. Constant value: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list( + self, resource_group_name, account_name, maxpagesize=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists all shares. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param maxpagesize: Optional. Specified maximum number of shares that + can be included in the list. + :type maxpagesize: str + :param filter: Optional. When specified, only share names starting + with the filter will be listed. + :type filter: 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: An iterator like instance of FileShareItem + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.FileShareItemPaged[~azure.mgmt.storage.v2019_06_01.models.FileShareItem] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if maxpagesize is not None: + query_parameters['$maxpagesize'] = self._serialize.query("maxpagesize", maxpagesize, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, '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.FileShareItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares'} + + def create( + self, resource_group_name, account_name, share_name, metadata=None, share_quota=None, custom_headers=None, raw=False, **operation_config): + """Creates a new share under the specified account as described by request + body. The share resource includes metadata and properties for that + share. It does not include a list of the files contained by the share. + . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified + storage account. File share names must be between 3 and 63 characters + in length and use numbers, lower-case letters and dash (-) only. Every + dash (-) character must be immediately preceded and followed by a + letter or number. + :type share_name: str + :param metadata: A name-value pair to associate with the share as + metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must + be greater than 0, and less than or equal to 5TB (5120). For Large + File Shares, the maximum size is 102400. + :type share_quota: int + :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: FileShare or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + file_share = models.FileShare(metadata=metadata, share_quota=share_quota) + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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(file_share, 'FileShare') + + # 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, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FileShare', response) + if response.status_code == 201: + deserialized = self._deserialize('FileShare', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} + + def update( + self, resource_group_name, account_name, share_name, metadata=None, share_quota=None, custom_headers=None, raw=False, **operation_config): + """Updates share properties as specified in request body. Properties not + mentioned in the request will not be changed. Update fails if the + specified share does not already exist. . + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified + storage account. File share names must be between 3 and 63 characters + in length and use numbers, lower-case letters and dash (-) only. Every + dash (-) character must be immediately preceded and followed by a + letter or number. + :type share_name: str + :param metadata: A name-value pair to associate with the share as + metadata. + :type metadata: dict[str, str] + :param share_quota: The maximum size of the share, in gigabytes. Must + be greater than 0, and less than or equal to 5TB (5120). For Large + File Shares, the maximum size is 102400. + :type share_quota: int + :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: FileShare or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + file_share = models.FileShare(metadata=metadata, share_quota=share_quota) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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(file_share, 'FileShare') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FileShare', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} + + def get( + self, resource_group_name, account_name, share_name, custom_headers=None, raw=False, **operation_config): + """Gets properties of a specified share. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified + storage account. File share names must be between 3 and 63 characters + in length and use numbers, lower-case letters and dash (-) only. Every + dash (-) character must be immediately preceded and followed by a + letter or number. + :type share_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: FileShare or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.FileShare or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FileShare', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} + + def delete( + self, resource_group_name, account_name, share_name, custom_headers=None, raw=False, **operation_config): + """Deletes specified share under its account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param share_name: The name of the file share within the specified + storage account. File share names must be between 3 and 63 characters + in length and use numbers, lower-case letters and dash (-) only. Every + dash (-) character must be immediately preceded and followed by a + letter or number. + :type share_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:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'shareName': self._serialize.url("share_name", share_name, 'str', max_length=63, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'} diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_management_policies_operations.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_management_policies_operations.py new file mode 100644 index 00000000000..e6e4b398a17 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_management_policies_operations.py @@ -0,0 +1,242 @@ +# 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 ManagementPoliciesOperations(object): + """ManagementPoliciesOperations 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: The API version to use for this operation. Constant value: "2019-06-01". + :ivar management_policy_name: The name of the Storage Account Management Policy. It should always be 'default'. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + self.management_policy_name = "default" + + self.config = config + + def get( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the managementpolicy associated with the specified storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: ManagementPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_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', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ManagementPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} + + def create_or_update( + self, resource_group_name, account_name, policy, custom_headers=None, raw=False, **operation_config): + """Sets the managementpolicy to the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param policy: The Storage Account ManagementPolicy, in JSON format. + See more details in: + https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + :type policy: + ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicySchema + :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: ManagementPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.ManagementPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + properties = models.ManagementPolicy(policy=policy) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_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', min_length=1) + + # 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(properties, 'ManagementPolicy') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ManagementPolicy', 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.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes the managementpolicy associated with the specified storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'managementPolicyName': self._serialize.url("self.management_policy_name", self.management_policy_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', min_length=1) + + # 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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'} diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_object_replication_policies_operations.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_object_replication_policies_operations.py new file mode 100644 index 00000000000..84cff954bc1 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_object_replication_policies_operations.py @@ -0,0 +1,316 @@ +# 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 ObjectReplicationPoliciesOperations(object): + """ObjectReplicationPoliciesOperations 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: The API version to use for this operation. Constant value: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """List the object replication policies associated with the storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: An iterator like instance of ObjectReplicationPolicy + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicyPaged[~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ObjectReplicationPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies'} + + def get( + self, resource_group_name, account_name, object_replication_policy_id, custom_headers=None, raw=False, **operation_config): + """Get the object replication policy of the storage account by policy ID. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param object_replication_policy_id: The ID of object replication + policy or 'default' if the policy ID is unknown. + :type object_replication_policy_id: 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: ObjectReplicationPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_id, 'str', min_length=1) + } + 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', min_length=1) + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ObjectReplicationPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} + + def create_or_update( + self, resource_group_name, account_name, object_replication_policy_id, properties, custom_headers=None, raw=False, **operation_config): + """Create or update the object replication policy of the storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param object_replication_policy_id: The ID of object replication + policy or 'default' if the policy ID is unknown. + :type object_replication_policy_id: str + :param properties: The object replication policy set to a storage + account. A unique policy ID will be created if absent. + :type properties: + ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy + :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: ObjectReplicationPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicy + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_id, 'str', min_length=1) + } + 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', min_length=1) + + # 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(properties, 'ObjectReplicationPolicy') + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ObjectReplicationPolicy', 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.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} + + def delete( + self, resource_group_name, account_name, object_replication_policy_id, custom_headers=None, raw=False, **operation_config): + """Deletes the object replication policy associated with the specified + storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param object_replication_policy_id: The ID of object replication + policy or 'default' if the policy ID is unknown. + :type object_replication_policy_id: 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:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'objectReplicationPolicyId': self._serialize.url("object_replication_policy_id", object_replication_policy_id, 'str', min_length=1) + } + 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', min_length=1) + + # 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, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'} diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_operations.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_operations.py new file mode 100644 index 00000000000..758ea32d576 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/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: The API version to use for this operation. Constant value: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Storage 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.storage.v2019_06_01.models.OperationPaged[~azure.mgmt.storage.v2019_06_01.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', min_length=1) + + 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.Storage/operations'} diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_private_endpoint_connections_operations.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_private_endpoint_connections_operations.py new file mode 100644 index 00000000000..25ce6b2bf0b --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,244 @@ +# 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 PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations 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: The API version to use for this operation. Constant value: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def get( + self, resource_group_name, account_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified private endpoint connection associated with the + storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Storage Account + :type private_endpoint_connection_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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.PrivateEndpointConnection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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', min_length=1) + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def put( + self, resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers=None, raw=False, **operation_config): + """Update the state of specified private endpoint connection associated + with the storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Storage Account + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: + ~azure.mgmt.storage.v2019_06_01.models.PrivateEndpointConnection + :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: PrivateEndpointConnection or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.PrivateEndpointConnection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.put.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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', min_length=1) + + # 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(properties, 'PrivateEndpointConnection') + + # 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.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def delete( + self, resource_group_name, account_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Deletes the specified private endpoint connection associated with the + storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection associated with the Storage Account + :type private_endpoint_connection_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:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_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', min_length=1) + + # 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, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'} diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_private_link_resources_operations.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_private_link_resources_operations.py new file mode 100644 index 00000000000..1042ffd402e --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_private_link_resources_operations.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations 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: The API version to use for this operation. Constant value: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list_by_storage_account( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources that need to be created for a storage + account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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: PrivateLinkResourceListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.PrivateLinkResourceListResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_storage_account.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PrivateLinkResourceListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_storage_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources'} diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_skus_operations.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_skus_operations.py new file mode 100644 index 00000000000..abe72334abc --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_skus_operations.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SkusOperations(object): + """SkusOperations 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: The API version to use for this operation. Constant value: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the available SKUs supported by Microsoft.Storage for given + subscription. + + :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 SkuInformation + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.SkuInformationPaged[~azure.mgmt.storage.v2019_06_01.models.SkuInformation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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.SkuInformationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'} diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_storage_accounts_operations.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_storage_accounts_operations.py new file mode 100644 index 00000000000..ce9f19d296d --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_storage_accounts_operations.py @@ -0,0 +1,1109 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class StorageAccountsOperations(object): + """StorageAccountsOperations 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: The API version to use for this operation. Constant value: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks that the storage account name is valid and is not already in + use. + + :param name: The storage account name. + :type 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: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.CheckNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + account_name = models.StorageAccountCheckNameAvailabilityParameters(name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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(account_name, 'StorageAccountCheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'} + + + def _create_initial( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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, 'StorageAccountCreateParameters') + + # 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, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Asynchronously creates a new storage account with the specified + parameters. If an account is already created and a subsequent create + request is issued with different properties, the account properties + will be updated. If an account is already created and a subsequent + create or update request is issued with the exact same set of + properties, the request will succeed. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the created account. + :type parameters: + ~azure.mgmt.storage.v2019_06_01.models.StorageAccountCreateParameters + :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 StorageAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2019_06_01.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2019_06_01.models.StorageAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('StorageAccount', 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def delete( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Deletes a storage account in Microsoft Azure. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def get_properties( + self, resource_group_name, account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Returns the properties for the specified storage account including but + not limited to name, SKU name, location, and account status. The + ListKeys operation should be used to retrieve storage keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param expand: May be used to expand the properties within account's + properties. By default, data is not included when fetching properties. + Currently we only support geoReplicationStats and blobRestoreStatus. + Possible values include: 'geoReplicationStats', 'blobRestoreStatus' + :type expand: str or + ~azure.mgmt.storage.v2019_06_01.models.StorageAccountExpand + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_properties.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'StorageAccountExpand') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def update( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """The update operation can be used to update the SKU, encryption, access + tier, or tags for a storage account. It can also be used to map the + account to a custom domain. Only one custom domain is supported per + storage account; the replacement/change of custom domain is not + supported. In order to replace an old custom domain, the old value must + be cleared/unregistered before a new value can be set. The update of + multiple properties is supported. This call does not change the storage + keys for the account. If you want to change the storage account keys, + use the regenerate keys operation. The location and name of the storage + account cannot be changed after creation. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide for the updated account. + :type parameters: + ~azure.mgmt.storage.v2019_06_01.models.StorageAccountUpdateParameters + :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: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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, 'StorageAccountUpdateParameters') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the subscription. Note + that storage keys are not returned; use the ListKeys operation for + this. + + :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 StorageAccount + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.StorageAccountPaged[~azure.mgmt.storage.v2019_06_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts available under the given resource + group. Note that storage keys are not returned; use the ListKeys + operation for this. + + :param resource_group_name: The name of the resource group within the + user's subscription. 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: An iterator like instance of StorageAccount + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.StorageAccountPaged[~azure.mgmt.storage.v2019_06_01.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} + + def list_keys( + self, resource_group_name, account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists the access keys or Kerberos keys (if active directory enabled) + for the specified storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param expand: Specifies type of the key to be listed. Possible value + is kerb. Possible values include: 'kerb' + :type expand: str or + ~azure.mgmt.storage.v2019_06_01.models.ListKeyExpand + :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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'ListKeyExpand') + + # 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.post(url, query_parameters, header_parameters) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'} + + def regenerate_key( + self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerates one of the access keys or Kerberos keys for the specified + storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param key_name: The name of storage keys that want to be regenerated, + possible values are key1, key2, kerb1, kerb2. + :type key_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: StorageAccountListKeysResult or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.StorageAccountListKeysResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key1 = models.StorageAccountRegenerateKeyParameters(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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(regenerate_key1, 'StorageAccountRegenerateKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccountListKeysResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'} + + def list_account_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List SAS credentials of a storage account. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list SAS credentials + for the storage account. + :type parameters: + ~azure.mgmt.storage.v2019_06_01.models.AccountSasParameters + :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: ListAccountSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.ListAccountSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_account_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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, 'AccountSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ListAccountSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_account_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'} + + def list_service_sas( + self, resource_group_name, account_name, parameters, custom_headers=None, raw=False, **operation_config): + """List service SAS credentials of a specific resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param parameters: The parameters to provide to list service SAS + credentials. + :type parameters: + ~azure.mgmt.storage.v2019_06_01.models.ServiceSasParameters + :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: ListServiceSasResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.storage.v2019_06_01.models.ListServiceSasResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_service_sas.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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, 'ServiceSasParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ListServiceSasResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_service_sas.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'} + + + def _failover_initial( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.failover.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def failover( + self, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Failover request can be triggered for a storage account in case of + availability issues. The failover occurs from the storage account's + primary cluster to secondary cluster for RA-GRS accounts. The secondary + cluster will become primary after failover. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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:`CloudError` + """ + raw_result = self._failover_initial( + resource_group_name=resource_group_name, + account_name=account_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, lro_options={'final-state-via': 'location'}, **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) + failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'} + + + def _restore_blob_ranges_initial( + self, resource_group_name, account_name, time_to_restore, blob_ranges, custom_headers=None, raw=False, **operation_config): + parameters = models.BlobRestoreParameters(time_to_restore=time_to_restore, blob_ranges=blob_ranges) + + # Construct URL + url = self.restore_blob_ranges.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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, 'BlobRestoreParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BlobRestoreStatus', response) + if response.status_code == 202: + deserialized = self._deserialize('BlobRestoreStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def restore_blob_ranges( + self, resource_group_name, account_name, time_to_restore, blob_ranges, custom_headers=None, raw=False, polling=True, **operation_config): + """Restore blobs in the specified blob ranges. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_name: str + :param time_to_restore: Restore blob to the specified time. + :type time_to_restore: datetime + :param blob_ranges: Blob ranges to restore. + :type blob_ranges: + list[~azure.mgmt.storage.v2019_06_01.models.BlobRestoreRange] + :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 BlobRestoreStatus or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.storage.v2019_06_01.models.BlobRestoreStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.storage.v2019_06_01.models.BlobRestoreStatus]] + :raises: :class:`CloudError` + """ + raw_result = self._restore_blob_ranges_initial( + resource_group_name=resource_group_name, + account_name=account_name, + time_to_restore=time_to_restore, + blob_ranges=blob_ranges, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BlobRestoreStatus', 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, lro_options={'final-state-via': 'location'}, **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) + restore_blob_ranges.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges'} + + def revoke_user_delegation_keys( + self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): + """Revoke user delegation keys. + + :param resource_group_name: The name of the resource group within the + user's subscription. The name is case insensitive. + :type resource_group_name: str + :param account_name: The name of the storage account within the + specified resource group. Storage account names must be between 3 and + 24 characters in length and use numbers and lower-case letters only. + :type account_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:`CloudError` + """ + # Construct URL + url = self.revoke_user_delegation_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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.post(url, query_parameters, header_parameters) + 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + revoke_user_delegation_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys'} diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_usages_operations.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_usages_operations.py new file mode 100644 index 00000000000..b2750e6ba46 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/operations/_usages_operations.py @@ -0,0 +1,110 @@ +# 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 UsagesOperations(object): + """UsagesOperations 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: The API version to use for this operation. Constant value: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list_by_location( + self, location, custom_headers=None, raw=False, **operation_config): + """Gets the current usage count and the limit for the resources of the + location under the subscription. + + :param location: The location of the Azure Storage resource. + :type location: 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: An iterator like instance of Usage + :rtype: + ~azure.mgmt.storage.v2019_06_01.models.UsagePaged[~azure.mgmt.storage.v2019_06_01.models.Usage] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'location': self._serialize.url("location", location, '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', min_length=1) + + 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.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'} diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/version.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/version.py new file mode 100644 index 00000000000..4174449873a --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/v2019_06_01/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 = "2019-06-01" + diff --git a/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/version.py b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/version.py new file mode 100644 index 00000000000..633483b0398 --- /dev/null +++ b/src/storage-or-preview/azext_storage_or_preview/vendored_sdks/azure_mgmt_storage/version.py @@ -0,0 +1,8 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "7.1.0" diff --git a/src/storage-or-preview/setup.cfg b/src/storage-or-preview/setup.cfg new file mode 100644 index 00000000000..3c6e79cf31d --- /dev/null +++ b/src/storage-or-preview/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/src/storage-or-preview/setup.py b/src/storage-or-preview/setup.py new file mode 100644 index 00000000000..74f0c078c37 --- /dev/null +++ b/src/storage-or-preview/setup.py @@ -0,0 +1,60 @@ +#!/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.4.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 :: 2', + 'Programming Language :: Python :: 2.7', + '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='storage-or-preview', + version=VERSION, + description='Microsoft Azure Command-Line Tools Storage-ors-preview 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_storage_or_preview': ['azext_metadata.json']}, +) diff --git a/src/timeseriesinsights/HISTORY.rst b/src/timeseriesinsights/HISTORY.rst new file mode 100644 index 00000000000..681d4312d5c --- /dev/null +++ b/src/timeseriesinsights/HISTORY.rst @@ -0,0 +1,13 @@ +.. :changelog: + +Release History +=============== + +0.1.1 +++++++ +* Fix #1657: ``timeSeriesIdPropertyName`` is not parsed properly +* Fix #1658: When creating a new Standard Environment, ``--data-retention-time`` is not properly documented + +0.1.0 +++++++ +* Initial release. diff --git a/src/timeseriesinsights/README.md b/src/timeseriesinsights/README.md new file mode 100644 index 00000000000..d1a7d7c208c --- /dev/null +++ b/src/timeseriesinsights/README.md @@ -0,0 +1,75 @@ +Microsoft Azure CLI 'timeseriesinsights' Extension +========================================== + +This package is for the 'timeseriesinsights' extension: + +```sh +az timeseriesinsights +``` + +### Create a resource group for the environments + +```sh +rg={resource_group_name} +az group create -n $rg +``` + +### Create a standard environment + +```sh +env={standard_environment_name} +az timeseriesinsights environment standard create -g $rg --name $env --location westus --sku-name S1 --sku-capacity 1 --data-retention-time P31D --partition-key DeviceId1 --storage-limit-exceeded-behavior PauseIngress +``` + +### Create a storage account and use it to create a long-term environment + +```sh +storage={storage_account_name} +env_lt={longterm_environment_name} + +az storage account create -g $rg -n $storage --https-only +key=$(az storage account keys list -g $rg -n $storage --query [0].value --output tsv) + +az timeseriesinsights environment longterm create -g $rg --name $env_lt --location westus --sku-name L1 --sku-capacity 1 --data-retention 7 --time-series-id-properties DeviceId1 --storage-account-name $storage --storage-management-key $key +``` + +### Create an event hub and use it to create an event source + +```sh +ehns={eventhub_namespace} +eh={eventhub_name} + +az eventhubs namespace create -g $rg -n $ehns +es_resource_id=$(az eventhubs eventhub create -g $rg -n $eh --namespace-name $ehns --query id --output tsv) +shared_access_key=$(az eventhubs namespace authorization-rule keys list -g $rg --namespace-name $ehns -n RootManageSharedAccessKey --query primaryKey --output tsv) + +az timeseriesinsights event-source eventhub create -g $rg --environment-name $env --name {es1} --key-name RootManageSharedAccessKey --shared-access-key $shared_access_key --event-source-resource-id $es_resource_id --consumer-group-name '$Default' --timestamp-property-name DeviceId +``` + +### Create an IoT hub and use it to create an event source + +```sh +iothub={iothub_name} +es_resource_id=$(az iot hub create -g $rg -n $iothub --query id --output tsv) +shared_access_key=$(az iot hub policy list -g $rg --hub-name $iothub --query "[?keyName=='iothubowner'].primaryKey" --output tsv) +az timeseriesinsights event-source iothub create -g $rg --environment-name $env --name {es2} --consumer-group-name '$Default' --key-name iothubowner --shared-access-key $shared_access_key --event-source-resource-id $es_resource_id --timestamp-property-name DeviceId +``` + +### Create a reference data set + +```sh +az timeseriesinsights reference-data-set create -g $rg --environment-name $env --name {rds} --key-properties DeviceId1 String DeviceFloor Double --data-string-comparison-behavior Ordinal +``` + +### Create an access policy + +```sh +az timeseriesinsights access-policy create -g $rg --environment-name $env --name ap1 --principal-object-id 001 --description "some description" --roles Contributor Reader +``` + +### Delete the environment and all its sub-resources + +```sh +az timeseriesinsights environment delete --resource-group $rg --name $env +az group delete -n $rg +``` diff --git a/src/timeseriesinsights/azext_timeseriesinsights/__init__.py b/src/timeseriesinsights/azext_timeseriesinsights/__init__.py new file mode 100644 index 00000000000..7d4fcf55f01 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/__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_timeseriesinsights._help import helps # pylint: disable=unused-import + + +class TimeSeriesInsightsClientCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_timeseriesinsights._client_factory import cf_timeseriesinsights + timeseriesinsights_custom = CliCommandType( + operations_tmpl='azext_timeseriesinsights.custom#{}', + client_factory=cf_timeseriesinsights) + super(TimeSeriesInsightsClientCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=timeseriesinsights_custom) + + def load_command_table(self, args): + from azext_timeseriesinsights.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_timeseriesinsights._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = TimeSeriesInsightsClientCommandsLoader diff --git a/src/timeseriesinsights/azext_timeseriesinsights/_client_factory.py b/src/timeseriesinsights/azext_timeseriesinsights/_client_factory.py new file mode 100644 index 00000000000..1a0682338b2 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/_client_factory.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. +# -------------------------------------------------------------------------------------------- + + +def cf_timeseriesinsights(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from .vendored_sdks.timeseriesinsights import TimeSeriesInsightsClient + return get_mgmt_service_client(cli_ctx, TimeSeriesInsightsClient) + + +def cf_environments(cli_ctx, *_): + return cf_timeseriesinsights(cli_ctx).environments + + +def cf_event_sources(cli_ctx, *_): + return cf_timeseriesinsights(cli_ctx).event_sources + + +def cf_reference_data_sets(cli_ctx, *_): + return cf_timeseriesinsights(cli_ctx).reference_data_sets + + +def cf_access_policies(cli_ctx, *_): + return cf_timeseriesinsights(cli_ctx).access_policies diff --git a/src/timeseriesinsights/azext_timeseriesinsights/_help.py b/src/timeseriesinsights/azext_timeseriesinsights/_help.py new file mode 100644 index 00000000000..f5c6c967cf3 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/_help.py @@ -0,0 +1,292 @@ +# 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['timeseriesinsights'] = """ +type: group +short-summary: Manage Azure Time Series Insights. +""" + +helps['timeseriesinsights environment'] = """ +type: group +short-summary: Commands to manage timeseriesinsights environment. +""" + +helps['timeseriesinsights environment standard'] = """ +type: group +short-summary: Create or update a standard environment in the specified subscription and resource group. +""" + +helps['timeseriesinsights environment standard create'] = """ +type: command +short-summary: Create or update a standard environment in the specified subscription and resource group. +examples: + - name: Create a standard environment + text: az timeseriesinsights environment standard create -g {rg} -n {env} --location westus --sku-name S1 --sku-capacity 1 --data-retention-time 31 --partition-key DeviceId1 --storage-limit-exceeded-behavior PauseIngress +""" + +helps['timeseriesinsights environment standard update'] = """ +type: command +short-summary: Update a standard environment in the specified subscription and resource group. +examples: + - name: Update sku capacity + text: az timeseriesinsights environment standard update -g {rg} -n {env} --sku-name S1 --sku-capacity 2 + - name: Update data retention days + text: az timeseriesinsights environment standard update -g {rg} -n {env} --data-retention-time 8 + - name: Update storage limit exceeded behavior + text: az timeseriesinsights environment standard update -g {rg} -n {env} --storage-limit-exceeded-behavior PurgeOldData +""" + +helps['timeseriesinsights environment longterm'] = """ +type: group +short-summary: Create or update a longterm environment in the specified subscription and resource group. +""" + +helps['timeseriesinsights environment longterm create'] = """ +type: command +short-summary: Create or update a longterm environment in the specified subscription and resource group. +examples: + - name: Create storage account and use it to create a longterm environment + text: | + storage=mystorageaccount + rg={rg} + az storage account create -g $rg -n $storage --https-only + key=$(az storage account keys list -g $rg -n $storage --query [0].value --output tsv) + az timeseriesinsights environment longterm create -g $rg -n {env} --location westus --sku-name L1 --sku-capacity 1 --data-retention 7 --time-series-id-properties DeviceId1 --storage-account-name $storage --storage-management-key $key +""" + +helps['timeseriesinsights environment longterm update'] = """ +type: command +short-summary: Update a longterm environment in the specified subscription and resource group. +examples: + - name: Update dataRetention + text: az timeseriesinsights environment longterm update -g {rg} -n {env} --data-retention 8 + - name: Update storageManagementKey + text: az timeseriesinsights environment longterm update -g {rg} -n {env} --storage-management-key xxx +""" + +helps['timeseriesinsights environment delete'] = """ +type: command +short-summary: Delete the environment with the specified name in the specified subscription and resource group. +examples: + - name: Delete an environments + text: |- + az timeseriesinsights environment delete -g {rg} -n {env} +""" + +helps['timeseriesinsights environment show'] = """ +type: command +short-summary: Show the environment with the specified name in the specified subscription and resource group. +examples: + - name: Show an environments + text: |- + az timeseriesinsights environment show -g {rg} -n {env} +""" + +helps['timeseriesinsights environment list'] = """ +type: command +short-summary: List all the available environments associated with the subscription and within the specified resource group. +examples: + - name: List environments by resource group + text: |- + az timeseriesinsights environment list -g {rg} + - name: List environments by subscription + text: |- + az timeseriesinsights environment list +""" + +helps['timeseriesinsights event-source'] = """ +type: group +short-summary: Commands to manage timeseriesinsights event source. +""" + +helps['timeseriesinsights event-source eventhub'] = """ +type: group +short-summary: Create or update an event hub event source under the specified environment. +""" + +helps['timeseriesinsights event-source eventhub create'] = """ +type: command +short-summary: Create or update an event hub event source under the specified environment. +examples: + - name: Create an eventhub and use it for event source + text: | + rg={rg} + ehns={eventhub_namespace} + eh={eventhub_name} + az eventhubs namespace create -g $rg -n $ehns + es_resource_id=$(az eventhubs eventhub create -g $rg -n $eh --namespace-name $ehns --query id --output tsv) + shared_access_key=$(az eventhubs namespace authorization-rule keys list -g $rg --namespace-name $ehns -n RootManageSharedAccessKey --query primaryKey --output tsv) + az timeseriesinsights event-source eventhub create -g $rg --environment-name {env} -n es1 --key-name RootManageSharedAccessKey --shared-access-key $shared_access_key --event-source-resource-id $es_resource_id --consumer-group-name '$Default' --timestamp-property-name DeviceId +""" + +helps['timeseriesinsights event-source eventhub update'] = """ +type: command +short-summary: Create or update an event source under the specified environment. +examples: + - name: Update timestampPropertyName + text: az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} -n {es} --timestamp-property-name DeviceId1 + - name: Update localTimestamp (Currently only Embedded is supported) + text: az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} -n {es} --local-timestamp-format Embedded + - name: Update sharedAccessKey + text: az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} -n {es} --shared-access-key {shared_access_key} +""" + +helps['timeseriesinsights event-source iothub'] = """ +type: group +short-summary: Create or update an iothub event source under the specified environment. +""" + +helps['timeseriesinsights event-source iothub create'] = """ +type: command +short-summary: Create or update an iothub event source under the specified environment. +examples: + - name: Create an iothub and use it for event source + text: | + rg={rg} + iothub={iothub_name} + es_resource_id=$(az iot hub create -g $rg -n $iothub --query id --output tsv) + shared_access_key=$(az iot hub policy list -g $rg --hub-name $iothub --query "[?keyName=='iothubowner'].primaryKey" --output tsv) + az timeseriesinsights event-source iothub create -g $rg --environment-name {env} -n es2 --consumer-group-name '$Default' --key-name iothubowner --shared-access-key $shared_access_key --event-source-resource-id $es_resource_id --timestamp-property-name DeviceId +""" + +helps['timeseriesinsights event-source iothub update'] = """ +type: command +short-summary: Create or update an event source under the specified environment. +examples: + - name: Update timestampPropertyName + text: az timeseriesinsights event-source iothub update -g {rg} --environment-name {env} -n {es} --timestamp-property-name DeviceId1 + - name: Update localTimestamp (Currently only Embedded is supported) + text: az timeseriesinsights event-source iothub update -g {rg} --environment-name {env} -n {es} --local-timestamp-format Embedded + - name: Update sharedAccessKey + text: az timeseriesinsights event-source iothub update -g {rg} --environment-name {env} -n {es} --shared-access-key {shared_access_key} +""" + +helps['timeseriesinsights event-source delete'] = """ +type: command +short-summary: Delete the event source with the specified name in the specified subscription, resource group, and environment +examples: + - name: Delete event-source + text: az timeseriesinsights event-source delete -g {rg} --environment-name {env} -n es1 +""" + +helps['timeseriesinsights event-source show'] = """ +type: command +short-summary: Show the event source with the specified name in the specified environment. +examples: + - name: Show event-source + text: az timeseriesinsights event-source show -g {rg} --environment-name {env} -n es1 +""" + +helps['timeseriesinsights event-source list'] = """ +type: command +short-summary: List all the available event sources associated with the subscription and within the specified resource group and environment. +examples: + - name: List event-source by environment + text: az timeseriesinsights event-source list -g {rg} --environment-name {env} +""" + +helps['timeseriesinsights reference-data-set'] = """ +type: group +short-summary: Commands to manage timeseriesinsights reference data set. +""" + +helps['timeseriesinsights reference-data-set create'] = """ +type: command +short-summary: Create or update a reference data set in the specified environment. +examples: + - name: Create reference-data-set + text: az timeseriesinsights reference-data-set create -g {rg} --environment-name {env} -n {rds} --key-properties DeviceId1 String DeviceFloor Double --data-string-comparison-behavior Ordinal +""" + +helps['timeseriesinsights reference-data-set update'] = """ +type: command +short-summary: Create or update a reference data set in the specified environment. +examples: + - name: Update reference-data-set + text: az timeseriesinsights reference-data-set update -g {rg} --environment-name {env} -n {rds} --tags mykey=myvalue +""" + +helps['timeseriesinsights reference-data-set delete'] = """ +type: command +short-summary: Delete the reference data set with the specified name in the specified subscription, resource group, and environment +examples: + - name: Delete reference-data-set + text: |- + az timeseriesinsights reference-data-set delete -g {rg} --environment-name {env} -n {rds} +""" + +helps['timeseriesinsights reference-data-set show'] = """ +type: command +short-summary: Show the reference data set with the specified name in the specified environment. +examples: + - name: Show reference-data-set + text: |- + az timeseriesinsights reference-data-set show -g {rg} --environment-name {env} -n {rds} +""" + +helps['timeseriesinsights reference-data-set list'] = """ +type: command +short-summary: List all the available reference data sets associated with the subscription and within the specified resource group and environment. +examples: + - name: List reference-data-set by environment + text: |- + az timeseriesinsights reference-data-set list -g {rg} --environment-name {env} +""" + +helps['timeseriesinsights access-policy'] = """ +type: group +short-summary: Commands to manage timeseriesinsights access policy. +""" + +helps['timeseriesinsights access-policy create'] = """ +type: command +short-summary: Create or update an access policy in the specified environment. +examples: + - name: Create access-policy + text: az timeseriesinsights access-policy create -g {rg} --environment-name {env} -n ap1 --principal-object-id 001 --description "some description" --roles Contributor Reader +""" + +helps['timeseriesinsights access-policy update'] = """ +type: command +short-summary: Create or update an access policy in the specified environment. +examples: + - name: Update access-policy + text: |- + az timeseriesinsights access-policy update -g {rg} --environment-name \\ + {env} -n {ap} --roles "Reader,Contributor" +""" + +helps['timeseriesinsights access-policy delete'] = """ +type: command +short-summary: Delete the access policy with the specified name in the specified subscription, resource group, and environment +examples: + - name: Delete access-policy + text: |- + az timeseriesinsights access-policy delete -g {rg} --environment-name {env} -n {ap} +""" + +helps['timeseriesinsights access-policy show'] = """ +type: command +short-summary: Show the access policy with the specified name in the specified environment. +examples: + - name: Get access-policy + text: |- + az timeseriesinsights access-policy show -g {rg} --environment-name {env} -n {ap} +""" + +helps['timeseriesinsights access-policy list'] = """ +type: command +short-summary: List all the available access policies associated with the environment. +examples: + - name: List access-policy by environment + text: |- + az timeseriesinsights access-policy list -g {rg} --environment-name {env} +""" diff --git a/src/timeseriesinsights/azext_timeseriesinsights/_params.py b/src/timeseriesinsights/azext_timeseriesinsights/_params.py new file mode 100644 index 00000000000..04a1aedaa6a --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/_params.py @@ -0,0 +1,85 @@ +# -------------------------------------------------------------------------------------------- +# 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 ( + name_type, + tags_type, + get_enum_type, + get_location_type +) +from azure.cli.core.commands.validators import get_default_location_from_resource_group + +from knack.arguments import CLIArgumentType +from ._validators import iso_8601_timespan + +environment_name_type = CLIArgumentType(id_part='name', help='The name of the Time Series Insights environment associated with the specified resource group.') + + +def load_arguments(self, _): + + with self.argument_context('timeseriesinsights operation list') as c: + pass + + with self.argument_context('timeseriesinsights') as c: + c.argument('location', get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) + c.argument('tags', tags_type) + + # region environment + with self.argument_context('timeseriesinsights environment') as c: + from .vendored_sdks.timeseriesinsights.models import SkuName + c.argument('environment_name', arg_type=name_type, id_part='name', help='The name of the Time Series Insights environment associated with the specified resource group.') + c.argument('sku_name', arg_group="SKU", arg_type=get_enum_type(SkuName), help='The sku determines the type of environment, either standard (S1 or S2) or long-term (L1). For standard environments the sku determines the capacity of the environment, the ingress rate, and the billing rate.') + c.argument('sku_capacity', type=int, arg_group="SKU", help='The capacity of the sku. For standard environments, this value can be changed to support scale out of environments after they have been created.') + + with self.argument_context('timeseriesinsights environment standard') as c: + from .vendored_sdks.timeseriesinsights.models import StorageLimitExceededBehavior + c.argument('storage_limit_exceeded_behavior', arg_type=get_enum_type(StorageLimitExceededBehavior)) + c.argument('data_retention_time', type=iso_8601_timespan, help='The minimum number of days the environment\'s events will be available for query.') + c.argument('partition_key_properties', nargs='+') + + with self.argument_context('timeseriesinsights environment longterm') as c: + c.argument('storage_account_name', arg_group="Storage Configuration", help='The name of the storage account that will hold the environment\'s long term data.') + c.argument('storage_management_key', arg_group="Storage Configuration", help='The value of the management key that grants the Time Series Insights service write access to the storage account. This property is not shown in environment responses.') + c.argument('time_series_id_properties', nargs='+') + c.argument('data_retention', type=iso_8601_timespan, help='The number of days the environment\'s events will be available for query from the warm store.') + # endregion + + # region event-source + with self.argument_context('timeseriesinsights event-source') as c: + from .vendored_sdks.timeseriesinsights.models import LocalTimestampFormat + c.argument('environment_name', arg_type=environment_name_type) + c.argument('event_source_name', arg_type=name_type, id_part='child_name_1', help='The name of the Time Series Insights event source associated with the specified environment.') + c.argument('local_timestamp_format', arg_group="Local Timestamp", arg_type=get_enum_type(LocalTimestampFormat), help='An enum that represents the format of the local timestamp property that needs to be set. Currently only Embedded is supported.') + c.ignore('time_zone_offset_property_name') + # c.argument('time_zone_offset_property_name', arg_group="Local Timestamp", help='The event property that will be contain the offset information to calculate the local timestamp. When the LocalTimestampFormat is Iana, the property name will contain the name of the column which contains IANA Timezone Name (eg: Americas/Los Angeles). When LocalTimestampFormat is Timespan, it contains the name of property which contains values representing the offset (eg: P1D or 1.00:00:00)') + # endregion + + # region reference-data-set + with self.argument_context('timeseriesinsights reference-data-set') as c: + c.argument('environment_name', arg_type=environment_name_type) + c.argument('reference_data_set_name', arg_type=name_type, id_part='child_name_1', help='Name of the reference data set.') + + with self.argument_context('timeseriesinsights reference-data-set create') as c: + from .vendored_sdks.timeseriesinsights.models import DataStringComparisonBehavior + c.argument('key_properties', nargs='+', help='The list of key properties for the reference data set. Format: NAME TYPE ...') + c.argument('data_string_comparison_behavior', arg_type=get_enum_type(DataStringComparisonBehavior)) + # endregion + + # region access-policy + with self.argument_context('timeseriesinsights access-policy') as c: + from .vendored_sdks.timeseriesinsights.models import AccessPolicyRole + c.argument('environment_name', arg_type=environment_name_type) + c.argument('access_policy_name', arg_type=name_type, id_part='child_name_1', help='The name of the Time Series Insights access policy associated with the specified environment.') + c.argument('principal_object_id') + c.argument('description', help='A description of the access policy.') + c.argument('roles', arg_type=get_enum_type(AccessPolicyRole), nargs='+') + # endregion + + for item in ['event-source', 'reference-data-set', 'access-policy']: + with self.argument_context('timeseriesinsights {} list'.format(item)) as c: + c.argument('environment_name', arg_type=environment_name_type, id_part=None) diff --git a/src/timeseriesinsights/azext_timeseriesinsights/_validators.py b/src/timeseriesinsights/azext_timeseriesinsights/_validators.py new file mode 100644 index 00000000000..d0356324028 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/_validators.py @@ -0,0 +1,8 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def iso_8601_timespan(string): + return "P{}D".format(string) diff --git a/src/timeseriesinsights/azext_timeseriesinsights/azext_metadata.json b/src/timeseriesinsights/azext_timeseriesinsights/azext_metadata.json new file mode 100644 index 00000000000..27e30487444 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.3.1" +} diff --git a/src/timeseriesinsights/azext_timeseriesinsights/commands.py b/src/timeseriesinsights/azext_timeseriesinsights/commands.py new file mode 100644 index 00000000000..5cad4544a53 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/commands.py @@ -0,0 +1,99 @@ +# -------------------------------------------------------------------------------------------- +# 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 azure.cli.core.commands.transform import gen_dict_to_list_transform + + +def load_command_table(self, _): + + with self.command_group('timeseriesinsights', is_experimental=True) as g: + pass + + # region environment + from ._client_factory import cf_environments + timeseriesinsights_environments = CliCommandType( + operations_tmpl='azext_timeseriesinsights.vendored_sdks.timeseriesinsights.operations._environments_operations#EnvironmentsOperations.{}', + client_factory=cf_environments) + + with self.command_group('timeseriesinsights environment standard', timeseriesinsights_environments, client_factory=cf_environments) as g: + g.custom_command('create', 'create_timeseriesinsights_environment_standard', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#StandardEnvironmentCreateOrUpdateParameters", + supports_no_wait=True) + g.custom_command('update', 'update_timeseriesinsights_environment_standard', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#StandardEnvironmentCreateOrUpdateParameters", + supports_no_wait=True) + + with self.command_group('timeseriesinsights environment longterm', timeseriesinsights_environments, client_factory=cf_environments) as g: + g.custom_command('create', 'create_timeseriesinsights_environment_longterm', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#LongTermEnvironmentCreateOrUpdateParameters", + supports_no_wait=True) + g.custom_command('update', 'update_timeseriesinsights_environment_longterm', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#LongTermEnvironmentUpdateParameters", + supports_no_wait=True) + + with self.command_group('timeseriesinsights environment', timeseriesinsights_environments, client_factory=cf_environments) as g: + g.command('delete', 'delete', confirmation=True) + g.show_command('show', 'get') + g.custom_command('list', 'list_timeseriesinsights_environment', transform=gen_dict_to_list_transform(key='value')) + # endregion + + # region event-source + from ._client_factory import cf_event_sources + timeseriesinsights_event_sources = CliCommandType( + operations_tmpl='azext_timeseriesinsights.vendored_sdks.timeseriesinsights.operations._event_sources_operations#EventSourcesOperations.{}', + client_factory=cf_event_sources) + + with self.command_group('timeseriesinsights event-source eventhub', timeseriesinsights_event_sources, client_factory=cf_event_sources) as g: + g.custom_command('create', 'create_timeseriesinsights_event_source_eventhub', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#EventHubEventSourceCreateOrUpdateParameters") + g.custom_command('update', 'update_timeseriesinsights_event_source_eventhub', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#EventHubEventSourceUpdateParameters") + + with self.command_group('timeseriesinsights event-source iothub', timeseriesinsights_event_sources, client_factory=cf_event_sources) as g: + g.custom_command('create', 'create_timeseriesinsights_event_source_iothub', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#IoTHubEventSourceCreateOrUpdateParameters") + g.custom_command('update', 'update_timeseriesinsights_event_source_iothub', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#IoTHubEventSourceUpdateParameters") + + with self.command_group('timeseriesinsights event-source', timeseriesinsights_event_sources, client_factory=cf_event_sources) as g: + g.command('delete', 'delete', confirmation=True) + g.show_command('show', 'get') + g.command('list', 'list_by_environment') + # endregion + + # region reference-data-set + from ._client_factory import cf_reference_data_sets + timeseriesinsights_reference_data_sets = CliCommandType( + operations_tmpl='azext_timeseriesinsights.vendored_sdks.timeseriesinsights.operations._reference_data_sets_operations#ReferenceDataSetsOperations.{}', + client_factory=cf_reference_data_sets) + + with self.command_group('timeseriesinsights reference-data-set', timeseriesinsights_reference_data_sets, client_factory=cf_reference_data_sets) as g: + g.custom_command('create', 'create_timeseriesinsights_reference_data_set', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#ReferenceDataSetCreateOrUpdateParameters") + g.custom_command('update', 'update_timeseriesinsights_reference_data_set') + g.command('delete', 'delete', confirmation=True) + g.show_command('show', 'get') + g.command('list', 'list_by_environment') + # endregion + + # region access-policy + from ._client_factory import cf_access_policies + timeseriesinsights_access_policies = CliCommandType( + operations_tmpl='azext_timeseriesinsights.vendored_sdks.timeseriesinsights.operations._access_policies_operations#AccessPoliciesOperations.{}', + client_factory=cf_access_policies) + with self.command_group('timeseriesinsights access-policy', timeseriesinsights_access_policies, client_factory=cf_access_policies) as g: + g.custom_command('create', 'create_timeseriesinsights_access_policy', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#AccessPolicyCreateOrUpdateParameters") + g.custom_command('update', 'update_timeseriesinsights_access_policy', + doc_string_source="azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models#AccessPolicyUpdateParameters") + g.command('delete', 'delete', confirmation=True) + g.show_command('show', 'get') + g.command('list', 'list_by_environment') + # endregion diff --git a/src/timeseriesinsights/azext_timeseriesinsights/custom.py b/src/timeseriesinsights/azext_timeseriesinsights/custom.py new file mode 100644 index 00000000000..12ef1f0d803 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/custom.py @@ -0,0 +1,227 @@ +# -------------------------------------------------------------------------------------------- +# 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_timeseriesinsights_environment_standard(cmd, client, + resource_group_name, environment_name, + sku_name, sku_capacity, + data_retention_time, + storage_limit_exceeded_behavior=None, + partition_key_properties=None, + location=None, tags=None, no_wait=False): + from .vendored_sdks.timeseriesinsights.models import StandardEnvironmentCreateOrUpdateParameters, Sku, \ + TimeSeriesIdProperty + + parameters = StandardEnvironmentCreateOrUpdateParameters( + location=location, + tags=tags, + sku=Sku(name=sku_name, capacity=sku_capacity), + data_retention_time=data_retention_time, + storage_limit_exceeded_behavior=storage_limit_exceeded_behavior, + # Need to confirm whether multiple key properties are supported + partition_key_properties=[TimeSeriesIdProperty(name=id_property, type="String") for id_property in partition_key_properties] + ) + return sdk_no_wait(no_wait, client.create_or_update, resource_group_name=resource_group_name, environment_name=environment_name, parameters=parameters) + + +def update_timeseriesinsights_environment_standard(cmd, client, + resource_group_name, environment_name, + sku_name=None, sku_capacity=None, + data_retention_time=None, storage_limit_exceeded_behavior=None, + partition_key_properties=None, tags=None, no_wait=False): + from .vendored_sdks.timeseriesinsights.models import StandardEnvironmentUpdateParameters, Sku, TimeSeriesIdProperty + + parameters = StandardEnvironmentUpdateParameters( + tags=tags, + sku=Sku(name=sku_name, capacity=sku_capacity) if sku_name and sku_capacity else None, + data_retention_time=data_retention_time, + storage_limit_exceeded_behavior=storage_limit_exceeded_behavior, + partition_key_properties=[TimeSeriesIdProperty(name=id_property, type="String") for id_property in partition_key_properties] if partition_key_properties else None + ) + return sdk_no_wait(no_wait, client.update, resource_group_name=resource_group_name, environment_name=environment_name, parameters=parameters) + + +def create_timeseriesinsights_environment_longterm(cmd, client, + resource_group_name, environment_name, + sku_name, sku_capacity, + time_series_id_properties, + storage_account_name, + storage_management_key, + data_retention, + location=None, tags=None, no_wait=False): + from .vendored_sdks.timeseriesinsights.models import LongTermEnvironmentCreateOrUpdateParameters, Sku, \ + TimeSeriesIdProperty, LongTermStorageConfigurationInput + parameters = LongTermEnvironmentCreateOrUpdateParameters( + location=location, + tags=tags, + sku=Sku(name=sku_name, capacity=sku_capacity), + time_series_id_properties=[TimeSeriesIdProperty(name=id_property, type="String") for id_property in time_series_id_properties], + storage_configuration=LongTermStorageConfigurationInput(account_name=storage_account_name, management_key=storage_management_key), + data_retention=data_retention) + return sdk_no_wait(no_wait, client.create_or_update, resource_group_name=resource_group_name, environment_name=environment_name, parameters=parameters) + + +def update_timeseriesinsights_environment_longterm(cmd, client, + resource_group_name, environment_name, + storage_management_key=None, + data_retention=None, + tags=None, no_wait=False): + from .vendored_sdks.timeseriesinsights.models import LongTermEnvironmentUpdateParameters, \ + LongTermStorageConfigurationMutableProperties + parameters = LongTermEnvironmentUpdateParameters( + tags=tags, + storage_configuration=LongTermStorageConfigurationMutableProperties(management_key=storage_management_key) if storage_management_key else None, + data_retention=data_retention) + return sdk_no_wait(no_wait, client.update, resource_group_name=resource_group_name, environment_name=environment_name, parameters=parameters) + + +def list_timeseriesinsights_environment(cmd, client, resource_group_name=None): + if resource_group_name: + return client.list_by_resource_group(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def create_timeseriesinsights_event_source_eventhub(cmd, client, + resource_group_name, environment_name, event_source_name, + timestamp_property_name, event_source_resource_id, + consumer_group_name, key_name, shared_access_key, + location=None, tags=None): + from azext_timeseriesinsights.vendored_sdks.timeseriesinsights.models import EventHubEventSourceCreateOrUpdateParameters + from msrestazure.tools import parse_resource_id + parsed_id = parse_resource_id(event_source_resource_id) + parameters = EventHubEventSourceCreateOrUpdateParameters( + location=location, + timestamp_property_name=timestamp_property_name, + event_source_resource_id=event_source_resource_id, + service_bus_namespace=parsed_id['name'], + event_hub_name=parsed_id['child_name_1'], + consumer_group_name=consumer_group_name, + key_name=key_name, + shared_access_key=shared_access_key, + tags=tags + ) + return client.create_or_update(resource_group_name=resource_group_name, environment_name=environment_name, event_source_name=event_source_name, parameters=parameters) + + +def update_timeseriesinsights_event_source_eventhub(cmd, client, resource_group_name, environment_name, event_source_name, + timestamp_property_name=None, + local_timestamp_format=None, time_zone_offset_property_name=None, + shared_access_key=None, tags=None): + from .vendored_sdks.timeseriesinsights.models import EventHubEventSourceUpdateParameters, LocalTimestamp, \ + LocalTimestampTimeZoneOffset, LocalTimestampFormat + local_timestamp = None + if local_timestamp_format == LocalTimestampFormat.embedded: + local_timestamp = LocalTimestamp(format=local_timestamp_format) + elif local_timestamp_format and time_zone_offset_property_name: + local_timestamp = LocalTimestamp(format=local_timestamp_format, + time_zone_offset=LocalTimestampTimeZoneOffset(property_name=time_zone_offset_property_name)) + parameters = EventHubEventSourceUpdateParameters(tags=tags, + timestamp_property_name=timestamp_property_name, + local_timestamp=local_timestamp, + shared_access_key=shared_access_key) + + return client.update(resource_group_name=resource_group_name, environment_name=environment_name, event_source_name=event_source_name, + parameters=parameters) + + +def create_timeseriesinsights_event_source_iothub(cmd, client, + resource_group_name, environment_name, event_source_name, + timestamp_property_name, event_source_resource_id, + consumer_group_name, key_name, shared_access_key, + location=None, tags=None): + from .vendored_sdks.timeseriesinsights.models import IoTHubEventSourceCreateOrUpdateParameters + from msrestazure.tools import parse_resource_id + parsed_id = parse_resource_id(event_source_resource_id) + parameters = IoTHubEventSourceCreateOrUpdateParameters( + location=location, + tags=tags, + timestamp_property_name=timestamp_property_name, + event_source_resource_id=event_source_resource_id, + iot_hub_name=parsed_id['name'], + consumer_group_name=consumer_group_name, + key_name=key_name, + shared_access_key=shared_access_key) + return client.create_or_update( + resource_group_name=resource_group_name, environment_name=environment_name, event_source_name=event_source_name, + parameters=parameters) + + +def update_timeseriesinsights_event_source_iothub(cmd, client, + resource_group_name, environment_name, event_source_name, + timestamp_property_name=None, + local_timestamp_format=None, time_zone_offset_property_name=None, + shared_access_key=None, + tags=None): + from .vendored_sdks.timeseriesinsights.models import IoTHubEventSourceUpdateParameters, LocalTimestamp, \ + LocalTimestampTimeZoneOffset, LocalTimestampFormat + local_timestamp = None + if local_timestamp_format == LocalTimestampFormat.embedded: + local_timestamp = LocalTimestamp(format=local_timestamp_format) + elif local_timestamp_format and time_zone_offset_property_name: + local_timestamp = LocalTimestamp(format=local_timestamp_format, + time_zone_offset=LocalTimestampTimeZoneOffset(property_name=time_zone_offset_property_name)) + parameters = IoTHubEventSourceUpdateParameters( + tags=tags, + timestamp_property_name=timestamp_property_name, + local_timestamp=local_timestamp, + shared_access_key=shared_access_key + ) + return client.update(resource_group_name=resource_group_name, environment_name=environment_name, event_source_name=event_source_name, parameters=parameters) + + +def create_timeseriesinsights_reference_data_set(cmd, client, + resource_group_name, environment_name, reference_data_set_name, + key_properties, data_string_comparison_behavior, + location=None, tags=None): + from .vendored_sdks.timeseriesinsights.models import ReferenceDataSetCreateOrUpdateParameters, \ + ReferenceDataSetKeyProperty + + key_properties_list = [] + key_property_count, remaining = divmod(len(key_properties), 2) + if remaining: + from knack.util import CLIError + raise CLIError("Usage error: --key-properties NAME TYPE ...") + + for _ in range(0, key_property_count): + # eg. --key-properties DeviceId1 String DeviceFloor Double + key_properties_list.append(ReferenceDataSetKeyProperty(name=key_properties.pop(0), type=key_properties.pop(0))) + + parameters = ReferenceDataSetCreateOrUpdateParameters( + location=location, + tags=tags, + key_properties=key_properties_list, + data_string_comparison_behavior=data_string_comparison_behavior + ) + + return client.create_or_update(resource_group_name=resource_group_name, environment_name=environment_name, reference_data_set_name=reference_data_set_name, parameters=parameters) + + +def update_timeseriesinsights_reference_data_set(cmd, client, + resource_group_name, environment_name, reference_data_set_name, + tags=None): + return client.update(resource_group_name=resource_group_name, environment_name=environment_name, reference_data_set_name=reference_data_set_name, tags=tags) + + +def create_timeseriesinsights_access_policy(cmd, client, + resource_group_name, environment_name, access_policy_name, + principal_object_id=None, description=None, roles=None): + from .vendored_sdks.timeseriesinsights.models import AccessPolicyCreateOrUpdateParameters + parameters = AccessPolicyCreateOrUpdateParameters( + principal_object_id=principal_object_id, + description=description, + roles=roles) + return client.create_or_update(resource_group_name=resource_group_name, environment_name=environment_name, access_policy_name=access_policy_name, parameters=parameters) + + +def update_timeseriesinsights_access_policy(cmd, client, resource_group_name, environment_name, access_policy_name, + description=None, roles=None): + return client.update(resource_group_name=resource_group_name, environment_name=environment_name, access_policy_name=access_policy_name, description=description, roles=roles) diff --git a/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_access_policy.yaml b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_access_policy.yaml new file mode 100644 index 00000000000..192b6bbdd38 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_access_policy.yaml @@ -0,0 +1,466 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (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/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:52: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", "sku": {"name": "S1", "capacity": 1}, "kind": "Standard", + "properties": {"dataRetentionTime": "P31D", "storageLimitExceededBehavior": + "PauseIngress", "partitionKeyProperties": [{"name": "DeviceId1", "type": "String"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + Content-Length: + - '242' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"2020-04-23T08:52:40+00:00","provisioningState":"Accepted","dataAccessId":"def09b9c-9580-41a8-b1e1-d74e50d8d85a","dataAccessFqdn":"def09b9c-9580-41a8-b1e1-d74e50d8d85a.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '798' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:52:42 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1192' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:40 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"def09b9c-9580-41a8-b1e1-d74e50d8d85a","dataAccessFqdn":"def09b9c-9580-41a8-b1e1-d74e50d8d85a.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '803' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"principalObjectId": "001", "description": "some description", + "roles": ["Contributor", "Reader"]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights access-policy create + Connection: + - keep-alive + Content-Length: + - '115' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --principal-object-id --description --roles + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accessPolicies/ap1?api-version=2018-08-15-preview + response: + body: + string: '{"properties":{"principalObjectId":"001","description":"some description","roles":["Contributor","Reader"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accesspolicies/ap1","name":"ap1","type":"Microsoft.TimeSeriesInsights/Environments/AccessPolicies"}' + headers: + cache-control: + - no-cache + content-length: + - '433' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1195' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"description": "some description updated"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights access-policy update + Connection: + - keep-alive + Content-Length: + - '59' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --description + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accessPolicies/ap1?api-version=2018-08-15-preview + response: + body: + string: '{"properties":{"principalObjectId":"001","description":"some description + updated","roles":["Contributor","Reader"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accesspolicies/ap1","name":"ap1","type":"Microsoft.TimeSeriesInsights/Environments/AccessPolicies"}' + headers: + cache-control: + - no-cache + content-length: + - '441' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1190' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"roles": ["Contributor"]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights access-policy update + Connection: + - keep-alive + Content-Length: + - '42' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --roles + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accessPolicies/ap1?api-version=2018-08-15-preview + response: + body: + string: '{"properties":{"principalObjectId":"001","description":"some description + updated","roles":["Contributor"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accesspolicies/ap1","name":"ap1","type":"Microsoft.TimeSeriesInsights/Environments/AccessPolicies"}' + headers: + cache-control: + - no-cache + content-length: + - '432' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1193' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights access-policy show + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name --name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accessPolicies/ap1?api-version=2018-08-15-preview + response: + body: + string: '{"properties":{"principalObjectId":"001","description":"some description + updated","roles":["Contributor"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accesspolicies/ap1","name":"ap1","type":"Microsoft.TimeSeriesInsights/Environments/AccessPolicies"}' + headers: + cache-control: + - no-cache + content-length: + - '432' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights access-policy list + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accessPolicies?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"properties":{"principalObjectId":"001","description":"some + description updated","roles":["Contributor"]},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accesspolicies/ap1","name":"ap1","type":"Microsoft.TimeSeriesInsights/Environments/AccessPolicies"}]}' + headers: + cache-control: + - no-cache + content-length: + - '444' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:23 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights access-policy delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --environment-name --name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002/accessPolicies/ap1?api-version=2018-08-15-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 08:53:25 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 200 + message: OK +version: 1 diff --git a/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment.yaml b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment.yaml new file mode 100644 index 00000000000..28deed36bc0 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment.yaml @@ -0,0 +1,656 @@ +interactions: +- request: + body: '{"location": "westus", "sku": {"name": "S1", "capacity": 1}, "kind": "Standard", + "properties": {"dataRetentionTime": "P7D", "storageLimitExceededBehavior": "PauseIngress", + "partitionKeyProperties": [{"name": "DeviceId1", "type": "String"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + Content-Length: + - '241' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --location --sku-name --sku-capacity --data-retention-time + --partition-key-properties --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"2020-04-09T06:30:46+00:00","provisioningState":"Accepted","dataAccessId":"2692351f-dd20-4ae0-aef0-77396b0ca167","dataAccessFqdn":"2692351f-dd20-4ae0-aef0-77396b0ca167.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1","name":"env1","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '757' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:30:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --sku-name --sku-capacity --data-retention-time + --partition-key-properties --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 09 Apr 2020 06:30:46 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"2692351f-dd20-4ae0-aef0-77396b0ca167","dataAccessFqdn":"2692351f-dd20-4ae0-aef0-77396b0ca167.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1","name":"env1","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:31:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account keys list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2019-06-01 + response: + body: + string: '{"keys":[{"keyName":"key1","value":"veryFakedStorageAccountKey==","permissions":"FULL"},{"keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:31:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11997' + status: + code: 200 + message: OK +- request: + body: 'b''{"location": "westus", "sku": {"name": "L1", "capacity": 1}, "kind": + "LongTerm", "properties": {"timeSeriesIdProperties": [{"name": "[\''DeviceId1\'']", + "type": "String"}], "storageConfiguration": {"accountName": "clitest000002", + "managementKey": "veryFakedStorageAccountKey=="}, "warmStoreConfiguration": + {"dataRetention": "P7D"}}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + Content-Length: + - '399' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --location --sku-name --sku-capacity --data-retention + --time-series-id-properties --storage-account-name --storage-management-key + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"2020-04-09T06:31:30+00:00","provisioningState":"Accepted","dataAccessId":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333","dataAccessFqdn":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '804' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:31:32 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --sku-name --sku-capacity --data-retention + --time-series-id-properties --storage-account-name --storage-management-key + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 09 Apr 2020 06:31:30 GMT","provisioningState":"Creating","requestApiVersion":"2018-08-15-preview","dataAccessId":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333","dataAccessFqdn":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '808' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:32:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --sku-name --sku-capacity --data-retention + --time-series-id-properties --storage-account-name --storage-management-key + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 09 Apr 2020 06:31:30 GMT","provisioningState":"Creating","requestApiVersion":"2018-08-15-preview","dataAccessId":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333","dataAccessFqdn":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '808' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:32:35 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --sku-name --sku-capacity --data-retention + --time-series-id-properties --storage-account-name --storage-management-key + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 09 Apr 2020 06:31:30 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333","dataAccessFqdn":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '809' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:33:05 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment show + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 09 Apr 2020 06:30:46 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"2692351f-dd20-4ae0-aef0-77396b0ca167","dataAccessFqdn":"2692351f-dd20-4ae0-aef0-77396b0ca167.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1","name":"env1","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '762' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:33:09 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment show + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 09 Apr 2020 06:31:30 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333","dataAccessFqdn":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '809' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:33:11 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 09 Apr 2020 06:31:30 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333","dataAccessFqdn":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 09 Apr 2020 06:30:46 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"2692351f-dd20-4ae0-aef0-77396b0ca167","dataAccessFqdn":"2692351f-dd20-4ae0-aef0-77396b0ca167.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1","name":"env1","type":"Microsoft.TimeSeriesInsights/Environments"}]}' + headers: + cache-control: + - no-cache + content-length: + - '1584' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:33:14 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment list + Connection: + - keep-alive + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.TimeSeriesInsights/environments?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 09 Apr 2020 06:31:30 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333","dataAccessFqdn":"6c66cdbc-2fd7-46bb-a2b0-c72e70e79333.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 09 Apr 2020 03:39:01 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"d38f6ddf-2f42-4524-a467-7fb2635bc0de","dataAccessFqdn":"d38f6ddf-2f42-4524-a467-7fb2635bc0de.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/environments/env1","name":"env1","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 09 Apr 2020 06:30:46 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"2692351f-dd20-4ae0-aef0-77396b0ca167","dataAccessFqdn":"2692351f-dd20-4ae0-aef0-77396b0ca167.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1","name":"env1","type":"Microsoft.TimeSeriesInsights/Environments"}]}' + headers: + cache-control: + - no-cache + content-length: + - '2275' + content-type: + - application/json + date: + - Thu, 09 Apr 2020 06:33:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env1?api-version=2018-08-15-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 09 Apr 2020 06:33:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.3.1 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/env2?api-version=2018-08-15-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 09 Apr 2020 06:33:27 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 200 + message: OK +version: 1 diff --git a/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment_longterm.yaml b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment_longterm.yaml new file mode 100644 index 00000000000..93cd1937f4f --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment_longterm.yaml @@ -0,0 +1,418 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account keys list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --query --output + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Storage/storageAccounts/clitest000002/listKeys?api-version=2019-06-01 + response: + body: + string: '{"keys":[{"keyName":"key1","value":"veryFakedStorageAccountKey==","permissions":"FULL"},{"keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json + date: + - Fri, 08 May 2020 03:47:25 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '11999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention --time-series-id-properties + --storage-account-name --storage-management-key + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-resource/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-05-08T03:46:53Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 03:47:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: 'b''{"location": "westus", "sku": {"name": "L1", "capacity": 1}, "kind": + "LongTerm", "properties": {"timeSeriesIdProperties": [{"name": "DeviceId1", + "type": "String"}], "storageConfiguration": {"accountName": "clitest000002", + "managementKey": "veryFakedStorageAccountKey=="}, "warmStoreConfiguration": + {"dataRetention": "P7D"}}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + Content-Length: + - '395' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention --time-series-id-properties + --storage-account-name --storage-management-key + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"DeviceId1","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"2020-05-08T03:47:33.3693862+00:00","provisioningState":"Accepted","dataAccessId":"f0b7d698-58b0-49b6-96f2-ccb8bf7a6067","dataAccessFqdn":"f0b7d698-58b0-49b6-96f2-ccb8bf7a6067.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '848' + content-type: + - application/json + date: + - Fri, 08 May 2020 03:47:35 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention --time-series-id-properties + --storage-account-name --storage-management-key + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.5.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"DeviceId1","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"2020-05-08T03:47:33.3693862Z","provisioningState":"Creating","requestApiVersion":"2018-08-15-preview","dataAccessId":"f0b7d698-58b0-49b6-96f2-ccb8bf7a6067","dataAccessFqdn":"f0b7d698-58b0-49b6-96f2-ccb8bf7a6067.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '843' + content-type: + - application/json + date: + - Fri, 08 May 2020 03:48:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention --time-series-id-properties + --storage-account-name --storage-management-key + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.5.1 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"DeviceId1","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"2020-05-08T03:47:33.3693862Z","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"f0b7d698-58b0-49b6-96f2-ccb8bf7a6067","dataAccessFqdn":"f0b7d698-58b0-49b6-96f2-ccb8bf7a6067.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '844' + content-type: + - application/json + date: + - Fri, 08 May 2020 03:48:37 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"warmStoreConfiguration": {"dataRetention": "P8D"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm update + Connection: + - keep-alive + Content-Length: + - '68' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --data-retention + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":{},"properties":{"timeSeriesIdProperties":[{"name":"DeviceId1","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P8D"},"creationTime":"2020-05-08T03:47:33.3693862Z","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"f0b7d698-58b0-49b6-96f2-ccb8bf7a6067","dataAccessFqdn":"f0b7d698-58b0-49b6-96f2-ccb8bf7a6067.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '842' + content-type: + - application/json + date: + - Fri, 08 May 2020 03:48:41 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"keyName": "key1"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - storage account keys renew + Connection: + - keep-alive + Content-Length: + - '19' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --key --query --output + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-storage/9.0.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Storage/storageAccounts/clitest000002/regenerateKey?api-version=2019-06-01 + response: + body: + string: '{"keys":[{"keyName":"key1","value":"r7RjB6uTrqw/PZYWGY3YofQZ+416xbsedSMaA1OcpsVmk71mMzeGpWuXe4A1cW2jcaZ5iqFFDNj2H2KARaGNPg==","permissions":"FULL"},{"keyName":"key2","value":"veryFakedStorageAccountKey==","permissions":"FULL"}]}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json + date: + - Fri, 08 May 2020 03:49:41 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"storageConfiguration": {"managementKey": "r7RjB6uTrqw/PZYWGY3YofQZ+416xbsedSMaA1OcpsVmk71mMzeGpWuXe4A1cW2jcaZ5iqFFDNj2H2KARaGNPg=="}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment longterm update + Connection: + - keep-alive + Content-Length: + - '151' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --storage-management-key + User-Agent: + - python/3.8.2 (Windows-10-10.0.18362-SP0) msrest/0.6.13 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.5.1 + accept-language: + - en-US + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":{},"properties":{"timeSeriesIdProperties":[{"name":"DeviceId1","type":"String"}],"storageConfiguration":{"accountName":"clitest000002"},"warmStoreConfiguration":{"dataRetention":"P8D"},"creationTime":"2020-05-08T03:47:33.3693862Z","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"f0b7d698-58b0-49b6-96f2-ccb8bf7a6067","dataAccessFqdn":"f0b7d698-58b0-49b6-96f2-ccb8bf7a6067.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '842' + content-type: + - application/json + date: + - Fri, 08 May 2020 03:49:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +version: 1 diff --git a/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment_standard.yaml b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment_standard.yaml new file mode 100644 index 00000000000..32b2fdf54c7 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_environment_standard.yaml @@ -0,0 +1,615 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (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/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:52:32 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", "sku": {"name": "S1", "capacity": 1}, "kind": "Standard", + "properties": {"dataRetentionTime": "P7D", "storageLimitExceededBehavior": "PauseIngress", + "partitionKeyProperties": [{"name": "DeviceId1", "type": "String"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + Content-Length: + - '241' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"2020-04-23T08:52:48+00:00","provisioningState":"Accepted","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '797' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:52:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Creating","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '801' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:24 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '802' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:56 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"sku": {"name": "S1", "capacity": 2}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard update + Connection: + - keep-alive + Content-Length: + - '38' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":2},"kind":"Standard","location":"westus","tags":{},"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:02 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1193' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"dataRetentionTime": "P8D"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard update + Connection: + - keep-alive + Content-Length: + - '44' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --data-retention-time + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":2},"kind":"Standard","location":"westus","tags":{},"properties":{"dataRetentionTime":"P8D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:04 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1189' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"storageLimitExceededBehavior": "PurgeOldData"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard update + Connection: + - keep-alive + Content-Length: + - '64' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":2},"kind":"Standard","location":"westus","tags":{},"properties":{"dataRetentionTime":"P8D","storageLimitExceededBehavior":"PurgeOldData","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:06 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment show + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":2},"kind":"Standard","location":"westus","tags":{},"properties":{"dataRetentionTime":"P8D","storageLimitExceededBehavior":"PurgeOldData","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '800' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"sku":{"name":"S1","capacity":2},"kind":"Standard","location":"westus","tags":{},"properties":{"dataRetentionTime":"P8D","storageLimitExceededBehavior":"PurgeOldData","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"}]}' + headers: + cache-control: + - no-cache + content-length: + - '812' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment list + Connection: + - keep-alive + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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.TimeSeriesInsights/environments?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:42 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"c72de72b-1e7e-437a-b889-28db0873600b","dataAccessFqdn":"c72de72b-1e7e-437a-b889-28db0873600b.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights2oiftej3hx5342cijs7v7cjogck3zpitrefknndb425ds5ty/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-enve5dpsot4","name":"cli-test-tsi-enve5dpsot4","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"WestUs","tags":{},"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"jlst0423"},"warmStoreConfiguration":{"dataRetention":"P12D"},"creationTime":"Thu, + 23 Apr 2020 07:31:28 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"7edc94e2-0d50-45ec-87f0-8581f9fdb896","dataAccessFqdn":"7edc94e2-0d50-45ec-87f0-8581f9fdb896.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/environments/env2","name":"env2","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:40 GMT","provisioningState":"Deleting","requestApiVersion":"2018-08-15-preview","dataAccessId":"def09b9c-9580-41a8-b1e1-d74e50d8d85a","dataAccessFqdn":"def09b9c-9580-41a8-b1e1-d74e50d8d85a.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsightsq2yvggz3wbrhaaimlkvs4pxaodgoxddp7xdsnv4c2ku5sc6x/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-enviwayt2td","name":"cli-test-tsi-enviwayt2td","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitesti77jqi5ajd6qf26ih"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 23 Apr 2020 08:15:51 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"b7940864-a0c6-49f3-97f0-2f97a92029f1","dataAccessFqdn":"b7940864-a0c6-49f3-97f0-2f97a92029f1.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsightslqf77dpmzjutptzaamy3njmq2em5vzikcppxdp4xv3yzg52h/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-envkatcjyef","name":"cli-test-tsi-envkatcjyef","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:45 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"19d80b62-5ad8-413d-b006-9a81ba3dd670","dataAccessFqdn":"19d80b62-5ad8-413d-b006-9a81ba3dd670.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsightsykcxb7ztbepz3cbrz62whynq3mxbkltafzns3znlvb5q6v2e/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-envmy2ib4my","name":"cli-test-tsi-envmy2ib4my","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":2},"kind":"Standard","location":"westus","tags":{},"properties":{"dataRetentionTime":"P8D","storageLimitExceededBehavior":"PurgeOldData","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:48 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"62ae24e5-6a5e-4752-945f-1dc74218f1fd","dataAccessFqdn":"62ae24e5-6a5e-4752-945f-1dc74218f1fd.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002","name":"cli-test-tsi-env000002","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:52 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"e366c607-9592-48f9-9f57-c274fd9787df","dataAccessFqdn":"e366c607-9592-48f9-9f57-c274fd9787df.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights6sqryqtjaivs76kpg4o4jrz7swfdygumzpyic7illekv6j5d/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-envkvpwo2pu","name":"cli-test-tsi-envkvpwo2pu","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"L1","capacity":1},"kind":"LongTerm","location":"westus","tags":null,"properties":{"timeSeriesIdProperties":[{"name":"[''DeviceId1'']","type":"String"}],"storageConfiguration":{"accountName":"clitest7rfijel6fwut5i5pu"},"warmStoreConfiguration":{"dataRetention":"P7D"},"creationTime":"Thu, + 23 Apr 2020 08:53:07 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"27230d72-77ee-4156-aa4a-43b545cc2504","dataAccessFqdn":"27230d72-77ee-4156-aa4a-43b545cc2504.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsightsq2vksngavqljrt5cw4eqq4kppsqha6q6co7anboikjdobqyl/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env6qb4o6ft","name":"cli-test-tsi-env6qb4o6ft","type":"Microsoft.TimeSeriesInsights/Environments"},{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus2","tags":null,"properties":{"dataRetentionTime":"P7D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 07:17:29 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"b5a60b17-e0a7-4e3a-87f7-cf48569e7eb9","dataAccessFqdn":"b5a60b17-e0a7-4e3a-87f7-cf48569e7eb9.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/environments/env1","name":"env1","type":"Microsoft.TimeSeriesInsights/Environments"}]}' + headers: + cache-control: + - no-cache + content-length: + - '7140' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:12 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: + - 4e81e23e-97dd-4478-82fd-9d5391fd2120 + - 185cfc4a-c8f8-478c-8489-4856a1b327e8 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --resource-group --name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000002?api-version=2018-08-15-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 08:54:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment list + Connection: + - keep-alive + ParameterSetName: + - --resource-group + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments?api-version=2018-08-15-preview + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:18 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/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_event_source_eventhub.yaml b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_event_source_eventhub.yaml new file mode 100644 index 00000000000..05074c431d8 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_event_source_eventhub.yaml @@ -0,0 +1,1005 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (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/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:52: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", "sku": {"name": "S1", "capacity": 1}, "kind": "Standard", + "properties": {"dataRetentionTime": "P31D", "storageLimitExceededBehavior": + "PauseIngress", "partitionKeyProperties": [{"name": "DeviceId1", "type": "String"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + Content-Length: + - '242' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"2020-04-23T08:52:42+00:00","provisioningState":"Accepted","dataAccessId":"c72de72b-1e7e-437a-b889-28db0873600b","dataAccessFqdn":"c72de72b-1e7e-437a-b889-28db0873600b.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005","name":"cli-test-tsi-env000005","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '798' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:52:47 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1194' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:42 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"c72de72b-1e7e-437a-b889-28db0873600b","dataAccessFqdn":"c72de72b-1e7e-437a-b889-28db0873600b.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005","name":"cli-test-tsi-env000005","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '803' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (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/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:53:21 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", "sku": {"name": "Standard", "tier": "Standard"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs namespace create + Connection: + - keep-alive + Content-Length: + - '71' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-eventhub/3.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/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003?api-version=2017-04-01 + response: + body: + string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003","name":"cli-test-tsi-ehns000003","type":"Microsoft.EventHub/Namespaces","location":"West + US","tags":{},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590:cli-test-tsi-ehns000003","createdAt":"2020-04-23T08:53:26.513Z","updatedAt":"2020-04-23T08:53:26.513Z","serviceBusEndpoint":"https://cli-test-tsi-ehns000003.servicebus.windows.net:443/","status":"Activating"}}' + headers: + cache-control: + - no-cache + content-length: + - '757' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:53:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '49' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-eventhub/3.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003?api-version=2017-04-01 + response: + body: + string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003","name":"cli-test-tsi-ehns000003","type":"Microsoft.EventHub/Namespaces","location":"West + US","tags":{},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590:cli-test-tsi-ehns000003","createdAt":"2020-04-23T08:53:26.513Z","updatedAt":"2020-04-23T08:53:26.513Z","serviceBusEndpoint":"https://cli-test-tsi-ehns000003.servicebus.windows.net:443/","status":"Activating"}}' + headers: + cache-control: + - no-cache + content-length: + - '757' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:53:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-eventhub/3.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003?api-version=2017-04-01 + response: + body: + string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003","name":"cli-test-tsi-ehns000003","type":"Microsoft.EventHub/Namespaces","location":"West + US","tags":{},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590:cli-test-tsi-ehns000003","createdAt":"2020-04-23T08:53:26.513Z","updatedAt":"2020-04-23T08:54:13.757Z","serviceBusEndpoint":"https://cli-test-tsi-ehns000003.servicebus.windows.net:443/","status":"Active"}}' + headers: + cache-control: + - no-cache + content-length: + - '755' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:32 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs namespace create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-eventhub/3.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/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003?api-version=2017-04-01 + response: + body: + string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003","name":"cli-test-tsi-ehns000003","type":"Microsoft.EventHub/Namespaces","location":"West + US","tags":{},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590:cli-test-tsi-ehns000003","createdAt":"2020-04-23T08:53:26.513Z","updatedAt":"2020-04-23T08:54:13.757Z","serviceBusEndpoint":"https://cli-test-tsi-ehns000003.servicebus.windows.net:443/","status":"Active"}}' + headers: + cache-control: + - no-cache + content-length: + - '755' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:40 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs eventhub create + Connection: + - keep-alive + Content-Length: + - '2' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n --namespace-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-eventhub/3.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/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004?api-version=2017-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004","name":"cli-test-tsi-eh000004","type":"Microsoft.EventHub/Namespaces/EventHubs","location":"West + US","properties":{"messageRetentionInDays":7,"partitionCount":4,"status":"Active","createdAt":"2020-04-23T08:54:43.85Z","updatedAt":"2020-04-23T08:54:44.367Z","partitionIds":["0","1","2","3"]}}' + headers: + cache-control: + - no-cache + content-length: + - '544' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1191' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs namespace authorization-rule keys list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --namespace-name -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-eventhub/3.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/AuthorizationRules/RootManageSharedAccessKey/listKeys?api-version=2017-04-01 + response: + body: + string: '{"primaryConnectionString":"Endpoint=sb://cli-test-tsi-ehns000003.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=EqhKj+SvaHDKWGT5sKKkAbofTWwoW1LBT1JOmBiveRM=","secondaryConnectionString":"Endpoint=sb://cli-test-tsi-ehns000003.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=A/3CAuapkQ9VWa+4a0Q9zDd3CCJ2k4YNWFBX2m+WCmQ=","primaryKey":"EqhKj+SvaHDKWGT5sKKkAbofTWwoW1LBT1JOmBiveRM=","secondaryKey":"A/3CAuapkQ9VWa+4a0Q9zDd3CCJ2k4YNWFBX2m+WCmQ=","keyName":"RootManageSharedAccessKey"}' + headers: + cache-control: + - no-cache + content-length: + - '559' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:46 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source eventhub create + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name --name --key-name --shared-access-key --event-source-resource-id + --consumer-group-name --timestamp-property-name + User-Agent: + - python/3.8.1 (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/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:47 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: 'b''{"location": "westus", "kind": "Microsoft.EventHub", "properties": {"timestampPropertyName": + "DeviceId", "eventSourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004", + "serviceBusNamespace": "cli-test-tsi-ehns000003", "eventHubName": "cli-test-tsi-eh000004", + "consumerGroupName": "$Default", "keyName": "RootManageSharedAccessKey", "sharedAccessKey": + "EqhKj+SvaHDKWGT5sKKkAbofTWwoW1LBT1JOmBiveRM="}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source eventhub create + Connection: + - keep-alive + Content-Length: + - '611' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --key-name --shared-access-key --event-source-resource-id + --consumer-group-name --timestamp-property-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.EventHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004","serviceBusNamespace":"cli-test-tsi-ehns000003","eventHubName":"cli-test-tsi-eh000004","consumerGroupName":"$Default","keyName":"RootManageSharedAccessKey","creationTime":"Thu, + 23 Apr 2020 08:54:53 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '982' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"timestampPropertyName": "DeviceId1"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source eventhub update + Connection: + - keep-alive + Content-Length: + - '54' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --timestamp-property-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.EventHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004","serviceBusNamespace":"cli-test-tsi-ehns000003","eventHubName":"cli-test-tsi-eh000004","consumerGroupName":"$Default","keyName":"RootManageSharedAccessKey","creationTime":"Thu, + 23 Apr 2020 08:54:53 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '983' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:56 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"localTimestamp": {"format": "Embedded"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source eventhub update + Connection: + - keep-alive + Content-Length: + - '58' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --local-timestamp-format + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.EventHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004","serviceBusNamespace":"cli-test-tsi-ehns000003","eventHubName":"cli-test-tsi-eh000004","consumerGroupName":"$Default","keyName":"RootManageSharedAccessKey","creationTime":"Thu, + 23 Apr 2020 08:54:53 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '1044' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1192' + status: + code: 200 + message: OK +- request: + body: '{"keyType": "PrimaryKey"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - eventhubs namespace authorization-rule keys renew + Connection: + - keep-alive + Content-Length: + - '25' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --namespace-name -n --key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-eventhub/3.0.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/AuthorizationRules/RootManageSharedAccessKey/regenerateKeys?api-version=2017-04-01 + response: + body: + string: '{"primaryConnectionString":"Endpoint=sb://cli-test-tsi-ehns000003.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=R7iSQjfokTcwmtsi2uqaxVO/8I6Br8wX8GrxFJ3NmqE=","secondaryConnectionString":"Endpoint=sb://cli-test-tsi-ehns000003.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=A/3CAuapkQ9VWa+4a0Q9zDd3CCJ2k4YNWFBX2m+WCmQ=","primaryKey":"R7iSQjfokTcwmtsi2uqaxVO/8I6Br8wX8GrxFJ3NmqE=","secondaryKey":"A/3CAuapkQ9VWa+4a0Q9zDd3CCJ2k4YNWFBX2m+WCmQ=","keyName":"RootManageSharedAccessKey"}' + headers: + cache-control: + - no-cache + content-length: + - '559' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:55:08 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Service-Bus-Resource-Provider/CH3 + - Microsoft-HTTPAPI/2.0 + server-sb: + - Service-Bus-Resource-Provider/CH3 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"sharedAccessKey": "R7iSQjfokTcwmtsi2uqaxVO/8I6Br8wX8GrxFJ3NmqE="}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source eventhub update + Connection: + - keep-alive + Content-Length: + - '83' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --shared-access-key + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.EventHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004","serviceBusNamespace":"cli-test-tsi-ehns000003","eventHubName":"cli-test-tsi-eh000004","consumerGroupName":"$Default","keyName":"RootManageSharedAccessKey","creationTime":"Thu, + 23 Apr 2020 08:54:53 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '1044' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:55:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1191' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source list + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventSources?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"kind":"Microsoft.EventHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004","serviceBusNamespace":"cli-test-tsi-ehns000003","eventHubName":"cli-test-tsi-eh000004","consumerGroupName":"$Default","keyName":"RootManageSharedAccessKey","creationTime":"Thu, + 23 Apr 2020 08:54:53 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}]}' + headers: + cache-control: + - no-cache + content-length: + - '1056' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:55:13 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source show + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.EventHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.EventHub/namespaces/cli-test-tsi-ehns000003/eventhubs/cli-test-tsi-eh000004","serviceBusNamespace":"cli-test-tsi-ehns000003","eventHubName":"cli-test-tsi-eh000004","consumerGroupName":"$Default","keyName":"RootManageSharedAccessKey","creationTime":"Thu, + 23 Apr 2020 08:54:53 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '1044' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:55:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --environment-name -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000005/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 08:55:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 200 + message: OK +version: 1 diff --git a/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_event_source_iothub.yaml b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_event_source_iothub.yaml new file mode 100644 index 00000000000..65b7b15faaa --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_event_source_iothub.yaml @@ -0,0 +1,1501 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (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/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:52: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", "sku": {"name": "S1", "capacity": 1}, "kind": "Standard", + "properties": {"dataRetentionTime": "P31D", "storageLimitExceededBehavior": + "PauseIngress", "partitionKeyProperties": [{"name": "DeviceId1", "type": "String"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + Content-Length: + - '242' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"2020-04-23T08:52:52+00:00","provisioningState":"Accepted","dataAccessId":"e366c607-9592-48f9-9f57-c274fd9787df","dataAccessFqdn":"e366c607-9592-48f9-9f57-c274fd9787df.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004","name":"cli-test-tsi-env000004","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '798' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:52:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1191' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:52 GMT","provisioningState":"Creating","requestApiVersion":"2018-08-15-preview","dataAccessId":"e366c607-9592-48f9-9f57-c274fd9787df","dataAccessFqdn":"e366c607-9592-48f9-9f57-c274fd9787df.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004","name":"cli-test-tsi-env000004","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '802' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:52 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"e366c607-9592-48f9-9f57-c274fd9787df","dataAccessFqdn":"e366c607-9592-48f9-9f57-c274fd9787df.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004","name":"cli-test-tsi-env000004","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '803' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"name": "cli-test-tsi-iothub000003"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + Content-Length: + - '36' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/checkNameAvailability?api-version=2019-07-01-preview + response: + body: + string: '{"nameAvailable":true,"reason":"Invalid","message":null}' + headers: + cache-control: + - no-cache + content-length: + - '56' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:53:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (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/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:00 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": {"eventHubEndpoints": {"events": {"retentionTimeInDays": + 1, "partitionCount": 4}}, "storageEndpoints": {"$default": {"sasTtlAsIso8601": + "PT1H", "connectionString": "", "containerName": ""}}, "messagingEndpoints": + {"fileNotifications": {"ttlAsIso8601": "PT1H", "maxDeliveryCount": 10}}, "enableFileUploadNotifications": + false, "cloudToDevice": {"maxDeliveryCount": 10, "defaultTtlAsIso8601": "PT1H", + "feedback": {"lockDurationAsIso8601": "PT5S", "ttlAsIso8601": "PT1H", "maxDeliveryCount": + 10}}}, "sku": {"name": "S1", "capacity": 1}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + Content-Length: + - '570' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.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/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003?api-version=2019-07-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","name":"cli-test-tsi-iothub000003","type":"Microsoft.Devices/IotHubs","location":"westus","tags":{},"subscriptionid":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","resourcegroup":"cli_test_timeseriesinsights000001","properties":{"state":"Activating","provisioningState":"Accepted","eventHubEndpoints":{"events":{"retentionTimeInDays":1,"partitionCount":4},"operationsMonitoringEvents":{"retentionTimeInDays":1,"partitionCount":4}},"storageEndpoints":{"$default":{"sasTtlAsIso8601":"PT1H","connectionString":"","containerName":""}},"messagingEndpoints":{"fileNotifications":{"lockDurationAsIso8601":"PT1M","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"enableFileUploadNotifications":false,"cloudToDevice":{"maxDeliveryCount":10,"defaultTtlAsIso8601":"PT1H","feedback":{"lockDurationAsIso8601":"PT5S","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"features":"None"},"sku":{"name":"S1","tier":"Standard","capacity":1}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/operationResults/b3NfaWhfNzgwYTc0ZWItODMwZS00NmNmLThiMzEtYTEzNTE2ZjIwZDYw?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo + cache-control: + - no-cache + content-length: + - '1162' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:09 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '4999' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/operationResults/b3NfaWhfNzgwYTc0ZWItODMwZS00NmNmLThiMzEtYTEzNTE2ZjIwZDYw?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:41 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/operationResults/b3NfaWhfNzgwYTc0ZWItODMwZS00NmNmLThiMzEtYTEzNTE2ZjIwZDYw?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:55:11 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/operationResults/b3NfaWhfNzgwYTc0ZWItODMwZS00NmNmLThiMzEtYTEzNTE2ZjIwZDYw?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:55:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/operationResults/b3NfaWhfNzgwYTc0ZWItODMwZS00NmNmLThiMzEtYTEzNTE2ZjIwZDYw?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub create + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003?api-version=2019-07-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","name":"cli-test-tsi-iothub000003","type":"Microsoft.Devices/IotHubs","location":"westus","tags":{},"subscriptionid":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","resourcegroup":"cli_test_timeseriesinsights000001","etag":"AAAAAA0HLQ8=","properties":{"locations":[{"location":"West + US","role":"primary"},{"location":"East US","role":"secondary"}],"state":"Active","provisioningState":"Succeeded","ipFilterRules":[],"hostName":"cli-test-tsi-iothub000003.azure-devices.net","eventHubEndpoints":{"events":{"retentionTimeInDays":1,"partitionCount":4,"partitionIds":["0","1","2","3"],"path":"cli-test-tsi-iothub000003","endpoint":"sb://iothub-ns-cli-test-t-3301249-4bb741b8fe.servicebus.windows.net/"}},"routing":{"endpoints":{"serviceBusQueues":[],"serviceBusTopics":[],"eventHubs":[],"storageContainers":[]},"routes":[],"fallbackRoute":{"name":"$fallback","source":"DeviceMessages","condition":"true","endpointNames":["events"],"isEnabled":true}},"storageEndpoints":{"$default":{"sasTtlAsIso8601":"PT1H","connectionString":"","containerName":""}},"messagingEndpoints":{"fileNotifications":{"lockDurationAsIso8601":"PT1M","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"enableFileUploadNotifications":false,"cloudToDevice":{"maxDeliveryCount":10,"defaultTtlAsIso8601":"PT1H","feedback":{"lockDurationAsIso8601":"PT5S","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"features":"None"},"sku":{"name":"S1","tier":"Standard","capacity":1}}' + headers: + cache-control: + - no-cache + content-length: + - '1673' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy list + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --hub-name --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003/listkeys?api-version=2019-07-01-preview + response: + body: + string: '{"value":[{"keyName":"iothubowner","primaryKey":"TDulTUXa7mEtEL0wtQM6C4yKUJNwW6EB49ZjRMTHwnI=","secondaryKey":"PeBGGf/IiiQo23hAxASRJlJqQrqyJ1PXdpfdF+MMU9M=","rights":"RegistryWrite, + ServiceConnect, DeviceConnect"},{"keyName":"service","primaryKey":"dQLAouEOJHUz4KBBkmvhaWFEIkWZ4COrAR+NfVtD96U=","secondaryKey":"3JYW+ZuAtVmilPaqd/Vt/mTPW7yJatMpOidVbVuGWLk=","rights":"ServiceConnect"},{"keyName":"device","primaryKey":"qlEod871Un0IBPBYkljGGFCmSN/ntvc64tRyoVpdaIY=","secondaryKey":"c3BEZTAUoS8cypUbUSUjxCSFtJ9+lGdHqw1hNsZCAqs=","rights":"DeviceConnect"},{"keyName":"registryRead","primaryKey":"GywrLHwOJeigEL5K2h+2bZSk81NG8CsyigNy7durJzs=","secondaryKey":"eRPuE4ZLe4f27RgmKgaBcvP88rk2ipGw9Oohb4B4Ntk=","rights":"RegistryRead"},{"keyName":"registryReadWrite","primaryKey":"JiBa7tsVjJxH1s/WOdSDsGFpJ4xorALBZfHX1rPGtI0=","secondaryKey":"HH/9rpib42v1SwTURYc6mnS2fs3f+mU48ijF+oBgCKY=","rights":"RegistryWrite"}]}' + headers: + cache-control: + - no-cache + content-length: + - '905' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source iothub create + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name --name --consumer-group-name --key-name --shared-access-key + --event-source-resource-id --timestamp-property-name + User-Agent: + - python/3.8.1 (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/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:20 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: 'b''{"location": "westus", "kind": "Microsoft.IoTHub", "properties": {"timestampPropertyName": + "DeviceId", "eventSourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003", + "iotHubName": "cli-test-tsi-iothub000003", "consumerGroupName": "$Default", + "keyName": "iothubowner", "sharedAccessKey": "TDulTUXa7mEtEL0wtQM6C4yKUJNwW6EB49ZjRMTHwnI="}}''' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source iothub create + Connection: + - keep-alive + Content-Length: + - '503' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --consumer-group-name --key-name --shared-access-key + --event-source-resource-id --timestamp-property-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.IoTHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","iotHubName":"cli-test-tsi-iothub000003","consumerGroupName":"$Default","keyName":"iothubowner","creationTime":"Thu, + 23 Apr 2020 08:56:26 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '876' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:56:27 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1191' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"timestampPropertyName": "DeviceId1"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source iothub update + Connection: + - keep-alive + Content-Length: + - '54' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --timestamp-property-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.IoTHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","iotHubName":"cli-test-tsi-iothub000003","consumerGroupName":"$Default","keyName":"iothubowner","creationTime":"Thu, + 23 Apr 2020 08:56:26 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '877' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:56:31 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"localTimestamp": {"format": "Embedded"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source iothub update + Connection: + - keep-alive + Content-Length: + - '58' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --local-timestamp-format + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.IoTHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","iotHubName":"cli-test-tsi-iothub000003","consumerGroupName":"$Default","keyName":"iothubowner","creationTime":"Thu, + 23 Apr 2020 08:56:26 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '938' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:56:34 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1193' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (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: HEAD + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 08:56:35 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: '{"name": "cli-test-tsi-iothub000003"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + Content-Length: + - '36' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/checkNameAvailability?api-version=2019-07-01-preview + response: + body: + string: '{"nameAvailable":false,"reason":"AlreadyExists","message":"IotHub name + ''cli-test-tsi-iothub000003'' is not available"}' + headers: + cache-control: + - no-cache + content-length: + - '116' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:36 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.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/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003?api-version=2019-07-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","name":"cli-test-tsi-iothub000003","type":"Microsoft.Devices/IotHubs","location":"westus","tags":{},"subscriptionid":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","resourcegroup":"cli_test_timeseriesinsights000001","etag":"AAAAAA0HLQ8=","properties":{"locations":[{"location":"West + US","role":"primary"},{"location":"East US","role":"secondary"}],"state":"Active","provisioningState":"Succeeded","ipFilterRules":[],"hostName":"cli-test-tsi-iothub000003.azure-devices.net","eventHubEndpoints":{"events":{"retentionTimeInDays":1,"partitionCount":4,"partitionIds":["0","1","2","3"],"path":"cli-test-tsi-iothub000003","endpoint":"sb://iothub-ns-cli-test-t-3301249-4bb741b8fe.servicebus.windows.net/"}},"routing":{"endpoints":{"serviceBusQueues":[],"serviceBusTopics":[],"eventHubs":[],"storageContainers":[]},"routes":[],"fallbackRoute":{"name":"$fallback","source":"DeviceMessages","condition":"true","endpointNames":["events"],"isEnabled":true}},"storageEndpoints":{"$default":{"sasTtlAsIso8601":"PT1H","connectionString":"","containerName":""}},"messagingEndpoints":{"fileNotifications":{"lockDurationAsIso8601":"PT1M","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"enableFileUploadNotifications":false,"cloudToDevice":{"maxDeliveryCount":10,"defaultTtlAsIso8601":"PT1H","feedback":{"lockDurationAsIso8601":"PT5S","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"features":"None"},"sku":{"name":"S1","tier":"Standard","capacity":1}}' + headers: + cache-control: + - no-cache + content-length: + - '1673' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:37 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003/listkeys?api-version=2019-07-01-preview + response: + body: + string: '{"value":[{"keyName":"iothubowner","primaryKey":"TDulTUXa7mEtEL0wtQM6C4yKUJNwW6EB49ZjRMTHwnI=","secondaryKey":"PeBGGf/IiiQo23hAxASRJlJqQrqyJ1PXdpfdF+MMU9M=","rights":"RegistryWrite, + ServiceConnect, DeviceConnect"},{"keyName":"service","primaryKey":"dQLAouEOJHUz4KBBkmvhaWFEIkWZ4COrAR+NfVtD96U=","secondaryKey":"3JYW+ZuAtVmilPaqd/Vt/mTPW7yJatMpOidVbVuGWLk=","rights":"ServiceConnect"},{"keyName":"device","primaryKey":"qlEod871Un0IBPBYkljGGFCmSN/ntvc64tRyoVpdaIY=","secondaryKey":"c3BEZTAUoS8cypUbUSUjxCSFtJ9+lGdHqw1hNsZCAqs=","rights":"DeviceConnect"},{"keyName":"registryRead","primaryKey":"GywrLHwOJeigEL5K2h+2bZSk81NG8CsyigNy7durJzs=","secondaryKey":"eRPuE4ZLe4f27RgmKgaBcvP88rk2ipGw9Oohb4B4Ntk=","rights":"RegistryRead"},{"keyName":"registryReadWrite","primaryKey":"JiBa7tsVjJxH1s/WOdSDsGFpJ4xorALBZfHX1rPGtI0=","secondaryKey":"HH/9rpib42v1SwTURYc6mnS2fs3f+mU48ijF+oBgCKY=","rights":"RegistryWrite"}]}' + headers: + cache-control: + - no-cache + content-length: + - '905' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:37 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "tags": {}, "etag": "AAAAAA0HLQ8=", "properties": + {"authorizationPolicies": [{"keyName": "service", "primaryKey": "dQLAouEOJHUz4KBBkmvhaWFEIkWZ4COrAR+NfVtD96U=", + "secondaryKey": "3JYW+ZuAtVmilPaqd/Vt/mTPW7yJatMpOidVbVuGWLk=", "rights": "ServiceConnect"}, + {"keyName": "device", "primaryKey": "qlEod871Un0IBPBYkljGGFCmSN/ntvc64tRyoVpdaIY=", + "secondaryKey": "c3BEZTAUoS8cypUbUSUjxCSFtJ9+lGdHqw1hNsZCAqs=", "rights": "DeviceConnect"}, + {"keyName": "registryRead", "primaryKey": "GywrLHwOJeigEL5K2h+2bZSk81NG8CsyigNy7durJzs=", + "secondaryKey": "eRPuE4ZLe4f27RgmKgaBcvP88rk2ipGw9Oohb4B4Ntk=", "rights": "RegistryRead"}, + {"keyName": "registryReadWrite", "primaryKey": "JiBa7tsVjJxH1s/WOdSDsGFpJ4xorALBZfHX1rPGtI0=", + "secondaryKey": "HH/9rpib42v1SwTURYc6mnS2fs3f+mU48ijF+oBgCKY=", "rights": "RegistryWrite"}, + {"keyName": "iothubowner", "primaryKey": "T1syLFUsG1NZG2hgVjkQZ28aLC4mbQ91HGpkdlRxeVc=", + "secondaryKey": "PeBGGf/IiiQo23hAxASRJlJqQrqyJ1PXdpfdF+MMU9M=", "rights": "RegistryWrite, + ServiceConnect, DeviceConnect"}], "ipFilterRules": [], "eventHubEndpoints": + {"events": {"retentionTimeInDays": 1, "partitionCount": 4}}, "routing": {"endpoints": + {"serviceBusQueues": [], "serviceBusTopics": [], "eventHubs": [], "storageContainers": + []}, "routes": [], "fallbackRoute": {"name": "$fallback", "source": "DeviceMessages", + "condition": "true", "endpointNames": ["events"], "isEnabled": true}}, "storageEndpoints": + {"$default": {"sasTtlAsIso8601": "PT1H", "connectionString": "", "containerName": + ""}}, "messagingEndpoints": {"fileNotifications": {"lockDurationAsIso8601": + "PT1M", "ttlAsIso8601": "PT1H", "maxDeliveryCount": 10}}, "enableFileUploadNotifications": + false, "cloudToDevice": {"maxDeliveryCount": 10, "defaultTtlAsIso8601": "PT1H", + "feedback": {"lockDurationAsIso8601": "PT5S", "ttlAsIso8601": "PT1H", "maxDeliveryCount": + 10}}, "features": "None"}, "sku": {"name": "S1", "capacity": 1}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + Content-Length: + - '1910' + Content-Type: + - application/json; charset=utf-8 + If-Match: + - '{''IF-MATCH'': ''AAAAAA0HLQ8=''}' + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.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/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003?api-version=2019-07-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","name":"cli-test-tsi-iothub000003","type":"Microsoft.Devices/IotHubs","location":"westus","tags":{},"subscriptionid":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","resourcegroup":"cli_test_timeseriesinsights000001","etag":"AAAAAA0HLQ8=","properties":{"operationsMonitoringProperties":{"events":{"None":"None","Connections":"None","DeviceTelemetry":"None","C2DCommands":"None","DeviceIdentityOperations":"None","FileUploadOperations":"None","Routes":"None"}},"provisioningState":"Accepted","authorizationPolicies":[{"keyName":"service","primaryKey":"dQLAouEOJHUz4KBBkmvhaWFEIkWZ4COrAR+NfVtD96U=","secondaryKey":"3JYW+ZuAtVmilPaqd/Vt/mTPW7yJatMpOidVbVuGWLk=","rights":"ServiceConnect"},{"keyName":"device","primaryKey":"qlEod871Un0IBPBYkljGGFCmSN/ntvc64tRyoVpdaIY=","secondaryKey":"c3BEZTAUoS8cypUbUSUjxCSFtJ9+lGdHqw1hNsZCAqs=","rights":"DeviceConnect"},{"keyName":"registryRead","primaryKey":"GywrLHwOJeigEL5K2h+2bZSk81NG8CsyigNy7durJzs=","secondaryKey":"eRPuE4ZLe4f27RgmKgaBcvP88rk2ipGw9Oohb4B4Ntk=","rights":"RegistryRead"},{"keyName":"registryReadWrite","primaryKey":"JiBa7tsVjJxH1s/WOdSDsGFpJ4xorALBZfHX1rPGtI0=","secondaryKey":"HH/9rpib42v1SwTURYc6mnS2fs3f+mU48ijF+oBgCKY=","rights":"RegistryWrite"},{"keyName":"iothubowner","primaryKey":"T1syLFUsG1NZG2hgVjkQZ28aLC4mbQ91HGpkdlRxeVc=","secondaryKey":"PeBGGf/IiiQo23hAxASRJlJqQrqyJ1PXdpfdF+MMU9M=","rights":"RegistryWrite, + ServiceConnect, DeviceConnect"}],"ipFilterRules":[],"eventHubEndpoints":{"events":{"retentionTimeInDays":1,"partitionCount":4},"operationsMonitoringEvents":{"retentionTimeInDays":1,"partitionCount":4,"partitionIds":["0","1","2","3"],"path":"cli-test-tsi-iothub000003-operationmonitoring","endpoint":"sb://iothub-ns-cli-test-t-3301249-4bb741b8fe.servicebus.windows.net/","internalAuthorizationPolicies":[{"KeyName":"scaleunitsend-14987bca-fb0e-40ec-bf21-84cfca6aa1b0-iothub","PrimaryKey":"wbPTKsgPj/vxNaqtZOPayqvOr0ohIgfTgN66If90t/M=","SecondaryKey":"FmtNTVqiTKH75wu2b1MTYjHQjjRANjvrcHmUw25bF+M=","ClaimType":"SharedAccessKey","ClaimValue":"None","Rights":["Send"],"CreatedTime":"Thu, + 23 Apr 2020 08:56:08 GMT","ModifiedTime":"Thu, 23 Apr 2020 08:56:08 GMT"},{"KeyName":"owner-fb1dd4e5-3660-46a9-a75b-64426209f281-iothub","PrimaryKey":"srCLf/teUitR2iNzCFFE23+ueEIWdVmwjpFRHbnyZNY=","SecondaryKey":"69u1coU+p9T7PpzyciVJUIy6u2fbPC9iTciu6kVdMNk=","ClaimType":"SharedAccessKey","ClaimValue":"None","Rights":["Listen","Manage","Send"],"CreatedTime":"Thu, + 23 Apr 2020 08:56:08 GMT","ModifiedTime":"Thu, 23 Apr 2020 08:56:08 GMT"}],"authorizationPolicies":[{"KeyName":"iothubowner","PrimaryKey":"TDulTUXa7mEtEL0wtQM6C4yKUJNwW6EB49ZjRMTHwnI=","SecondaryKey":"PeBGGf/IiiQo23hAxASRJlJqQrqyJ1PXdpfdF+MMU9M=","ClaimType":"SharedAccessKey","ClaimValue":"None","Rights":["Listen"],"CreatedTime":"Thu, + 23 Apr 2020 08:56:08 GMT","ModifiedTime":"Thu, 23 Apr 2020 08:56:08 GMT"},{"KeyName":"service","PrimaryKey":"dQLAouEOJHUz4KBBkmvhaWFEIkWZ4COrAR+NfVtD96U=","SecondaryKey":"3JYW+ZuAtVmilPaqd/Vt/mTPW7yJatMpOidVbVuGWLk=","ClaimType":"SharedAccessKey","ClaimValue":"None","Rights":["Listen"],"CreatedTime":"Thu, + 23 Apr 2020 08:56:08 GMT","ModifiedTime":"Thu, 23 Apr 2020 08:56:08 GMT"}]}},"routing":{"endpoints":{"serviceBusQueues":[],"serviceBusTopics":[],"eventHubs":[],"storageContainers":[]},"routes":[],"fallbackRoute":{"name":"$fallback","source":"DeviceMessages","condition":"true","endpointNames":["events"],"isEnabled":true}},"storageEndpoints":{"$default":{"sasTtlAsIso8601":"PT1H","connectionString":"","containerName":""}},"messagingEndpoints":{"fileNotifications":{"lockDurationAsIso8601":"PT1M","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"enableFileUploadNotifications":false,"cloudToDevice":{"maxDeliveryCount":10,"defaultTtlAsIso8601":"PT1H","feedback":{"lockDurationAsIso8601":"PT5S","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"features":"None"},"sku":{"name":"S1","tier":"Standard","capacity":1}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/operationResults/b3NfaWhfNWIzODBjNTctYjIzNy00N2EwLTg3NmYtMGZlMmEzN2E4OGJl?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo + cache-control: + - no-cache + content-length: + - '4122' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:56:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '4999' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Devices/operationResults/b3NfaWhfNWIzODBjNTctYjIzNy00N2EwLTg3NmYtMGZlMmEzN2E4OGJl?api-version=2019-07-01-preview&operationSource=os_ih&asyncinfo + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:57:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003?api-version=2019-07-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","name":"cli-test-tsi-iothub000003","type":"Microsoft.Devices/IotHubs","location":"westus","tags":{},"subscriptionid":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","resourcegroup":"cli_test_timeseriesinsights000001","etag":"AAAAAA0HLgM=","properties":{"locations":[{"location":"West + US","role":"primary"},{"location":"East US","role":"secondary"}],"state":"Active","provisioningState":"Succeeded","ipFilterRules":[],"hostName":"cli-test-tsi-iothub000003.azure-devices.net","eventHubEndpoints":{"events":{"retentionTimeInDays":1,"partitionCount":4,"partitionIds":["0","1","2","3"],"path":"cli-test-tsi-iothub000003","endpoint":"sb://iothub-ns-cli-test-t-3301249-4bb741b8fe.servicebus.windows.net/"}},"routing":{"endpoints":{"serviceBusQueues":[],"serviceBusTopics":[],"eventHubs":[],"storageContainers":[]},"routes":[],"fallbackRoute":{"name":"$fallback","source":"DeviceMessages","condition":"true","endpointNames":["events"],"isEnabled":true}},"storageEndpoints":{"$default":{"sasTtlAsIso8601":"PT1H","connectionString":"","containerName":""}},"messagingEndpoints":{"fileNotifications":{"lockDurationAsIso8601":"PT1M","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"enableFileUploadNotifications":false,"cloudToDevice":{"maxDeliveryCount":10,"defaultTtlAsIso8601":"PT1H","feedback":{"lockDurationAsIso8601":"PT5S","ttlAsIso8601":"PT1H","maxDeliveryCount":10}},"features":"None"},"sku":{"name":"S1","tier":"Standard","capacity":1}}' + headers: + cache-control: + - no-cache + content-length: + - '1673' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:57:16 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - iot hub policy renew-key + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --hub-name -n --renew-key --query --output + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-iothub/0.11.0 Azure-SDK-For-Python AZURECLI/2.4.0 + accept-language: + - en-US + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003/IotHubKeys/iothubowner/listkeys?api-version=2019-07-01-preview + response: + body: + string: '{"keyName":"iothubowner","primaryKey":"T1syLFUsG1NZG2hgVjkQZ28aLC4mbQ91HGpkdlRxeVc=","secondaryKey":"PeBGGf/IiiQo23hAxASRJlJqQrqyJ1PXdpfdF+MMU9M=","rights":"RegistryWrite, + ServiceConnect, DeviceConnect"}' + headers: + cache-control: + - no-cache + content-length: + - '203' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:57:17 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"sharedAccessKey": "T1syLFUsG1NZG2hgVjkQZ28aLC4mbQ91HGpkdlRxeVc="}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source iothub update + Connection: + - keep-alive + Content-Length: + - '83' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --shared-access-key + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.IoTHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","iotHubName":"cli-test-tsi-iothub000003","consumerGroupName":"$Default","keyName":"iothubowner","creationTime":"Thu, + 23 Apr 2020 08:56:26 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '938' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:57:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1190' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source list + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventSources?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"kind":"Microsoft.IoTHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","iotHubName":"cli-test-tsi-iothub000003","consumerGroupName":"$Default","keyName":"iothubowner","creationTime":"Thu, + 23 Apr 2020 08:56:26 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}]}' + headers: + cache-control: + - no-cache + content-length: + - '950' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:57:22 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source show + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '{"kind":"Microsoft.IoTHub","location":"westus","tags":null,"properties":{"timestampPropertyName":"DeviceId1","eventSourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.Devices/IotHubs/cli-test-tsi-iothub000003","iotHubName":"cli-test-tsi-iothub000003","consumerGroupName":"$Default","keyName":"iothubowner","creationTime":"Thu, + 23 Apr 2020 08:56:26 GMT","provisioningState":"Succeeded","localTimestamp":{"format":"Embedded","timezoneOffset":null}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventsources/cli-test-tsi-es000002","name":"cli-test-tsi-es000002","type":"Microsoft.TimeSeriesInsights/Environments/EventSources"}' + headers: + cache-control: + - no-cache + content-length: + - '938' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:57:26 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights event-source delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --environment-name -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000004/eventSources/cli-test-tsi-es000002?api-version=2018-08-15-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 08:57:31 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 200 + message: OK +version: 1 diff --git a/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_reference_data_set.yaml b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_reference_data_set.yaml new file mode 100644 index 00000000000..f811211ad54 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/recordings/test_timeseriesinsights_reference_data_set.yaml @@ -0,0 +1,506 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (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/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:52: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", "sku": {"name": "S1", "capacity": 1}, "kind": "Standard", + "properties": {"dataRetentionTime": "P31D", "storageLimitExceededBehavior": + "PauseIngress", "partitionKeyProperties": [{"name": "DeviceId1", "type": "String"}]}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + Content-Length: + - '242' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"2020-04-23T08:52:45+00:00","provisioningState":"Accepted","dataAccessId":"19d80b62-5ad8-413d-b006-9a81ba3dd670","dataAccessFqdn":"19d80b62-5ad8-413d-b006-9a81ba3dd670.env.timeseries.azure.com","requestApiVersion":"2018-08-15-preview"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '798' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:52:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1192' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:45 GMT","provisioningState":"Creating","requestApiVersion":"2018-08-15-preview","dataAccessId":"19d80b62-5ad8-413d-b006-9a81ba3dd670","dataAccessFqdn":"19d80b62-5ad8-413d-b006-9a81ba3dd670.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '802' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:53:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights environment standard create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --sku-name --sku-capacity --data-retention-time --partition-key-properties + --storage-limit-exceeded-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.0 Azure-SDK-For-Python AZURECLI/2.4.0 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003?api-version=2018-08-15-preview + response: + body: + string: '{"sku":{"name":"S1","capacity":1},"kind":"Standard","location":"westus","tags":null,"properties":{"dataRetentionTime":"P31D","storageLimitExceededBehavior":"PauseIngress","partitionKeyProperties":[{"name":"DeviceId1","type":"String"}],"creationTime":"Thu, + 23 Apr 2020 08:52:45 GMT","provisioningState":"Succeeded","requestApiVersion":"2018-08-15-preview","dataAccessId":"19d80b62-5ad8-413d-b006-9a81ba3dd670","dataAccessFqdn":"19d80b62-5ad8-413d-b006-9a81ba3dd670.env.timeseries.azure.com"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003","name":"cli-test-tsi-env000003","type":"Microsoft.TimeSeriesInsights/Environments"}' + headers: + cache-control: + - no-cache + content-length: + - '803' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:01 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights reference-data-set create + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name --name --key-properties --data-string-comparison-behavior + User-Agent: + - python/3.8.1 (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/resourcegroups/cli_test_timeseriesinsights000001?api-version=2019-07-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001","name":"cli_test_timeseriesinsights000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2020-04-23T08:52:27Z","StorageType":"Standard_LRS","type":"test"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '471' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 23 Apr 2020 08:54:03 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "westus", "properties": {"keyProperties": [{"name": "DeviceId1", + "type": "String"}, {"name": "DeviceFloor", "type": "Double"}], "dataStringComparisonBehavior": + "Ordinal"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights reference-data-set create + Connection: + - keep-alive + Content-Length: + - '184' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --key-properties --data-string-comparison-behavior + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002?api-version=2018-08-15-preview + response: + body: + string: '{"location":"westus","tags":null,"properties":{"keyProperties":[{"name":"DeviceId1","type":"String"},{"name":"DeviceFloor","type":"Double"}],"dataStringComparisonBehavior":"Ordinal","creationTime":"Thu, + 23 Apr 2020 08:54:10 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002","name":"clitesttsirds000002","type":"Microsoft.TimeSeriesInsights/Environments/ReferenceDataSets"}' + headers: + cache-control: + - no-cache + content-length: + - '635' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:11 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK +- request: + body: '{"tags": {"mykey": "myvalue"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights reference-data-set update + Connection: + - keep-alive + Content-Length: + - '30' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - -g --environment-name --name --tags + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002?api-version=2018-08-15-preview + response: + body: + string: '{"location":"westus","tags":{"mykey":"myvalue"},"properties":{"keyProperties":[{"name":"DeviceId1","type":"String"},{"name":"DeviceFloor","type":"Double"}],"dataStringComparisonBehavior":"Ordinal","creationTime":"Thu, + 23 Apr 2020 08:54:10 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002","name":"clitesttsirds000002","type":"Microsoft.TimeSeriesInsights/Environments/ReferenceDataSets"}' + headers: + cache-control: + - no-cache + content-length: + - '650' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1195' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights reference-data-set list + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets?api-version=2018-08-15-preview + response: + body: + string: '{"value":[{"location":"westus","tags":{"mykey":"myvalue"},"properties":{"keyProperties":[{"name":"DeviceId1","type":"String"},{"name":"DeviceFloor","type":"Double"}],"dataStringComparisonBehavior":"Ordinal","creationTime":"Thu, + 23 Apr 2020 08:54:10 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002","name":"clitesttsirds000002","type":"Microsoft.TimeSeriesInsights/Environments/ReferenceDataSets"}]}' + headers: + cache-control: + - no-cache + content-length: + - '662' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:18 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights reference-data-set show + Connection: + - keep-alive + ParameterSetName: + - -g --environment-name -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002?api-version=2018-08-15-preview + response: + body: + string: '{"location":"westus","tags":{"mykey":"myvalue"},"properties":{"keyProperties":[{"name":"DeviceId1","type":"String"},{"name":"DeviceFloor","type":"Double"}],"dataStringComparisonBehavior":"Ordinal","creationTime":"Thu, + 23 Apr 2020 08:54:10 GMT","provisioningState":"Succeeded"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002","name":"clitesttsirds000002","type":"Microsoft.TimeSeriesInsights/Environments/ReferenceDataSets"}' + headers: + cache-control: + - no-cache + content-length: + - '650' + content-type: + - application/json + date: + - Thu, 23 Apr 2020 08:54:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - timeseriesinsights reference-data-set delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --environment-name -n + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.3 + azure-mgmt-timeseriesinsights/0.2.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/cli_test_timeseriesinsights000001/providers/Microsoft.TimeSeriesInsights/environments/cli-test-tsi-env000003/referenceDataSets/clitesttsirds000002?api-version=2018-08-15-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 23 Apr 2020 08:54:28 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +version: 1 diff --git a/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/test_timeseriesinsights_scenario.py b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/test_timeseriesinsights_scenario.py new file mode 100644 index 00000000000..49c0b014f12 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/tests/latest/test_timeseriesinsights_scenario.py @@ -0,0 +1,263 @@ +# -------------------------------------------------------------------------------------------- +# 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 time +from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class TimeSeriesInsightsClientScenarioTest(ScenarioTest): + + def _create_timeseriesinsights_environment(self): + self.kwargs.update({ + 'env': self.create_random_name('cli-test-tsi-env', 24), + }) + # Create an environment with the name of {env}. Similar to + # https://github.com/Azure/azure-cli/blob/31a9724478c67751ae0bee6cc0d9b75b763df17c/src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/test_keyvault_commands.py#L34 + return self.cmd('az timeseriesinsights environment standard create ' + '--resource-group {rg} ' + '--name {env} ' + '--sku-name S1 ' + '--sku-capacity 1 ' + '--data-retention-time 31 ' + '--partition-key-properties DeviceId1 ' + '--storage-limit-exceeded-behavior PauseIngress') + + @ResourceGroupPreparer(name_prefix='cli_test_timeseriesinsights') + def test_timeseriesinsights_environment_standard(self, resource_group): + self.kwargs.update({ + 'env': self.create_random_name('cli-test-tsi-env', 24), + }) + + # Test environment standard create + self.cmd('az timeseriesinsights environment standard create ' + '--resource-group {rg} ' + '--name {env} ' + '--sku-name S1 ' + '--sku-capacity 1 ' + '--data-retention-time 7 ' + '--partition-key-properties DeviceId1 ' + '--storage-limit-exceeded-behavior PauseIngress', + checks=[self.check('name', '{env}')]) + + self.cmd('az timeseriesinsights environment standard update --resource-group {rg} --name {env} --sku-name S1 --sku-capacity 2', + checks=[self.check('sku.capacity', '2')]) + + self.cmd('az timeseriesinsights environment standard update --resource-group {rg} --name {env} --data-retention-time 8', + checks=[self.check('dataRetentionTime', '8 days, 0:00:00')]) + + self.cmd('az timeseriesinsights environment standard update --resource-group {rg} --name {env} --storage-limit-exceeded-behavior PurgeOldData', + checks=[self.check('storageLimitExceededBehavior', 'PurgeOldData')]) + + self.cmd('az timeseriesinsights environment show ' + '--resource-group {rg} ' + '--name {env}', + checks=[self.check('name', '{env}')]) + + self.cmd('az timeseriesinsights environment list ' + '--resource-group {rg}', + checks=[self.check('length(@)', 1)]) + + self.cmd('az timeseriesinsights environment list', + checks=[self.check("length([?name=='{env}'])", 1)]) + + self.cmd('az timeseriesinsights environment delete ' + '--resource-group {rg} ' + '--name {env} --yes', + checks=[]) + + self.cmd('az timeseriesinsights environment list ' + '--resource-group {rg}', + checks=[self.check('length(@)', 0)]) + + @ResourceGroupPreparer(name_prefix='cli_test_timeseriesinsights') + @StorageAccountPreparer() + def test_timeseriesinsights_environment_longterm(self, resource_group, storage_account): + + self.kwargs.update({ + 'env': self.create_random_name('cli-test-tsi-env', 24), + }) + + # Test environment longterm create + key = self.cmd('az storage account keys list -g {rg} -n {sa} --query "[0].value" --output tsv').output + + self.cmd('az timeseriesinsights environment longterm create ' + '--resource-group {rg} ' + '--name {env} ' + '--sku-name L1 ' + '--sku-capacity 1 ' + '--data-retention 7 ' + '--time-series-id-properties DeviceId1 ' + '--storage-account-name {sa} ' + '--storage-management-key ' + key, + checks=[self.check('name', '{env}'), + self.check('timeSeriesIdProperties[0].name', 'DeviceId1')]) + + self.cmd('az timeseriesinsights environment longterm update --resource-group {rg} --name {env} --data-retention 8', + checks=[self.check('dataRetention', '8 days, 0:00:00')]) + + time.sleep(60) + key = self.cmd('az storage account keys renew -g {rg} -n {sa} --key primary --query "[0].value" --output tsv').output + time.sleep(15) + self.cmd('az timeseriesinsights environment longterm update --resource-group {rg} --name {env} --storage-management-key ' + key, + checks=[]) + + @ResourceGroupPreparer(name_prefix='cli_test_timeseriesinsights') + def test_timeseriesinsights_event_source_eventhub(self, resource_group): + self.kwargs.update({ + 'es': self.create_random_name('cli-test-tsi-es', 24), # time series insights event source + 'ehns': self.create_random_name('cli-test-tsi-ehns', 24), # event hub namespace + 'eh': self.create_random_name('cli-test-tsi-eh', 24), # event hub + 'loc': 'westus' + }) + + self._create_timeseriesinsights_environment() + + # Create + + # Prepare the event hub + self.cmd('az eventhubs namespace create -g {rg} -n {ehns}') + result = self.cmd('az eventhubs eventhub create -g {rg} -n {eh} --namespace-name {ehns}').get_output_in_json() + self.kwargs["es_resource_id"] = result["id"] + result = self.cmd('az eventhubs namespace authorization-rule keys list -g {rg} --namespace-name {ehns} -n RootManageSharedAccessKey').get_output_in_json() + self.kwargs["shared_access_key"] = result["primaryKey"] + + self.cmd('az timeseriesinsights event-source eventhub create -g {rg} --environment-name {env} --name {es} ' + '--key-name RootManageSharedAccessKey ' + '--shared-access-key {shared_access_key} ' + '--event-source-resource-id {es_resource_id} ' + '--consumer-group-name $Default --timestamp-property-name DeviceId') + + self.cmd('az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} --name {es} ' + '--timestamp-property-name DeviceId1') + + # Currently only Embedded is supported + self.cmd('az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} --name {es} ' + '--local-timestamp-format Embedded') + + # Iana, TimeSpan + # self.cmd('az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} --name {es} ' + # '--local-timestamp-format Timespan --time-zone-offset-property-name Offset') + + # Renew a key + self.kwargs["shared_access_key"] = self.cmd('az eventhubs namespace authorization-rule keys renew -g {rg} --namespace-name {ehns} -n RootManageSharedAccessKey --key PrimaryKey --query primaryKey --output tsv').output + + self.cmd('az timeseriesinsights event-source eventhub update -g {rg} --environment-name {env} --name {es} --shared-access-key {shared_access_key}') + + # List + self.cmd('az timeseriesinsights event-source list -g {rg} --environment-name {env}', + checks=[self.check('length(@)', 1)]) + + # Show + self.cmd('az timeseriesinsights event-source show -g {rg} --environment-name {env} -n {es}') + + # Delete + self.cmd('az timeseriesinsights event-source delete -g {rg} --environment-name {env} -n {es} --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_timeseriesinsights') + def test_timeseriesinsights_event_source_iothub(self): + self.kwargs.update({ + 'es': self.create_random_name('cli-test-tsi-es', 24), # time series insights event source + 'iothub': self.create_random_name('cli-test-tsi-iothub', 24), # iot hub + 'loc': 'westus' + }) + + self._create_timeseriesinsights_environment() + + # Create + # Prepare the iot hub + result = self.cmd('az iot hub create -g {rg} -n {iothub}').get_output_in_json() + self.kwargs["es_resource_id"] = result["id"] + self.kwargs["key_name"] = "iothubowner" + self.kwargs["shared_access_key"] = self.cmd("az iot hub policy list -g {rg} --hub-name {iothub} --query \"[?keyName=='iothubowner']\".primaryKey --output tsv").output + + self.cmd('az timeseriesinsights event-source iothub create -g {rg} --environment-name {env} --name {es} ' + '--consumer-group-name $Default ' + '--key-name {key_name} --shared-access-key {shared_access_key} ' + '--event-source-resource-id {es_resource_id} --timestamp-property-name DeviceId') + + self.cmd('az timeseriesinsights event-source iothub update -g {rg} --environment-name {env} --name {es} ' + '--timestamp-property-name DeviceId1') + + # Currently only Embedded is supported + self.cmd('az timeseriesinsights event-source iothub update -g {rg} --environment-name {env} --name {es} ' + '--local-timestamp-format Embedded') + + # Iana, TimeSpan + # self.cmd('az timeseriesinsights event-source iothub update -g {rg} --environment-name {env} --name {es} ' + # '--local-timestamp-format Timespan --time-zone-offset-property-name Offset') + + self.kwargs["shared_access_key"] = self.cmd('az iot hub policy renew-key -g {rg} --hub-name {iothub} -n {key_name} --renew-key primary --query primaryKey --output tsv').output + + self.cmd('az timeseriesinsights event-source iothub update -g {rg} --environment-name {env} --name {es} ' + '--shared-access-key {shared_access_key}') + + # List + self.cmd('az timeseriesinsights event-source list -g {rg} --environment-name {env}', + checks=[self.check('length(@)', 1)]) + + # Show + self.cmd('az timeseriesinsights event-source show -g {rg} --environment-name {env} -n {es}') + + # Delete + self.cmd('az timeseriesinsights event-source delete -g {rg} --environment-name {env} -n {es} --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_timeseriesinsights') + def test_timeseriesinsights_reference_data_set(self): + self.kwargs.update({ + 'rds': self.create_random_name('clitesttsirds', 24), # time series insights event source + }) + + self._create_timeseriesinsights_environment() + + # Create + self.cmd('az timeseriesinsights reference-data-set create -g {rg} --environment-name {env} --name {rds} ' + '--key-properties DeviceId1 String DeviceFloor Double --data-string-comparison-behavior Ordinal') + + # Update + self.cmd('az timeseriesinsights reference-data-set update -g {rg} --environment-name {env} --name {rds} ' + '--tags mykey=myvalue') + + # List + self.cmd('az timeseriesinsights reference-data-set list -g {rg} --environment-name {env}', + checks=[self.check('length(@)', 1)]) + + # Show + self.cmd('az timeseriesinsights reference-data-set show -g {rg} --environment-name {env} -n {rds}') + + # Delete + self.cmd('az timeseriesinsights reference-data-set delete -g {rg} --environment-name {env} -n {rds} --yes') + + @ResourceGroupPreparer(name_prefix='cli_test_timeseriesinsights') + def test_timeseriesinsights_access_policy(self): + self.kwargs.update({ + }) + + self._create_timeseriesinsights_environment() + + # Create + self.cmd('az timeseriesinsights access-policy create -g {rg} --environment-name {env} --name ap1 --principal-object-id 001 --description "some description" --roles Contributor Reader', + checks=[]) + + # Update + self.cmd('az timeseriesinsights access-policy update -g {rg} --environment-name {env} --name ap1 --description "some description updated"', + checks=[]) + + self.cmd('az timeseriesinsights access-policy update -g {rg} --environment-name {env} --name ap1 --roles Contributor', + checks=[]) + + # Show + self.cmd('az timeseriesinsights access-policy show -g {rg} --environment-name {env} --name ap1', + checks=[]) + # List + self.cmd('az timeseriesinsights access-policy list -g {rg} --environment-name {env}', + checks=[self.check('length(@)', 1)]) + + # Delete + self.cmd('az timeseriesinsights access-policy delete -g {rg} --environment-name {env} --name ap1 --yes', + checks=[]) diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/__init__.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/__init__.py new file mode 100644 index 00000000000..0260537a02b --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/__init__.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/__init__.py new file mode 100644 index 00000000000..b0a15d3e7f0 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/__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 TimeSeriesInsightsClientConfiguration +from ._time_series_insights_client import TimeSeriesInsightsClient +__all__ = ['TimeSeriesInsightsClient', 'TimeSeriesInsightsClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/_configuration.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/_configuration.py new file mode 100644 index 00000000000..455a14ec7a5 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/_configuration.py @@ -0,0 +1,48 @@ +# 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 TimeSeriesInsightsClientConfiguration(AzureConfiguration): + """Configuration for TimeSeriesInsightsClient + 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: Azure Subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, 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 not base_url: + base_url = 'https://management.azure.com' + + super(TimeSeriesInsightsClientConfiguration, 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-timeseriesinsights/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/_time_series_insights_client.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/_time_series_insights_client.py new file mode 100644 index 00000000000..4eafa141d25 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/_time_series_insights_client.py @@ -0,0 +1,69 @@ +# 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 TimeSeriesInsightsClientConfiguration +from .operations import Operations +from .operations import EnvironmentsOperations +from .operations import EventSourcesOperations +from .operations import ReferenceDataSetsOperations +from .operations import AccessPoliciesOperations +from . import models + + +class TimeSeriesInsightsClient(SDKClient): + """Time Series Insights client + + :ivar config: Configuration for client. + :vartype config: TimeSeriesInsightsClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.timeseriesinsights.operations.Operations + :ivar environments: Environments operations + :vartype environments: azure.mgmt.timeseriesinsights.operations.EnvironmentsOperations + :ivar event_sources: EventSources operations + :vartype event_sources: azure.mgmt.timeseriesinsights.operations.EventSourcesOperations + :ivar reference_data_sets: ReferenceDataSets operations + :vartype reference_data_sets: azure.mgmt.timeseriesinsights.operations.ReferenceDataSetsOperations + :ivar access_policies: AccessPolicies operations + :vartype access_policies: azure.mgmt.timeseriesinsights.operations.AccessPoliciesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Azure Subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = TimeSeriesInsightsClientConfiguration(credentials, subscription_id, base_url) + super(TimeSeriesInsightsClient, 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 = '2018-08-15-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.environments = EnvironmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.event_sources = EventSourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.reference_data_sets = ReferenceDataSetsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.access_policies = AccessPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/__init__.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/__init__.py new file mode 100644 index 00000000000..5e36e3b855a --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/__init__.py @@ -0,0 +1,196 @@ +# 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 AccessPolicyCreateOrUpdateParameters + from ._models_py3 import AccessPolicyListResponse + from ._models_py3 import AccessPolicyResource + from ._models_py3 import AccessPolicyUpdateParameters + from ._models_py3 import AzureEventSourceProperties + from ._models_py3 import CreateOrUpdateTrackedResourceProperties + from ._models_py3 import EnvironmentCreateOrUpdateParameters + from ._models_py3 import EnvironmentListResponse + from ._models_py3 import EnvironmentResource + from ._models_py3 import EnvironmentResourceProperties + from ._models_py3 import EnvironmentStateDetails + from ._models_py3 import EnvironmentStatus + from ._models_py3 import EnvironmentUpdateParameters + from ._models_py3 import EventHubEventSourceCommonProperties + from ._models_py3 import EventHubEventSourceCreateOrUpdateParameters + from ._models_py3 import EventHubEventSourceResource + from ._models_py3 import EventHubEventSourceUpdateParameters + from ._models_py3 import EventSourceCommonProperties + from ._models_py3 import EventSourceCreateOrUpdateParameters + from ._models_py3 import EventSourceListResponse + from ._models_py3 import EventSourceMutableProperties + from ._models_py3 import EventSourceResource + from ._models_py3 import EventSourceUpdateParameters + from ._models_py3 import IngressEnvironmentStatus + from ._models_py3 import IoTHubEventSourceCommonProperties + from ._models_py3 import IoTHubEventSourceCreateOrUpdateParameters + from ._models_py3 import IoTHubEventSourceResource + from ._models_py3 import IoTHubEventSourceUpdateParameters + from ._models_py3 import LocalTimestamp + from ._models_py3 import LocalTimestampTimeZoneOffset + from ._models_py3 import LongTermEnvironmentCreateOrUpdateParameters + from ._models_py3 import LongTermEnvironmentResource + from ._models_py3 import LongTermEnvironmentUpdateParameters + from ._models_py3 import LongTermStorageConfigurationInput + from ._models_py3 import LongTermStorageConfigurationMutableProperties + from ._models_py3 import LongTermStorageConfigurationOutput + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import ReferenceDataSetCreateOrUpdateParameters + from ._models_py3 import ReferenceDataSetKeyProperty + from ._models_py3 import ReferenceDataSetListResponse + from ._models_py3 import ReferenceDataSetResource + from ._models_py3 import ReferenceDataSetUpdateParameters + from ._models_py3 import Resource + from ._models_py3 import ResourceProperties + from ._models_py3 import Sku + from ._models_py3 import StandardEnvironmentCreateOrUpdateParameters + from ._models_py3 import StandardEnvironmentResource + from ._models_py3 import StandardEnvironmentUpdateParameters + from ._models_py3 import TimeSeriesIdProperty + from ._models_py3 import TrackedResource + from ._models_py3 import WarmStorageEnvironmentStatus +except (SyntaxError, ImportError): + from ._models import AccessPolicyCreateOrUpdateParameters + from ._models import AccessPolicyListResponse + from ._models import AccessPolicyResource + from ._models import AccessPolicyUpdateParameters + from ._models import AzureEventSourceProperties + from ._models import CreateOrUpdateTrackedResourceProperties + from ._models import EnvironmentCreateOrUpdateParameters + from ._models import EnvironmentListResponse + from ._models import EnvironmentResource + from ._models import EnvironmentResourceProperties + from ._models import EnvironmentStateDetails + from ._models import EnvironmentStatus + from ._models import EnvironmentUpdateParameters + from ._models import EventHubEventSourceCommonProperties + from ._models import EventHubEventSourceCreateOrUpdateParameters + from ._models import EventHubEventSourceResource + from ._models import EventHubEventSourceUpdateParameters + from ._models import EventSourceCommonProperties + from ._models import EventSourceCreateOrUpdateParameters + from ._models import EventSourceListResponse + from ._models import EventSourceMutableProperties + from ._models import EventSourceResource + from ._models import EventSourceUpdateParameters + from ._models import IngressEnvironmentStatus + from ._models import IoTHubEventSourceCommonProperties + from ._models import IoTHubEventSourceCreateOrUpdateParameters + from ._models import IoTHubEventSourceResource + from ._models import IoTHubEventSourceUpdateParameters + from ._models import LocalTimestamp + from ._models import LocalTimestampTimeZoneOffset + from ._models import LongTermEnvironmentCreateOrUpdateParameters + from ._models import LongTermEnvironmentResource + from ._models import LongTermEnvironmentUpdateParameters + from ._models import LongTermStorageConfigurationInput + from ._models import LongTermStorageConfigurationMutableProperties + from ._models import LongTermStorageConfigurationOutput + from ._models import Operation + from ._models import OperationDisplay + from ._models import ReferenceDataSetCreateOrUpdateParameters + from ._models import ReferenceDataSetKeyProperty + from ._models import ReferenceDataSetListResponse + from ._models import ReferenceDataSetResource + from ._models import ReferenceDataSetUpdateParameters + from ._models import Resource + from ._models import ResourceProperties + from ._models import Sku + from ._models import StandardEnvironmentCreateOrUpdateParameters + from ._models import StandardEnvironmentResource + from ._models import StandardEnvironmentUpdateParameters + from ._models import TimeSeriesIdProperty + from ._models import TrackedResource + from ._models import WarmStorageEnvironmentStatus +from ._paged_models import OperationPaged +from ._time_series_insights_client_enums import ( + ProvisioningState, + SkuName, + StorageLimitExceededBehavior, + PropertyType, + IngressState, + WarmStoragePropertiesState, + LocalTimestampFormat, + ReferenceDataKeyPropertyType, + DataStringComparisonBehavior, + AccessPolicyRole, +) + +__all__ = [ + 'AccessPolicyCreateOrUpdateParameters', + 'AccessPolicyListResponse', + 'AccessPolicyResource', + 'AccessPolicyUpdateParameters', + 'AzureEventSourceProperties', + 'CreateOrUpdateTrackedResourceProperties', + 'EnvironmentCreateOrUpdateParameters', + 'EnvironmentListResponse', + 'EnvironmentResource', + 'EnvironmentResourceProperties', + 'EnvironmentStateDetails', + 'EnvironmentStatus', + 'EnvironmentUpdateParameters', + 'EventHubEventSourceCommonProperties', + 'EventHubEventSourceCreateOrUpdateParameters', + 'EventHubEventSourceResource', + 'EventHubEventSourceUpdateParameters', + 'EventSourceCommonProperties', + 'EventSourceCreateOrUpdateParameters', + 'EventSourceListResponse', + 'EventSourceMutableProperties', + 'EventSourceResource', + 'EventSourceUpdateParameters', + 'IngressEnvironmentStatus', + 'IoTHubEventSourceCommonProperties', + 'IoTHubEventSourceCreateOrUpdateParameters', + 'IoTHubEventSourceResource', + 'IoTHubEventSourceUpdateParameters', + 'LocalTimestamp', + 'LocalTimestampTimeZoneOffset', + 'LongTermEnvironmentCreateOrUpdateParameters', + 'LongTermEnvironmentResource', + 'LongTermEnvironmentUpdateParameters', + 'LongTermStorageConfigurationInput', + 'LongTermStorageConfigurationMutableProperties', + 'LongTermStorageConfigurationOutput', + 'Operation', + 'OperationDisplay', + 'ReferenceDataSetCreateOrUpdateParameters', + 'ReferenceDataSetKeyProperty', + 'ReferenceDataSetListResponse', + 'ReferenceDataSetResource', + 'ReferenceDataSetUpdateParameters', + 'Resource', + 'ResourceProperties', + 'Sku', + 'StandardEnvironmentCreateOrUpdateParameters', + 'StandardEnvironmentResource', + 'StandardEnvironmentUpdateParameters', + 'TimeSeriesIdProperty', + 'TrackedResource', + 'WarmStorageEnvironmentStatus', + 'OperationPaged', + 'ProvisioningState', + 'SkuName', + 'StorageLimitExceededBehavior', + 'PropertyType', + 'IngressState', + 'WarmStoragePropertiesState', + 'LocalTimestampFormat', + 'ReferenceDataKeyPropertyType', + 'DataStringComparisonBehavior', + 'AccessPolicyRole', +] diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_models.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_models.py new file mode 100644 index 00000000000..2b70d8ff066 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_models.py @@ -0,0 +1,2241 @@ +# 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 AccessPolicyCreateOrUpdateParameters(Model): + """AccessPolicyCreateOrUpdateParameters. + + :param principal_object_id: The objectId of the principal in Azure Active + Directory. + :type principal_object_id: str + :param description: An description of the access policy. + :type description: str + :param roles: The list of roles the principal is assigned on the + environment. + :type roles: list[str or + ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + """ + + _attribute_map = { + 'principal_object_id': {'key': 'properties.principalObjectId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AccessPolicyCreateOrUpdateParameters, self).__init__(**kwargs) + self.principal_object_id = kwargs.get('principal_object_id', None) + self.description = kwargs.get('description', None) + self.roles = kwargs.get('roles', None) + + +class AccessPolicyListResponse(Model): + """The response of the List access policies operation. + + :param value: Result of the List access policies operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.AccessPolicyResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AccessPolicyResource]'}, + } + + def __init__(self, **kwargs): + super(AccessPolicyListResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class Resource(Model): + """Time Series Insights resource. + + 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 + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AccessPolicyResource(Resource): + """An access policy is used to grant users and applications access to the + environment. Roles are assigned to service principals in Azure Active + Directory. These roles define the actions the principal can perform through + the Time Series Insights data plane APIs. + + 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 principal_object_id: The objectId of the principal in Azure Active + Directory. + :type principal_object_id: str + :param description: An description of the access policy. + :type description: str + :param roles: The list of roles the principal is assigned on the + environment. + :type roles: list[str or + ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + """ + + _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'}, + 'principal_object_id': {'key': 'properties.principalObjectId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AccessPolicyResource, self).__init__(**kwargs) + self.principal_object_id = kwargs.get('principal_object_id', None) + self.description = kwargs.get('description', None) + self.roles = kwargs.get('roles', None) + + +class AccessPolicyUpdateParameters(Model): + """AccessPolicyUpdateParameters. + + :param description: An description of the access policy. + :type description: str + :param roles: The list of roles the principal is assigned on the + environment. + :type roles: list[str or + ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + """ + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AccessPolicyUpdateParameters, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.roles = kwargs.get('roles', None) + + +class ResourceProperties(Model): + """Properties that are common to all tracked resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + """ + + _validation = { + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ResourceProperties, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + + +class EventSourceCommonProperties(ResourceProperties): + """Properties of the event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventSourceCommonProperties, self).__init__(**kwargs) + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + + +class AzureEventSourceProperties(EventSourceCommonProperties): + """Properties of an event source that reads events from an event broker in + Azure. + + 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 provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEventSourceProperties, self).__init__(**kwargs) + self.event_source_resource_id = kwargs.get('event_source_resource_id', None) + + +class CloudError(Model): + """Contains information about an API error. + + :param error: Describes a particular API error with an error code and a + message. + :type error: ~azure.mgmt.timeseriesinsights.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """Describes a particular API error with an error code and a message. + + :param code: An error code that describes the error condition more + precisely than an HTTP status code. Can be used to programmatically handle + specific error cases. + :type code: str + :param message: A message that describes the error in detail and provides + debugging information. + :type message: str + :param target: The target of the particular error (for example, the name + of the property in error). + :type target: str + :param details: Contains nested errors that are related to this error. + :type details: list[~azure.mgmt.timeseriesinsights.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, **kwargs): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class CreateOrUpdateTrackedResourceProperties(Model): + """Properties required to create any resource tracked by Azure Resource + Manager. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'location': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(CreateOrUpdateTrackedResourceProperties, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class EnvironmentCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): + """Parameters supplied to the CreateOrUpdate Environment operation. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: StandardEnvironmentCreateOrUpdateParameters, + LongTermEnvironmentCreateOrUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Standard': 'StandardEnvironmentCreateOrUpdateParameters', 'LongTerm': 'LongTermEnvironmentCreateOrUpdateParameters'} + } + + def __init__(self, **kwargs): + super(EnvironmentCreateOrUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = None + self.kind = 'EnvironmentCreateOrUpdateParameters' + + +class EnvironmentListResponse(Model): + """The response of the List Environments operation. + + :param value: Result of the List Environments operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EnvironmentResource]'}, + } + + def __init__(self, **kwargs): + super(EnvironmentListResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class TrackedResource(Resource): + """Time Series Insights resource that is tracked by Azure Resource Manager. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class EnvironmentResource(TrackedResource): + """An environment is a set of time-series data available for query, and is the + top level Azure Time Series Insights resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: StandardEnvironmentResource, LongTermEnvironmentResource + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': 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}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Standard': 'StandardEnvironmentResource', 'LongTerm': 'LongTermEnvironmentResource'} + } + + def __init__(self, **kwargs): + super(EnvironmentResource, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = None + self.kind = 'EnvironmentResource' + + +class EnvironmentResourceProperties(ResourceProperties): + """Properties of the environment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :ivar data_access_id: An id used to access the environment data, e.g. to + query the environment's events or upload reference data for the + environment. + :vartype data_access_id: str + :ivar data_access_fqdn: The fully qualified domain name used to access the + environment data, e.g. to query the environment's events or upload + reference data for the environment. + :vartype data_access_fqdn: str + :param status: An object that represents the status of the environment, + and its internal state in the Time Series Insights service. + :type status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'data_access_id': {'readonly': True}, + 'data_access_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'data_access_id': {'key': 'dataAccessId', 'type': 'str'}, + 'data_access_fqdn': {'key': 'dataAccessFqdn', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'EnvironmentStatus'}, + } + + def __init__(self, **kwargs): + super(EnvironmentResourceProperties, self).__init__(**kwargs) + self.data_access_id = None + self.data_access_fqdn = None + self.status = kwargs.get('status', None) + + +class EnvironmentStateDetails(Model): + """An object that contains the details about an environment's state. + + :param code: Contains the code that represents the reason of an + environment being in a particular state. Can be used to programmatically + handle specific cases. + :type code: str + :param message: A message that describes the state in detail. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnvironmentStateDetails, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class EnvironmentStatus(Model): + """An object that represents the status of the environment, and its internal + state in the Time Series Insights service. + + :param ingress: An object that represents the status of ingress on an + environment. + :type ingress: + ~azure.mgmt.timeseriesinsights.models.IngressEnvironmentStatus + :param warm_storage: An object that represents the status of warm storage + on an environment. + :type warm_storage: + ~azure.mgmt.timeseriesinsights.models.WarmStorageEnvironmentStatus + """ + + _attribute_map = { + 'ingress': {'key': 'ingress', 'type': 'IngressEnvironmentStatus'}, + 'warm_storage': {'key': 'warmStorage', 'type': 'WarmStorageEnvironmentStatus'}, + } + + def __init__(self, **kwargs): + super(EnvironmentStatus, self).__init__(**kwargs) + self.ingress = kwargs.get('ingress', None) + self.warm_storage = kwargs.get('warm_storage', None) + + +class EnvironmentUpdateParameters(Model): + """Parameters supplied to the Update Environment operation. + + :param tags: Key-value pairs of additional properties for the environment. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(EnvironmentUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class EventHubEventSourceCommonProperties(AzureEventSourceProperties): + """Properties of the EventHub event source. + + 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 provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param service_bus_namespace: Required. The name of the service bus that + contains the event hub. + :type service_bus_namespace: str + :param event_hub_name: Required. The name of the event hub. + :type event_hub_name: str + :param consumer_group_name: Required. The name of the event hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the SAS key that grants the Time + Series Insights service access to the event hub. The shared access + policies for this key must grant 'Listen' permissions to the event hub. + :type key_name: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'service_bus_namespace': {'required': True}, + 'event_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, + 'service_bus_namespace': {'key': 'serviceBusNamespace', 'type': 'str'}, + 'event_hub_name': {'key': 'eventHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventHubEventSourceCommonProperties, self).__init__(**kwargs) + self.service_bus_namespace = kwargs.get('service_bus_namespace', None) + self.event_hub_name = kwargs.get('event_hub_name', None) + self.consumer_group_name = kwargs.get('consumer_group_name', None) + self.key_name = kwargs.get('key_name', None) + + +class EventSourceCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): + """Parameters supplied to the Create or Update Event Source operation. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EventHubEventSourceCreateOrUpdateParameters, + IoTHubEventSourceCreateOrUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'location': {'required': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Microsoft.EventHub': 'EventHubEventSourceCreateOrUpdateParameters', 'Microsoft.IoTHub': 'IoTHubEventSourceCreateOrUpdateParameters'} + } + + def __init__(self, **kwargs): + super(EventSourceCreateOrUpdateParameters, self).__init__(**kwargs) + self.kind = None + self.kind = 'EventSourceCreateOrUpdateParameters' + + +class EventHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Event Source operation for an + EventHub event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param service_bus_namespace: Required. The name of the service bus that + contains the event hub. + :type service_bus_namespace: str + :param event_hub_name: Required. The name of the event hub. + :type event_hub_name: str + :param consumer_group_name: Required. The name of the event hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the SAS key that grants the Time + Series Insights service access to the event hub. The shared access + policies for this key must grant 'Listen' permissions to the event hub. + :type key_name: str + :param shared_access_key: Required. The value of the shared access key + that grants the Time Series Insights service read access to the event hub. + This property is not shown in event source responses. + :type shared_access_key: str + """ + + _validation = { + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'service_bus_namespace': {'required': True}, + 'event_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + 'shared_access_key': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, + 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventHubEventSourceCreateOrUpdateParameters, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + self.event_source_resource_id = kwargs.get('event_source_resource_id', None) + self.service_bus_namespace = kwargs.get('service_bus_namespace', None) + self.event_hub_name = kwargs.get('event_hub_name', None) + self.consumer_group_name = kwargs.get('consumer_group_name', None) + self.key_name = kwargs.get('key_name', None) + self.shared_access_key = kwargs.get('shared_access_key', None) + self.kind = 'Microsoft.EventHub' + + +class EventSourceResource(TrackedResource): + """An environment receives data from one or more event sources. Each event + source has associated connection info that allows the Time Series Insights + ingress pipeline to connect to and pull data from the event source. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EventHubEventSourceResource, IoTHubEventSourceResource + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': 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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Microsoft.EventHub': 'EventHubEventSourceResource', 'Microsoft.IotHub': 'IoTHubEventSourceResource'} + } + + def __init__(self, **kwargs): + super(EventSourceResource, self).__init__(**kwargs) + self.kind = None + self.kind = 'EventSourceResource' + + +class EventHubEventSourceResource(EventSourceResource): + """An event source that receives its data from an Azure EventHub. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param service_bus_namespace: Required. The name of the service bus that + contains the event hub. + :type service_bus_namespace: str + :param event_hub_name: Required. The name of the event hub. + :type event_hub_name: str + :param consumer_group_name: Required. The name of the event hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the SAS key that grants the Time + Series Insights service access to the event hub. The shared access + policies for this key must grant 'Listen' permissions to the event hub. + :type key_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'service_bus_namespace': {'required': True}, + 'event_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': 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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, + 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventHubEventSourceResource, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + self.event_source_resource_id = kwargs.get('event_source_resource_id', None) + self.service_bus_namespace = kwargs.get('service_bus_namespace', None) + self.event_hub_name = kwargs.get('event_hub_name', None) + self.consumer_group_name = kwargs.get('consumer_group_name', None) + self.key_name = kwargs.get('key_name', None) + self.kind = 'Microsoft.EventHub' + + +class EventSourceUpdateParameters(Model): + """Parameters supplied to the Update Event Source operation. + + :param tags: Key-value pairs of additional properties for the event + source. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(EventSourceUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class EventHubEventSourceUpdateParameters(EventSourceUpdateParameters): + """Parameters supplied to the Update Event Source operation to update an + EventHub event source. + + :param tags: Key-value pairs of additional properties for the event + source. + :type tags: dict[str, str] + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :param shared_access_key: The value of the shared access key that grants + the Time Series Insights service read access to the event hub. This + property is not shown in event source responses. + :type shared_access_key: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventHubEventSourceUpdateParameters, self).__init__(**kwargs) + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + self.local_timestamp = kwargs.get('local_timestamp', None) + self.shared_access_key = kwargs.get('shared_access_key', None) + + +class EventSourceListResponse(Model): + """The response of the List EventSources operation. + + :param value: Result of the List EventSources operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.EventSourceResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EventSourceResource]'}, + } + + def __init__(self, **kwargs): + super(EventSourceListResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class EventSourceMutableProperties(Model): + """An object that represents a set of mutable event source resource + properties. + + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + """ + + _attribute_map = { + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, + } + + def __init__(self, **kwargs): + super(EventSourceMutableProperties, self).__init__(**kwargs) + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + self.local_timestamp = kwargs.get('local_timestamp', None) + + +class IngressEnvironmentStatus(Model): + """An object that represents the status of ingress on an environment. + + :param state: This string represents the state of ingress operations on an + environment. It can be "Disabled", "Ready", "Running", "Paused" or + "Unknown". Possible values include: 'Disabled', 'Ready', 'Running', + 'Paused', 'Unknown' + :type state: str or ~azure.mgmt.timeseriesinsights.models.IngressState + :param state_details: An object that contains the details about an + environment's state. + :type state_details: + ~azure.mgmt.timeseriesinsights.models.EnvironmentStateDetails + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'state_details': {'key': 'stateDetails', 'type': 'EnvironmentStateDetails'}, + } + + def __init__(self, **kwargs): + super(IngressEnvironmentStatus, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.state_details = kwargs.get('state_details', None) + + +class IoTHubEventSourceCommonProperties(AzureEventSourceProperties): + """Properties of the IoTHub event source. + + 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 provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param iot_hub_name: Required. The name of the iot hub. + :type iot_hub_name: str + :param consumer_group_name: Required. The name of the iot hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the Shared Access Policy key that + grants the Time Series Insights service access to the iot hub. This shared + access policy key must grant 'service connect' permissions to the iot hub. + :type key_name: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'iot_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, + 'iot_hub_name': {'key': 'iotHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IoTHubEventSourceCommonProperties, self).__init__(**kwargs) + self.iot_hub_name = kwargs.get('iot_hub_name', None) + self.consumer_group_name = kwargs.get('consumer_group_name', None) + self.key_name = kwargs.get('key_name', None) + + +class IoTHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Event Source operation for an + IoTHub event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param iot_hub_name: Required. The name of the iot hub. + :type iot_hub_name: str + :param consumer_group_name: Required. The name of the iot hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the Shared Access Policy key that + grants the Time Series Insights service access to the iot hub. This shared + access policy key must grant 'service connect' permissions to the iot hub. + :type key_name: str + :param shared_access_key: Required. The value of the Shared Access Policy + key that grants the Time Series Insights service read access to the iot + hub. This property is not shown in event source responses. + :type shared_access_key: str + """ + + _validation = { + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'iot_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + 'shared_access_key': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'iot_hub_name': {'key': 'properties.iotHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IoTHubEventSourceCreateOrUpdateParameters, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + self.event_source_resource_id = kwargs.get('event_source_resource_id', None) + self.iot_hub_name = kwargs.get('iot_hub_name', None) + self.consumer_group_name = kwargs.get('consumer_group_name', None) + self.key_name = kwargs.get('key_name', None) + self.shared_access_key = kwargs.get('shared_access_key', None) + self.kind = 'Microsoft.IoTHub' + + +class IoTHubEventSourceResource(EventSourceResource): + """An event source that receives its data from an Azure IoTHub. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param iot_hub_name: Required. The name of the iot hub. + :type iot_hub_name: str + :param consumer_group_name: Required. The name of the iot hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the Shared Access Policy key that + grants the Time Series Insights service access to the iot hub. This shared + access policy key must grant 'service connect' permissions to the iot hub. + :type key_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'iot_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': 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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'iot_hub_name': {'key': 'properties.iotHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IoTHubEventSourceResource, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + self.event_source_resource_id = kwargs.get('event_source_resource_id', None) + self.iot_hub_name = kwargs.get('iot_hub_name', None) + self.consumer_group_name = kwargs.get('consumer_group_name', None) + self.key_name = kwargs.get('key_name', None) + self.kind = 'Microsoft.IotHub' + + +class IoTHubEventSourceUpdateParameters(EventSourceUpdateParameters): + """Parameters supplied to the Update Event Source operation to update an + IoTHub event source. + + :param tags: Key-value pairs of additional properties for the event + source. + :type tags: dict[str, str] + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :param shared_access_key: The value of the shared access key that grants + the Time Series Insights service read access to the iot hub. This property + is not shown in event source responses. + :type shared_access_key: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IoTHubEventSourceUpdateParameters, self).__init__(**kwargs) + self.timestamp_property_name = kwargs.get('timestamp_property_name', None) + self.local_timestamp = kwargs.get('local_timestamp', None) + self.shared_access_key = kwargs.get('shared_access_key', None) + + +class LocalTimestamp(Model): + """An object that represents the local timestamp property. It contains the + format of local timestamp that needs to be used and the corresponding + timezone offset information. If a value isn't specified for localTimestamp, + or if null, then the local timestamp will not be ingressed with the events. + + :param format: An enum that represents the format of the local timestamp + property that needs to be set. Possible values include: 'Embedded', + 'Iana', 'TimeSpan' + :type format: str or + ~azure.mgmt.timeseriesinsights.models.LocalTimestampFormat + :param time_zone_offset: An object that represents the offset information + for the local timestamp format specified. Should not be specified for + LocalTimestampFormat - Embedded. + :type time_zone_offset: + ~azure.mgmt.timeseriesinsights.models.LocalTimestampTimeZoneOffset + """ + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'time_zone_offset': {'key': 'timeZoneOffset', 'type': 'LocalTimestampTimeZoneOffset'}, + } + + def __init__(self, **kwargs): + super(LocalTimestamp, self).__init__(**kwargs) + self.format = kwargs.get('format', None) + self.time_zone_offset = kwargs.get('time_zone_offset', None) + + +class LocalTimestampTimeZoneOffset(Model): + """An object that represents the offset information for the local timestamp + format specified. Should not be specified for LocalTimestampFormat - + Embedded. + + :param property_name: The event property that will be contain the offset + information to calculate the local timestamp. When the + LocalTimestampFormat is Iana, the property name will contain the name of + the column which contains IANA Timezone Name (eg: Americas/Los Angeles). + When LocalTimestampFormat is Timespan, it contains the name of property + which contains values representing the offset (eg: P1D or 1.00:00:00) + :type property_name: str + """ + + _attribute_map = { + 'property_name': {'key': 'propertyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LocalTimestampTimeZoneOffset, self).__init__(**kwargs) + self.property_name = kwargs.get('property_name', None) + + +class LongTermEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Environment operation for a + long-term environment. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :param time_series_id_properties: Required. The list of event properties + which will be used to define the environment's time series id. + :type time_series_id_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + :param storage_configuration: Required. The storage configuration provides + the connection details that allows the Time Series Insights service to + connect to the customer storage account that is used to store the + environment's data. + :type storage_configuration: + ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationInput + :param data_retention: Required. ISO8601 timespan specifying the number of + days the environment's events will be available for query from the warm + store. + :type data_retention: timedelta + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'time_series_id_properties': {'required': True}, + 'storage_configuration': {'required': True}, + 'data_retention': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, + 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationInput'}, + 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(LongTermEnvironmentCreateOrUpdateParameters, self).__init__(**kwargs) + self.time_series_id_properties = kwargs.get('time_series_id_properties', None) + self.storage_configuration = kwargs.get('storage_configuration', None) + self.data_retention = kwargs.get('data_retention', None) + self.kind = 'LongTerm' + + +class LongTermEnvironmentResource(EnvironmentResource): + """An environment is a set of time-series data available for query, and is the + top level Azure Time Series Insights resource. LongTerm environments do not + have set data retention limits. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :ivar data_access_id: An id used to access the environment data, e.g. to + query the environment's events or upload reference data for the + environment. + :vartype data_access_id: str + :ivar data_access_fqdn: The fully qualified domain name used to access the + environment data, e.g. to query the environment's events or upload + reference data for the environment. + :vartype data_access_fqdn: str + :param status: An object that represents the status of the environment, + and its internal state in the Time Series Insights service. + :type status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param time_series_id_properties: Required. The list of event properties + which will be used to define the environment's time series id. + :type time_series_id_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + :param storage_configuration: Required. The storage configuration provides + the connection details that allows the Time Series Insights service to + connect to the customer storage account that is used to store the + environment's data. + :type storage_configuration: + ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationOutput + :param data_retention: Required. ISO8601 timespan specifying the number of + days the environment's events will be available for query from the warm + store. + :type data_retention: timedelta + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'data_access_id': {'readonly': True}, + 'data_access_fqdn': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'time_series_id_properties': {'required': True}, + 'storage_configuration': {'required': True}, + 'data_retention': {'required': 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}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_access_id': {'key': 'properties.dataAccessId', 'type': 'str'}, + 'data_access_fqdn': {'key': 'properties.dataAccessFqdn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'EnvironmentStatus'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, + 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationOutput'}, + 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(LongTermEnvironmentResource, self).__init__(**kwargs) + self.data_access_id = None + self.data_access_fqdn = None + self.status = kwargs.get('status', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + self.time_series_id_properties = kwargs.get('time_series_id_properties', None) + self.storage_configuration = kwargs.get('storage_configuration', None) + self.data_retention = kwargs.get('data_retention', None) + self.kind = 'LongTerm' + + +class LongTermEnvironmentUpdateParameters(EnvironmentUpdateParameters): + """Parameters supplied to the Update Environment operation to update a + long-term environment. + + All required parameters must be populated in order to send to Azure. + + :param tags: Key-value pairs of additional properties for the environment. + :type tags: dict[str, str] + :param storage_configuration: The storage configuration provides the + connection details that allows the Time Series Insights service to connect + to the customer storage account that is used to store the environment's + data. + :type storage_configuration: + ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationMutableProperties + :param data_retention: Required. ISO8601 timespan specifying the number of + days the environment's events will be available for query from the warm + store. + :type data_retention: timedelta + """ + + _validation = { + 'data_retention': {'required': True}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationMutableProperties'}, + 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + } + + def __init__(self, **kwargs): + super(LongTermEnvironmentUpdateParameters, self).__init__(**kwargs) + self.storage_configuration = kwargs.get('storage_configuration', None) + self.data_retention = kwargs.get('data_retention', None) + + +class LongTermStorageConfigurationInput(Model): + """The storage configuration provides the connection details that allows the + Time Series Insights service to connect to the customer storage account + that is used to store the environment's data. + + All required parameters must be populated in order to send to Azure. + + :param account_name: Required. The name of the storage account that will + hold the environment's long term data. + :type account_name: str + :param management_key: Required. The value of the management key that + grants the Time Series Insights service write access to the storage + account. This property is not shown in environment responses. + :type management_key: str + """ + + _validation = { + 'account_name': {'required': True}, + 'management_key': {'required': True}, + } + + _attribute_map = { + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'management_key': {'key': 'managementKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LongTermStorageConfigurationInput, self).__init__(**kwargs) + self.account_name = kwargs.get('account_name', None) + self.management_key = kwargs.get('management_key', None) + + +class LongTermStorageConfigurationMutableProperties(Model): + """The storage configuration provides the connection details that allows the + Time Series Insights service to connect to the customer storage account + that is used to store the environment's data. + + All required parameters must be populated in order to send to Azure. + + :param management_key: Required. The value of the management key that + grants the Time Series Insights service write access to the storage + account. This property is not shown in environment responses. + :type management_key: str + """ + + _validation = { + 'management_key': {'required': True}, + } + + _attribute_map = { + 'management_key': {'key': 'managementKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LongTermStorageConfigurationMutableProperties, self).__init__(**kwargs) + self.management_key = kwargs.get('management_key', None) + + +class LongTermStorageConfigurationOutput(Model): + """The storage configuration provides the non-secret connection details about + the customer storage account that is used to store the environment's data. + + All required parameters must be populated in order to send to Azure. + + :param account_name: Required. The name of the storage account that will + hold the environment's long term data. + :type account_name: str + """ + + _validation = { + 'account_name': {'required': True}, + } + + _attribute_map = { + 'account_name': {'key': 'accountName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LongTermStorageConfigurationOutput, self).__init__(**kwargs) + self.account_name = kwargs.get('account_name', None) + + +class Operation(Model): + """A Time Series Insights REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation being performed on this particular + object. + :vartype name: str + :ivar display: Contains the localized display information for this + particular operation / action. + :vartype display: ~azure.mgmt.timeseriesinsights.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + + +class OperationDisplay(Model): + """Contains the localized display information for this particular operation / + action. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The localized friendly form of the resource provider name. + :vartype provider: str + :ivar resource: The localized friendly form of the resource type related + to this action/operation. + :vartype resource: str + :ivar operation: The localized friendly name for the operation. + :vartype operation: str + :ivar description: The localized friendly description for the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class ReferenceDataSetCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): + """ReferenceDataSetCreateOrUpdateParameters. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param key_properties: Required. The list of key properties for the + reference data set. + :type key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :param data_string_comparison_behavior: The reference data set key + comparison behavior can be set using this property. By default, the value + is 'Ordinal' - which means case sensitive key comparison will be performed + while joining reference data with events or while adding new reference + data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be + used. Possible values include: 'Ordinal', 'OrdinalIgnoreCase' + :type data_string_comparison_behavior: str or + ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior + """ + + _validation = { + 'location': {'required': True}, + 'key_properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'key_properties': {'key': 'properties.keyProperties', 'type': '[ReferenceDataSetKeyProperty]'}, + 'data_string_comparison_behavior': {'key': 'properties.dataStringComparisonBehavior', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ReferenceDataSetCreateOrUpdateParameters, self).__init__(**kwargs) + self.key_properties = kwargs.get('key_properties', None) + self.data_string_comparison_behavior = kwargs.get('data_string_comparison_behavior', None) + + +class ReferenceDataSetKeyProperty(Model): + """A key property for the reference data set. A reference data set can have + multiple key properties. + + :param name: The name of the key property. + :type name: str + :param type: The type of the key property. Possible values include: + 'String', 'Double', 'Bool', 'DateTime' + :type type: str or + ~azure.mgmt.timeseriesinsights.models.ReferenceDataKeyPropertyType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ReferenceDataSetKeyProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class ReferenceDataSetListResponse(Model): + """The response of the List Reference Data Sets operation. + + :param value: Result of the List Reference Data Sets operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ReferenceDataSetResource]'}, + } + + def __init__(self, **kwargs): + super(ReferenceDataSetListResponse, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ReferenceDataSetResource(TrackedResource): + """A reference data set provides metadata about the events in an environment. + Metadata in the reference data set will be joined with events as they are + read from event sources. The metadata that makes up the reference data set + is uploaded or modified through the Time Series Insights data plane APIs. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param key_properties: Required. The list of key properties for the + reference data set. + :type key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :param data_string_comparison_behavior: The reference data set key + comparison behavior can be set using this property. By default, the value + is 'Ordinal' - which means case sensitive key comparison will be performed + while joining reference data with events or while adding new reference + data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be + used. Possible values include: 'Ordinal', 'OrdinalIgnoreCase' + :type data_string_comparison_behavior: str or + ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'key_properties': {'required': True}, + 'creation_time': {'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}'}, + 'key_properties': {'key': 'properties.keyProperties', 'type': '[ReferenceDataSetKeyProperty]'}, + 'data_string_comparison_behavior': {'key': 'properties.dataStringComparisonBehavior', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ReferenceDataSetResource, self).__init__(**kwargs) + self.key_properties = kwargs.get('key_properties', None) + self.data_string_comparison_behavior = kwargs.get('data_string_comparison_behavior', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + + +class ReferenceDataSetUpdateParameters(Model): + """Parameters supplied to the Update Reference Data Set operation. + + :param tags: Key-value pairs of additional properties for the reference + data set. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ReferenceDataSetUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class Sku(Model): + """The sku determines the type of environment, either standard (S1 or S2) or + long-term (L1). For standard environments the sku determines the capacity + of the environment, the ingress rate, and the billing rate. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of this SKU. Possible values include: + 'S1', 'S2', 'P1', 'L1' + :type name: str or ~azure.mgmt.timeseriesinsights.models.SkuName + :param capacity: Required. The capacity of the sku. For standard + environments, this value can be changed to support scale out of + environments after they have been created. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + 'capacity': {'required': True, 'maximum': 10, 'minimum': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.capacity = kwargs.get('capacity', None) + + +class StandardEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Environment operation for a + standard environment. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :param data_retention_time: Required. ISO8601 timespan specifying the + minimum number of days the environment's events will be available for + query. + :type data_retention_time: timedelta + :param storage_limit_exceeded_behavior: The behavior the Time Series + Insights service should take when the environment's capacity has been + exceeded. If "PauseIngress" is specified, new events will not be read from + the event source. If "PurgeOldData" is specified, new events will continue + to be read and old events will be deleted from the environment. The + default behavior is PurgeOldData. Possible values include: 'PurgeOldData', + 'PauseIngress' + :type storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :param partition_key_properties: The list of event properties which will + be used to partition data in the environment. + :type partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'data_retention_time': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, + 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, + 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, + } + + def __init__(self, **kwargs): + super(StandardEnvironmentCreateOrUpdateParameters, self).__init__(**kwargs) + self.data_retention_time = kwargs.get('data_retention_time', None) + self.storage_limit_exceeded_behavior = kwargs.get('storage_limit_exceeded_behavior', None) + self.partition_key_properties = kwargs.get('partition_key_properties', None) + self.kind = 'Standard' + + +class StandardEnvironmentResource(EnvironmentResource): + """An environment is a set of time-series data available for query, and is the + top level Azure Time Series Insights resource. Standard environments have + data retention limits. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :param data_retention_time: Required. ISO8601 timespan specifying the + minimum number of days the environment's events will be available for + query. + :type data_retention_time: timedelta + :param storage_limit_exceeded_behavior: The behavior the Time Series + Insights service should take when the environment's capacity has been + exceeded. If "PauseIngress" is specified, new events will not be read from + the event source. If "PurgeOldData" is specified, new events will continue + to be read and old events will be deleted from the environment. The + default behavior is PurgeOldData. Possible values include: 'PurgeOldData', + 'PauseIngress' + :type storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :param partition_key_properties: The list of event properties which will + be used to partition data in the environment. + :type partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + :ivar data_access_id: An id used to access the environment data, e.g. to + query the environment's events or upload reference data for the + environment. + :vartype data_access_id: str + :ivar data_access_fqdn: The fully qualified domain name used to access the + environment data, e.g. to query the environment's events or upload + reference data for the environment. + :vartype data_access_fqdn: str + :param status: An object that represents the status of the environment, + and its internal state in the Time Series Insights service. + :type status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'data_retention_time': {'required': True}, + 'data_access_id': {'readonly': True}, + 'data_access_fqdn': {'readonly': True}, + 'creation_time': {'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}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, + 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, + 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, + 'data_access_id': {'key': 'properties.dataAccessId', 'type': 'str'}, + 'data_access_fqdn': {'key': 'properties.dataAccessFqdn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'EnvironmentStatus'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(StandardEnvironmentResource, self).__init__(**kwargs) + self.data_retention_time = kwargs.get('data_retention_time', None) + self.storage_limit_exceeded_behavior = kwargs.get('storage_limit_exceeded_behavior', None) + self.partition_key_properties = kwargs.get('partition_key_properties', None) + self.data_access_id = None + self.data_access_fqdn = None + self.status = kwargs.get('status', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.creation_time = None + self.kind = 'Standard' + + +class StandardEnvironmentUpdateParameters(EnvironmentUpdateParameters): + """Parameters supplied to the Update Environment operation to update a + standard environment. + + :param tags: Key-value pairs of additional properties for the environment. + :type tags: dict[str, str] + :param sku: The sku of the environment. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param data_retention_time: ISO8601 timespan specifying the minimum number + of days the environment's events will be available for query. + :type data_retention_time: timedelta + :param storage_limit_exceeded_behavior: The behavior the Time Series + Insights service should take when the environment's capacity has been + exceeded. If "PauseIngress" is specified, new events will not be read from + the event source. If "PurgeOldData" is specified, new events will continue + to be read and old events will be deleted from the environment. The + default behavior is PurgeOldData. Possible values include: 'PurgeOldData', + 'PauseIngress' + :type storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :param partition_key_properties: The list of event properties which will + be used to partition data in the environment. + :type partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, + 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, + 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, + } + + def __init__(self, **kwargs): + super(StandardEnvironmentUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.data_retention_time = kwargs.get('data_retention_time', None) + self.storage_limit_exceeded_behavior = kwargs.get('storage_limit_exceeded_behavior', None) + self.partition_key_properties = kwargs.get('partition_key_properties', None) + + +class TimeSeriesIdProperty(Model): + """The structure of the property that a time series id can have. An + environment can have multiple such properties. + + :param name: The name of the property. + :type name: str + :param type: The type of the property. Possible values include: 'String' + :type type: str or ~azure.mgmt.timeseriesinsights.models.PropertyType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TimeSeriesIdProperty, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class WarmStorageEnvironmentStatus(Model): + """An object that represents the status of warm storage on an environment. + + :param state: This string represents the state of warm storage properties + usage. It can be "Ok", "Error", "Unknown". Possible values include: 'Ok', + 'Error', 'Unknown' + :type state: str or + ~azure.mgmt.timeseriesinsights.models.WarmStoragePropertiesState + :param current_count: A value that represents the number of properties + used by the environment for S1/S2 SKU and number of properties used by + Warm Store for PAYG SKU + :type current_count: int + :param max_count: A value that represents the maximum number of properties + used allowed by the environment for S1/S2 SKU and maximum number of + properties allowed by Warm Store for PAYG SKU. + :type max_count: int + """ + + _validation = { + 'current_count': {'maximum': 10, 'minimum': 1}, + 'max_count': {'maximum': 10, 'minimum': 1}, + } + + _attribute_map = { + 'state': {'key': 'propertiesUsage.state', 'type': 'str'}, + 'current_count': {'key': 'propertiesUsage.stateDetails.currentCount', 'type': 'int'}, + 'max_count': {'key': 'propertiesUsage.stateDetails.maxCount', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(WarmStorageEnvironmentStatus, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.current_count = kwargs.get('current_count', None) + self.max_count = kwargs.get('max_count', None) diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_models_py3.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_models_py3.py new file mode 100644 index 00000000000..15c32a03692 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_models_py3.py @@ -0,0 +1,2237 @@ +# 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 AccessPolicyCreateOrUpdateParameters(Model): + """AccessPolicyCreateOrUpdateParameters. + + :param principal_object_id: The objectId of the principal in Azure Active + Directory. + :type principal_object_id: str + :param description: An description of the access policy. + :type description: str + :param roles: The list of roles the principal is assigned on the + environment. + :type roles: list[str or + ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + """ + + _attribute_map = { + 'principal_object_id': {'key': 'properties.principalObjectId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': '[str]'}, + } + + def __init__(self, *, principal_object_id: str=None, description: str=None, roles=None, **kwargs) -> None: + super(AccessPolicyCreateOrUpdateParameters, self).__init__(**kwargs) + self.principal_object_id = principal_object_id + self.description = description + self.roles = roles + + +class AccessPolicyListResponse(Model): + """The response of the List access policies operation. + + :param value: Result of the List access policies operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.AccessPolicyResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AccessPolicyResource]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(AccessPolicyListResponse, self).__init__(**kwargs) + self.value = value + + +class Resource(Model): + """Time Series Insights resource. + + 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 + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AccessPolicyResource(Resource): + """An access policy is used to grant users and applications access to the + environment. Roles are assigned to service principals in Azure Active + Directory. These roles define the actions the principal can perform through + the Time Series Insights data plane APIs. + + 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 principal_object_id: The objectId of the principal in Azure Active + Directory. + :type principal_object_id: str + :param description: An description of the access policy. + :type description: str + :param roles: The list of roles the principal is assigned on the + environment. + :type roles: list[str or + ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + """ + + _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'}, + 'principal_object_id': {'key': 'properties.principalObjectId', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': '[str]'}, + } + + def __init__(self, *, principal_object_id: str=None, description: str=None, roles=None, **kwargs) -> None: + super(AccessPolicyResource, self).__init__(**kwargs) + self.principal_object_id = principal_object_id + self.description = description + self.roles = roles + + +class AccessPolicyUpdateParameters(Model): + """AccessPolicyUpdateParameters. + + :param description: An description of the access policy. + :type description: str + :param roles: The list of roles the principal is assigned on the + environment. + :type roles: list[str or + ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + """ + + _attribute_map = { + 'description': {'key': 'properties.description', 'type': 'str'}, + 'roles': {'key': 'properties.roles', 'type': '[str]'}, + } + + def __init__(self, *, description: str=None, roles=None, **kwargs) -> None: + super(AccessPolicyUpdateParameters, self).__init__(**kwargs) + self.description = description + self.roles = roles + + +class ResourceProperties(Model): + """Properties that are common to all tracked resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + """ + + _validation = { + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'rfc-1123'}, + } + + def __init__(self, *, provisioning_state=None, **kwargs) -> None: + super(ResourceProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.creation_time = None + + +class EventSourceCommonProperties(ResourceProperties): + """Properties of the event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + } + + def __init__(self, *, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(EventSourceCommonProperties, self).__init__(provisioning_state=provisioning_state, **kwargs) + self.timestamp_property_name = timestamp_property_name + + +class AzureEventSourceProperties(EventSourceCommonProperties): + """Properties of an event source that reads events from an event broker in + Azure. + + 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 provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, + } + + def __init__(self, *, event_source_resource_id: str, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(AzureEventSourceProperties, self).__init__(provisioning_state=provisioning_state, timestamp_property_name=timestamp_property_name, **kwargs) + self.event_source_resource_id = event_source_resource_id + + +class CloudError(Model): + """Contains information about an API error. + + :param error: Describes a particular API error with an error code and a + message. + :type error: ~azure.mgmt.timeseriesinsights.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """Describes a particular API error with an error code and a message. + + :param code: An error code that describes the error condition more + precisely than an HTTP status code. Can be used to programmatically handle + specific error cases. + :type code: str + :param message: A message that describes the error in detail and provides + debugging information. + :type message: str + :param target: The target of the particular error (for example, the name + of the property in error). + :type target: str + :param details: Contains nested errors that are related to this error. + :type details: list[~azure.mgmt.timeseriesinsights.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class CreateOrUpdateTrackedResourceProperties(Model): + """Properties required to create any resource tracked by Azure Resource + Manager. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'location': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(CreateOrUpdateTrackedResourceProperties, self).__init__(**kwargs) + self.location = location + self.tags = tags + + +class EnvironmentCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): + """Parameters supplied to the CreateOrUpdate Environment operation. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: StandardEnvironmentCreateOrUpdateParameters, + LongTermEnvironmentCreateOrUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Standard': 'StandardEnvironmentCreateOrUpdateParameters', 'LongTerm': 'LongTermEnvironmentCreateOrUpdateParameters'} + } + + def __init__(self, *, location: str, sku, tags=None, **kwargs) -> None: + super(EnvironmentCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.kind = None + self.kind = 'EnvironmentCreateOrUpdateParameters' + + +class EnvironmentListResponse(Model): + """The response of the List Environments operation. + + :param value: Result of the List Environments operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EnvironmentResource]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EnvironmentListResponse, self).__init__(**kwargs) + self.value = value + + +class TrackedResource(Resource): + """Time Series Insights resource that is tracked by Azure Resource Manager. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.location = location + self.tags = tags + + +class EnvironmentResource(TrackedResource): + """An environment is a set of time-series data available for query, and is the + top level Azure Time Series Insights resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: StandardEnvironmentResource, LongTermEnvironmentResource + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': 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}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Standard': 'StandardEnvironmentResource', 'LongTerm': 'LongTermEnvironmentResource'} + } + + def __init__(self, *, location: str, sku, tags=None, **kwargs) -> None: + super(EnvironmentResource, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.kind = None + self.kind = 'EnvironmentResource' + + +class EnvironmentResourceProperties(ResourceProperties): + """Properties of the environment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :ivar data_access_id: An id used to access the environment data, e.g. to + query the environment's events or upload reference data for the + environment. + :vartype data_access_id: str + :ivar data_access_fqdn: The fully qualified domain name used to access the + environment data, e.g. to query the environment's events or upload + reference data for the environment. + :vartype data_access_fqdn: str + :param status: An object that represents the status of the environment, + and its internal state in the Time Series Insights service. + :type status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'data_access_id': {'readonly': True}, + 'data_access_fqdn': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'rfc-1123'}, + 'data_access_id': {'key': 'dataAccessId', 'type': 'str'}, + 'data_access_fqdn': {'key': 'dataAccessFqdn', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'EnvironmentStatus'}, + } + + def __init__(self, *, provisioning_state=None, status=None, **kwargs) -> None: + super(EnvironmentResourceProperties, self).__init__(provisioning_state=provisioning_state, **kwargs) + self.data_access_id = None + self.data_access_fqdn = None + self.status = status + + +class EnvironmentStateDetails(Model): + """An object that contains the details about an environment's state. + + :param code: Contains the code that represents the reason of an + environment being in a particular state. Can be used to programmatically + handle specific cases. + :type code: str + :param message: A message that describes the state in detail. + :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(EnvironmentStateDetails, self).__init__(**kwargs) + self.code = code + self.message = message + + +class EnvironmentStatus(Model): + """An object that represents the status of the environment, and its internal + state in the Time Series Insights service. + + :param ingress: An object that represents the status of ingress on an + environment. + :type ingress: + ~azure.mgmt.timeseriesinsights.models.IngressEnvironmentStatus + :param warm_storage: An object that represents the status of warm storage + on an environment. + :type warm_storage: + ~azure.mgmt.timeseriesinsights.models.WarmStorageEnvironmentStatus + """ + + _attribute_map = { + 'ingress': {'key': 'ingress', 'type': 'IngressEnvironmentStatus'}, + 'warm_storage': {'key': 'warmStorage', 'type': 'WarmStorageEnvironmentStatus'}, + } + + def __init__(self, *, ingress=None, warm_storage=None, **kwargs) -> None: + super(EnvironmentStatus, self).__init__(**kwargs) + self.ingress = ingress + self.warm_storage = warm_storage + + +class EnvironmentUpdateParameters(Model): + """Parameters supplied to the Update Environment operation. + + :param tags: Key-value pairs of additional properties for the environment. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(EnvironmentUpdateParameters, self).__init__(**kwargs) + self.tags = tags + + +class EventHubEventSourceCommonProperties(AzureEventSourceProperties): + """Properties of the EventHub event source. + + 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 provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param service_bus_namespace: Required. The name of the service bus that + contains the event hub. + :type service_bus_namespace: str + :param event_hub_name: Required. The name of the event hub. + :type event_hub_name: str + :param consumer_group_name: Required. The name of the event hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the SAS key that grants the Time + Series Insights service access to the event hub. The shared access + policies for this key must grant 'Listen' permissions to the event hub. + :type key_name: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'service_bus_namespace': {'required': True}, + 'event_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, + 'service_bus_namespace': {'key': 'serviceBusNamespace', 'type': 'str'}, + 'event_hub_name': {'key': 'eventHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, event_source_resource_id: str, service_bus_namespace: str, event_hub_name: str, consumer_group_name: str, key_name: str, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(EventHubEventSourceCommonProperties, self).__init__(provisioning_state=provisioning_state, timestamp_property_name=timestamp_property_name, event_source_resource_id=event_source_resource_id, **kwargs) + self.service_bus_namespace = service_bus_namespace + self.event_hub_name = event_hub_name + self.consumer_group_name = consumer_group_name + self.key_name = key_name + + +class EventSourceCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): + """Parameters supplied to the Create or Update Event Source operation. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EventHubEventSourceCreateOrUpdateParameters, + IoTHubEventSourceCreateOrUpdateParameters + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'location': {'required': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Microsoft.EventHub': 'EventHubEventSourceCreateOrUpdateParameters', 'Microsoft.IoTHub': 'IoTHubEventSourceCreateOrUpdateParameters'} + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(EventSourceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + self.kind = None + self.kind = 'EventSourceCreateOrUpdateParameters' + + +class EventHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Event Source operation for an + EventHub event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param service_bus_namespace: Required. The name of the service bus that + contains the event hub. + :type service_bus_namespace: str + :param event_hub_name: Required. The name of the event hub. + :type event_hub_name: str + :param consumer_group_name: Required. The name of the event hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the SAS key that grants the Time + Series Insights service access to the event hub. The shared access + policies for this key must grant 'Listen' permissions to the event hub. + :type key_name: str + :param shared_access_key: Required. The value of the shared access key + that grants the Time Series Insights service read access to the event hub. + This property is not shown in event source responses. + :type shared_access_key: str + """ + + _validation = { + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'service_bus_namespace': {'required': True}, + 'event_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + 'shared_access_key': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, + 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, *, location: str, event_source_resource_id: str, service_bus_namespace: str, event_hub_name: str, consumer_group_name: str, key_name: str, shared_access_key: str, tags=None, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(EventHubEventSourceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.creation_time = None + self.timestamp_property_name = timestamp_property_name + self.event_source_resource_id = event_source_resource_id + self.service_bus_namespace = service_bus_namespace + self.event_hub_name = event_hub_name + self.consumer_group_name = consumer_group_name + self.key_name = key_name + self.shared_access_key = shared_access_key + self.kind = 'Microsoft.EventHub' + + +class EventSourceResource(TrackedResource): + """An environment receives data from one or more event sources. Each event + source has associated connection info that allows the Time Series Insights + ingress pipeline to connect to and pull data from the event source. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EventHubEventSourceResource, IoTHubEventSourceResource + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': 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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'Microsoft.EventHub': 'EventHubEventSourceResource', 'Microsoft.IotHub': 'IoTHubEventSourceResource'} + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(EventSourceResource, self).__init__(location=location, tags=tags, **kwargs) + self.kind = None + self.kind = 'EventSourceResource' + + +class EventHubEventSourceResource(EventSourceResource): + """An event source that receives its data from an Azure EventHub. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param service_bus_namespace: Required. The name of the service bus that + contains the event hub. + :type service_bus_namespace: str + :param event_hub_name: Required. The name of the event hub. + :type event_hub_name: str + :param consumer_group_name: Required. The name of the event hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the SAS key that grants the Time + Series Insights service access to the event hub. The shared access + policies for this key must grant 'Listen' permissions to the event hub. + :type key_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'service_bus_namespace': {'required': True}, + 'event_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': 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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'service_bus_namespace': {'key': 'properties.serviceBusNamespace', 'type': 'str'}, + 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + } + + def __init__(self, *, location: str, event_source_resource_id: str, service_bus_namespace: str, event_hub_name: str, consumer_group_name: str, key_name: str, tags=None, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(EventHubEventSourceResource, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.creation_time = None + self.timestamp_property_name = timestamp_property_name + self.event_source_resource_id = event_source_resource_id + self.service_bus_namespace = service_bus_namespace + self.event_hub_name = event_hub_name + self.consumer_group_name = consumer_group_name + self.key_name = key_name + self.kind = 'Microsoft.EventHub' + + +class EventSourceUpdateParameters(Model): + """Parameters supplied to the Update Event Source operation. + + :param tags: Key-value pairs of additional properties for the event + source. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(EventSourceUpdateParameters, self).__init__(**kwargs) + self.tags = tags + + +class EventHubEventSourceUpdateParameters(EventSourceUpdateParameters): + """Parameters supplied to the Update Event Source operation to update an + EventHub event source. + + :param tags: Key-value pairs of additional properties for the event + source. + :type tags: dict[str, str] + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :param shared_access_key: The value of the shared access key that grants + the Time Series Insights service read access to the event hub. This + property is not shown in event source responses. + :type shared_access_key: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, *, tags=None, timestamp_property_name: str=None, local_timestamp=None, shared_access_key: str=None, **kwargs) -> None: + super(EventHubEventSourceUpdateParameters, self).__init__(tags=tags, **kwargs) + self.timestamp_property_name = timestamp_property_name + self.local_timestamp = local_timestamp + self.shared_access_key = shared_access_key + + +class EventSourceListResponse(Model): + """The response of the List EventSources operation. + + :param value: Result of the List EventSources operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.EventSourceResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[EventSourceResource]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(EventSourceListResponse, self).__init__(**kwargs) + self.value = value + + +class EventSourceMutableProperties(Model): + """An object that represents a set of mutable event source resource + properties. + + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + """ + + _attribute_map = { + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'localTimestamp', 'type': 'LocalTimestamp'}, + } + + def __init__(self, *, timestamp_property_name: str=None, local_timestamp=None, **kwargs) -> None: + super(EventSourceMutableProperties, self).__init__(**kwargs) + self.timestamp_property_name = timestamp_property_name + self.local_timestamp = local_timestamp + + +class IngressEnvironmentStatus(Model): + """An object that represents the status of ingress on an environment. + + :param state: This string represents the state of ingress operations on an + environment. It can be "Disabled", "Ready", "Running", "Paused" or + "Unknown". Possible values include: 'Disabled', 'Ready', 'Running', + 'Paused', 'Unknown' + :type state: str or ~azure.mgmt.timeseriesinsights.models.IngressState + :param state_details: An object that contains the details about an + environment's state. + :type state_details: + ~azure.mgmt.timeseriesinsights.models.EnvironmentStateDetails + """ + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'state_details': {'key': 'stateDetails', 'type': 'EnvironmentStateDetails'}, + } + + def __init__(self, *, state=None, state_details=None, **kwargs) -> None: + super(IngressEnvironmentStatus, self).__init__(**kwargs) + self.state = state + self.state_details = state_details + + +class IoTHubEventSourceCommonProperties(AzureEventSourceProperties): + """Properties of the IoTHub event source. + + 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 provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param iot_hub_name: Required. The name of the iot hub. + :type iot_hub_name: str + :param consumer_group_name: Required. The name of the iot hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the Shared Access Policy key that + grants the Time Series Insights service access to the iot hub. This shared + access policy key must grant 'service connect' permissions to the iot hub. + :type key_name: str + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'iot_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'eventSourceResourceId', 'type': 'str'}, + 'iot_hub_name': {'key': 'iotHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, event_source_resource_id: str, iot_hub_name: str, consumer_group_name: str, key_name: str, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(IoTHubEventSourceCommonProperties, self).__init__(provisioning_state=provisioning_state, timestamp_property_name=timestamp_property_name, event_source_resource_id=event_source_resource_id, **kwargs) + self.iot_hub_name = iot_hub_name + self.consumer_group_name = consumer_group_name + self.key_name = key_name + + +class IoTHubEventSourceCreateOrUpdateParameters(EventSourceCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Event Source operation for an + IoTHub event source. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param iot_hub_name: Required. The name of the iot hub. + :type iot_hub_name: str + :param consumer_group_name: Required. The name of the iot hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the Shared Access Policy key that + grants the Time Series Insights service access to the iot hub. This shared + access policy key must grant 'service connect' permissions to the iot hub. + :type key_name: str + :param shared_access_key: Required. The value of the Shared Access Policy + key that grants the Time Series Insights service read access to the iot + hub. This property is not shown in event source responses. + :type shared_access_key: str + """ + + _validation = { + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'iot_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': True}, + 'shared_access_key': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'iot_hub_name': {'key': 'properties.iotHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, *, location: str, event_source_resource_id: str, iot_hub_name: str, consumer_group_name: str, key_name: str, shared_access_key: str, tags=None, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(IoTHubEventSourceCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.creation_time = None + self.timestamp_property_name = timestamp_property_name + self.event_source_resource_id = event_source_resource_id + self.iot_hub_name = iot_hub_name + self.consumer_group_name = consumer_group_name + self.key_name = key_name + self.shared_access_key = shared_access_key + self.kind = 'Microsoft.IoTHub' + + +class IoTHubEventSourceResource(EventSourceResource): + """An event source that receives its data from an Azure IoTHub. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param kind: Required. Constant filled by server. + :type kind: str + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param event_source_resource_id: Required. The resource id of the event + source in Azure Resource Manager. + :type event_source_resource_id: str + :param iot_hub_name: Required. The name of the iot hub. + :type iot_hub_name: str + :param consumer_group_name: Required. The name of the iot hub's consumer + group that holds the partitions from which events will be read. + :type consumer_group_name: str + :param key_name: Required. The name of the Shared Access Policy key that + grants the Time Series Insights service access to the iot hub. This shared + access policy key must grant 'service connect' permissions to the iot hub. + :type key_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'event_source_resource_id': {'required': True}, + 'iot_hub_name': {'required': True}, + 'consumer_group_name': {'required': True}, + 'key_name': {'required': 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}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'rfc-1123'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'event_source_resource_id': {'key': 'properties.eventSourceResourceId', 'type': 'str'}, + 'iot_hub_name': {'key': 'properties.iotHubName', 'type': 'str'}, + 'consumer_group_name': {'key': 'properties.consumerGroupName', 'type': 'str'}, + 'key_name': {'key': 'properties.keyName', 'type': 'str'}, + } + + def __init__(self, *, location: str, event_source_resource_id: str, iot_hub_name: str, consumer_group_name: str, key_name: str, tags=None, provisioning_state=None, timestamp_property_name: str=None, **kwargs) -> None: + super(IoTHubEventSourceResource, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = provisioning_state + self.creation_time = None + self.timestamp_property_name = timestamp_property_name + self.event_source_resource_id = event_source_resource_id + self.iot_hub_name = iot_hub_name + self.consumer_group_name = consumer_group_name + self.key_name = key_name + self.kind = 'Microsoft.IotHub' + + +class IoTHubEventSourceUpdateParameters(EventSourceUpdateParameters): + """Parameters supplied to the Update Event Source operation to update an + IoTHub event source. + + :param tags: Key-value pairs of additional properties for the event + source. + :type tags: dict[str, str] + :param timestamp_property_name: The event property that will be used as + the event source's timestamp. If a value isn't specified for + timestampPropertyName, or if null or empty-string is specified, the event + creation time will be used. + :type timestamp_property_name: str + :param local_timestamp: An object that represents the local timestamp + property. It contains the format of local timestamp that needs to be used + and the corresponding timezone offset information. If a value isn't + specified for localTimestamp, or if null, then the local timestamp will + not be ingressed with the events. + :type local_timestamp: + ~azure.mgmt.timeseriesinsights.models.LocalTimestamp + :param shared_access_key: The value of the shared access key that grants + the Time Series Insights service read access to the iot hub. This property + is not shown in event source responses. + :type shared_access_key: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'timestamp_property_name': {'key': 'properties.timestampPropertyName', 'type': 'str'}, + 'local_timestamp': {'key': 'properties.localTimestamp', 'type': 'LocalTimestamp'}, + 'shared_access_key': {'key': 'properties.sharedAccessKey', 'type': 'str'}, + } + + def __init__(self, *, tags=None, timestamp_property_name: str=None, local_timestamp=None, shared_access_key: str=None, **kwargs) -> None: + super(IoTHubEventSourceUpdateParameters, self).__init__(tags=tags, **kwargs) + self.timestamp_property_name = timestamp_property_name + self.local_timestamp = local_timestamp + self.shared_access_key = shared_access_key + + +class LocalTimestamp(Model): + """An object that represents the local timestamp property. It contains the + format of local timestamp that needs to be used and the corresponding + timezone offset information. If a value isn't specified for localTimestamp, + or if null, then the local timestamp will not be ingressed with the events. + + :param format: An enum that represents the format of the local timestamp + property that needs to be set. Possible values include: 'Embedded', + 'Iana', 'TimeSpan' + :type format: str or + ~azure.mgmt.timeseriesinsights.models.LocalTimestampFormat + :param time_zone_offset: An object that represents the offset information + for the local timestamp format specified. Should not be specified for + LocalTimestampFormat - Embedded. + :type time_zone_offset: + ~azure.mgmt.timeseriesinsights.models.LocalTimestampTimeZoneOffset + """ + + _attribute_map = { + 'format': {'key': 'format', 'type': 'str'}, + 'time_zone_offset': {'key': 'timeZoneOffset', 'type': 'LocalTimestampTimeZoneOffset'}, + } + + def __init__(self, *, format=None, time_zone_offset=None, **kwargs) -> None: + super(LocalTimestamp, self).__init__(**kwargs) + self.format = format + self.time_zone_offset = time_zone_offset + + +class LocalTimestampTimeZoneOffset(Model): + """An object that represents the offset information for the local timestamp + format specified. Should not be specified for LocalTimestampFormat - + Embedded. + + :param property_name: The event property that will be contain the offset + information to calculate the local timestamp. When the + LocalTimestampFormat is Iana, the property name will contain the name of + the column which contains IANA Timezone Name (eg: Americas/Los Angeles). + When LocalTimestampFormat is Timespan, it contains the name of property + which contains values representing the offset (eg: P1D or 1.00:00:00) + :type property_name: str + """ + + _attribute_map = { + 'property_name': {'key': 'propertyName', 'type': 'str'}, + } + + def __init__(self, *, property_name: str=None, **kwargs) -> None: + super(LocalTimestampTimeZoneOffset, self).__init__(**kwargs) + self.property_name = property_name + + +class LongTermEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Environment operation for a + long-term environment. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :param time_series_id_properties: Required. The list of event properties + which will be used to define the environment's time series id. + :type time_series_id_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + :param storage_configuration: Required. The storage configuration provides + the connection details that allows the Time Series Insights service to + connect to the customer storage account that is used to store the + environment's data. + :type storage_configuration: + ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationInput + :param data_retention: Required. ISO8601 timespan specifying the number of + days the environment's events will be available for query from the warm + store. + :type data_retention: timedelta + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'time_series_id_properties': {'required': True}, + 'storage_configuration': {'required': True}, + 'data_retention': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, + 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationInput'}, + 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + } + + def __init__(self, *, location: str, sku, time_series_id_properties, storage_configuration, data_retention, tags=None, **kwargs) -> None: + super(LongTermEnvironmentCreateOrUpdateParameters, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.time_series_id_properties = time_series_id_properties + self.storage_configuration = storage_configuration + self.data_retention = data_retention + self.kind = 'LongTerm' + + +class LongTermEnvironmentResource(EnvironmentResource): + """An environment is a set of time-series data available for query, and is the + top level Azure Time Series Insights resource. LongTerm environments do not + have set data retention limits. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :ivar data_access_id: An id used to access the environment data, e.g. to + query the environment's events or upload reference data for the + environment. + :vartype data_access_id: str + :ivar data_access_fqdn: The fully qualified domain name used to access the + environment data, e.g. to query the environment's events or upload + reference data for the environment. + :vartype data_access_fqdn: str + :param status: An object that represents the status of the environment, + and its internal state in the Time Series Insights service. + :type status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + :param time_series_id_properties: Required. The list of event properties + which will be used to define the environment's time series id. + :type time_series_id_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + :param storage_configuration: Required. The storage configuration provides + the connection details that allows the Time Series Insights service to + connect to the customer storage account that is used to store the + environment's data. + :type storage_configuration: + ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationOutput + :param data_retention: Required. ISO8601 timespan specifying the number of + days the environment's events will be available for query from the warm + store. + :type data_retention: timedelta + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'data_access_id': {'readonly': True}, + 'data_access_fqdn': {'readonly': True}, + 'creation_time': {'readonly': True}, + 'time_series_id_properties': {'required': True}, + 'storage_configuration': {'required': True}, + 'data_retention': {'required': 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}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_access_id': {'key': 'properties.dataAccessId', 'type': 'str'}, + 'data_access_fqdn': {'key': 'properties.dataAccessFqdn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'EnvironmentStatus'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + 'time_series_id_properties': {'key': 'properties.timeSeriesIdProperties', 'type': '[TimeSeriesIdProperty]'}, + 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationOutput'}, + 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + } + + def __init__(self, *, location: str, sku, time_series_id_properties, storage_configuration, data_retention, tags=None, status=None, provisioning_state=None, **kwargs) -> None: + super(LongTermEnvironmentResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.data_access_id = None + self.data_access_fqdn = None + self.status = status + self.provisioning_state = provisioning_state + self.creation_time = None + self.time_series_id_properties = time_series_id_properties + self.storage_configuration = storage_configuration + self.data_retention = data_retention + self.kind = 'LongTerm' + + +class LongTermEnvironmentUpdateParameters(EnvironmentUpdateParameters): + """Parameters supplied to the Update Environment operation to update a + long-term environment. + + All required parameters must be populated in order to send to Azure. + + :param tags: Key-value pairs of additional properties for the environment. + :type tags: dict[str, str] + :param storage_configuration: The storage configuration provides the + connection details that allows the Time Series Insights service to connect + to the customer storage account that is used to store the environment's + data. + :type storage_configuration: + ~azure.mgmt.timeseriesinsights.models.LongTermStorageConfigurationMutableProperties + :param data_retention: Required. ISO8601 timespan specifying the number of + days the environment's events will be available for query from the warm + store. + :type data_retention: timedelta + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'storage_configuration': {'key': 'properties.storageConfiguration', 'type': 'LongTermStorageConfigurationMutableProperties'}, + 'data_retention': {'key': 'properties.warmStoreConfiguration.dataRetention', 'type': 'duration'}, + } + + def __init__(self, *, data_retention, tags=None, storage_configuration=None, **kwargs) -> None: + super(LongTermEnvironmentUpdateParameters, self).__init__(tags=tags, **kwargs) + self.storage_configuration = storage_configuration + self.data_retention = data_retention + + +class LongTermStorageConfigurationInput(Model): + """The storage configuration provides the connection details that allows the + Time Series Insights service to connect to the customer storage account + that is used to store the environment's data. + + All required parameters must be populated in order to send to Azure. + + :param account_name: Required. The name of the storage account that will + hold the environment's long term data. + :type account_name: str + :param management_key: Required. The value of the management key that + grants the Time Series Insights service write access to the storage + account. This property is not shown in environment responses. + :type management_key: str + """ + + _validation = { + 'account_name': {'required': True}, + 'management_key': {'required': True}, + } + + _attribute_map = { + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'management_key': {'key': 'managementKey', 'type': 'str'}, + } + + def __init__(self, *, account_name: str, management_key: str, **kwargs) -> None: + super(LongTermStorageConfigurationInput, self).__init__(**kwargs) + self.account_name = account_name + self.management_key = management_key + + +class LongTermStorageConfigurationMutableProperties(Model): + """The storage configuration provides the connection details that allows the + Time Series Insights service to connect to the customer storage account + that is used to store the environment's data. + + All required parameters must be populated in order to send to Azure. + + :param management_key: Required. The value of the management key that + grants the Time Series Insights service write access to the storage + account. This property is not shown in environment responses. + :type management_key: str + """ + + _validation = { + 'management_key': {'required': True}, + } + + _attribute_map = { + 'management_key': {'key': 'managementKey', 'type': 'str'}, + } + + def __init__(self, *, management_key: str, **kwargs) -> None: + super(LongTermStorageConfigurationMutableProperties, self).__init__(**kwargs) + self.management_key = management_key + + +class LongTermStorageConfigurationOutput(Model): + """The storage configuration provides the non-secret connection details about + the customer storage account that is used to store the environment's data. + + All required parameters must be populated in order to send to Azure. + + :param account_name: Required. The name of the storage account that will + hold the environment's long term data. + :type account_name: str + """ + + _validation = { + 'account_name': {'required': True}, + } + + _attribute_map = { + 'account_name': {'key': 'accountName', 'type': 'str'}, + } + + def __init__(self, *, account_name: str, **kwargs) -> None: + super(LongTermStorageConfigurationOutput, self).__init__(**kwargs) + self.account_name = account_name + + +class Operation(Model): + """A Time Series Insights REST API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation being performed on this particular + object. + :vartype name: str + :ivar display: Contains the localized display information for this + particular operation / action. + :vartype display: ~azure.mgmt.timeseriesinsights.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + + +class OperationDisplay(Model): + """Contains the localized display information for this particular operation / + action. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The localized friendly form of the resource provider name. + :vartype provider: str + :ivar resource: The localized friendly form of the resource type related + to this action/operation. + :vartype resource: str + :ivar operation: The localized friendly name for the operation. + :vartype operation: str + :ivar description: The localized friendly description for the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class ReferenceDataSetCreateOrUpdateParameters(CreateOrUpdateTrackedResourceProperties): + """ReferenceDataSetCreateOrUpdateParameters. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param key_properties: Required. The list of key properties for the + reference data set. + :type key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :param data_string_comparison_behavior: The reference data set key + comparison behavior can be set using this property. By default, the value + is 'Ordinal' - which means case sensitive key comparison will be performed + while joining reference data with events or while adding new reference + data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be + used. Possible values include: 'Ordinal', 'OrdinalIgnoreCase' + :type data_string_comparison_behavior: str or + ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior + """ + + _validation = { + 'location': {'required': True}, + 'key_properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'key_properties': {'key': 'properties.keyProperties', 'type': '[ReferenceDataSetKeyProperty]'}, + 'data_string_comparison_behavior': {'key': 'properties.dataStringComparisonBehavior', 'type': 'str'}, + } + + def __init__(self, *, location: str, key_properties, tags=None, data_string_comparison_behavior=None, **kwargs) -> None: + super(ReferenceDataSetCreateOrUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + self.key_properties = key_properties + self.data_string_comparison_behavior = data_string_comparison_behavior + + +class ReferenceDataSetKeyProperty(Model): + """A key property for the reference data set. A reference data set can have + multiple key properties. + + :param name: The name of the key property. + :type name: str + :param type: The type of the key property. Possible values include: + 'String', 'Double', 'Bool', 'DateTime' + :type type: str or + ~azure.mgmt.timeseriesinsights.models.ReferenceDataKeyPropertyType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type=None, **kwargs) -> None: + super(ReferenceDataSetKeyProperty, self).__init__(**kwargs) + self.name = name + self.type = type + + +class ReferenceDataSetListResponse(Model): + """The response of the List Reference Data Sets operation. + + :param value: Result of the List Reference Data Sets operation. + :type value: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ReferenceDataSetResource]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ReferenceDataSetListResponse, self).__init__(**kwargs) + self.value = value + + +class ReferenceDataSetResource(TrackedResource): + """A reference data set provides metadata about the events in an environment. + Metadata in the reference data set will be joined with events as they are + read from event sources. The metadata that makes up the reference data set + is uploaded or modified through the Time Series Insights data plane APIs. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param key_properties: Required. The list of key properties for the + reference data set. + :type key_properties: + list[~azure.mgmt.timeseriesinsights.models.ReferenceDataSetKeyProperty] + :param data_string_comparison_behavior: The reference data set key + comparison behavior can be set using this property. By default, the value + is 'Ordinal' - which means case sensitive key comparison will be performed + while joining reference data with events or while adding new reference + data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be + used. Possible values include: 'Ordinal', 'OrdinalIgnoreCase' + :type data_string_comparison_behavior: str or + ~azure.mgmt.timeseriesinsights.models.DataStringComparisonBehavior + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'key_properties': {'required': True}, + 'creation_time': {'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}'}, + 'key_properties': {'key': 'properties.keyProperties', 'type': '[ReferenceDataSetKeyProperty]'}, + 'data_string_comparison_behavior': {'key': 'properties.dataStringComparisonBehavior', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'rfc-1123'}, + } + + def __init__(self, *, location: str, key_properties, tags=None, data_string_comparison_behavior=None, provisioning_state=None, **kwargs) -> None: + super(ReferenceDataSetResource, self).__init__(location=location, tags=tags, **kwargs) + self.key_properties = key_properties + self.data_string_comparison_behavior = data_string_comparison_behavior + self.provisioning_state = provisioning_state + self.creation_time = None + + +class ReferenceDataSetUpdateParameters(Model): + """Parameters supplied to the Update Reference Data Set operation. + + :param tags: Key-value pairs of additional properties for the reference + data set. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ReferenceDataSetUpdateParameters, self).__init__(**kwargs) + self.tags = tags + + +class Sku(Model): + """The sku determines the type of environment, either standard (S1 or S2) or + long-term (L1). For standard environments the sku determines the capacity + of the environment, the ingress rate, and the billing rate. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The name of this SKU. Possible values include: + 'S1', 'S2', 'P1', 'L1' + :type name: str or ~azure.mgmt.timeseriesinsights.models.SkuName + :param capacity: Required. The capacity of the sku. For standard + environments, this value can be changed to support scale out of + environments after they have been created. + :type capacity: int + """ + + _validation = { + 'name': {'required': True}, + 'capacity': {'required': True, 'maximum': 10, 'minimum': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name, capacity: int, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.capacity = capacity + + +class StandardEnvironmentCreateOrUpdateParameters(EnvironmentCreateOrUpdateParameters): + """Parameters supplied to the Create or Update Environment operation for a + standard environment. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The location of the resource. + :type location: str + :param tags: Key-value pairs of additional properties for the resource. + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :param data_retention_time: Required. ISO8601 timespan specifying the + minimum number of days the environment's events will be available for + query. + :type data_retention_time: timedelta + :param storage_limit_exceeded_behavior: The behavior the Time Series + Insights service should take when the environment's capacity has been + exceeded. If "PauseIngress" is specified, new events will not be read from + the event source. If "PurgeOldData" is specified, new events will continue + to be read and old events will be deleted from the environment. The + default behavior is PurgeOldData. Possible values include: 'PurgeOldData', + 'PauseIngress' + :type storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :param partition_key_properties: The list of event properties which will + be used to partition data in the environment. + :type partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + """ + + _validation = { + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'data_retention_time': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, + 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, + 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, + } + + def __init__(self, *, location: str, sku, data_retention_time, tags=None, storage_limit_exceeded_behavior=None, partition_key_properties=None, **kwargs) -> None: + super(StandardEnvironmentCreateOrUpdateParameters, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.data_retention_time = data_retention_time + self.storage_limit_exceeded_behavior = storage_limit_exceeded_behavior + self.partition_key_properties = partition_key_properties + self.kind = 'Standard' + + +class StandardEnvironmentResource(EnvironmentResource): + """An environment is a set of time-series data available for query, and is the + top level Azure Time Series Insights resource. Standard environments have + data retention limits. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param sku: Required. The sku determines the type of environment, either + standard (S1 or S2) or long-term (L1). For standard environments the sku + determines the capacity of the environment, the ingress rate, and the + billing rate. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param kind: Required. Constant filled by server. + :type kind: str + :param data_retention_time: Required. ISO8601 timespan specifying the + minimum number of days the environment's events will be available for + query. + :type data_retention_time: timedelta + :param storage_limit_exceeded_behavior: The behavior the Time Series + Insights service should take when the environment's capacity has been + exceeded. If "PauseIngress" is specified, new events will not be read from + the event source. If "PurgeOldData" is specified, new events will continue + to be read and old events will be deleted from the environment. The + default behavior is PurgeOldData. Possible values include: 'PurgeOldData', + 'PauseIngress' + :type storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :param partition_key_properties: The list of event properties which will + be used to partition data in the environment. + :type partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + :ivar data_access_id: An id used to access the environment data, e.g. to + query the environment's events or upload reference data for the + environment. + :vartype data_access_id: str + :ivar data_access_fqdn: The fully qualified domain name used to access the + environment data, e.g. to query the environment's events or upload + reference data for the environment. + :vartype data_access_fqdn: str + :param status: An object that represents the status of the environment, + and its internal state in the Time Series Insights service. + :type status: ~azure.mgmt.timeseriesinsights.models.EnvironmentStatus + :param provisioning_state: Provisioning state of the resource. Possible + values include: 'Accepted', 'Creating', 'Updating', 'Succeeded', 'Failed', + 'Deleting' + :type provisioning_state: str or + ~azure.mgmt.timeseriesinsights.models.ProvisioningState + :ivar creation_time: The time the resource was created. + :vartype creation_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'sku': {'required': True}, + 'kind': {'required': True}, + 'data_retention_time': {'required': True}, + 'data_access_id': {'readonly': True}, + 'data_access_fqdn': {'readonly': True}, + 'creation_time': {'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}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, + 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, + 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, + 'data_access_id': {'key': 'properties.dataAccessId', 'type': 'str'}, + 'data_access_fqdn': {'key': 'properties.dataAccessFqdn', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'EnvironmentStatus'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'str'}, + } + + def __init__(self, *, location: str, sku, data_retention_time, tags=None, storage_limit_exceeded_behavior=None, partition_key_properties=None, status=None, provisioning_state=None, **kwargs) -> None: + super(StandardEnvironmentResource, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.data_retention_time = data_retention_time + self.storage_limit_exceeded_behavior = storage_limit_exceeded_behavior + self.partition_key_properties = partition_key_properties + self.data_access_id = None + self.data_access_fqdn = None + self.status = status + self.provisioning_state = provisioning_state + self.creation_time = None + self.kind = 'Standard' + + +class StandardEnvironmentUpdateParameters(EnvironmentUpdateParameters): + """Parameters supplied to the Update Environment operation to update a + standard environment. + + :param tags: Key-value pairs of additional properties for the environment. + :type tags: dict[str, str] + :param sku: The sku of the environment. + :type sku: ~azure.mgmt.timeseriesinsights.models.Sku + :param data_retention_time: ISO8601 timespan specifying the minimum number + of days the environment's events will be available for query. + :type data_retention_time: timedelta + :param storage_limit_exceeded_behavior: The behavior the Time Series + Insights service should take when the environment's capacity has been + exceeded. If "PauseIngress" is specified, new events will not be read from + the event source. If "PurgeOldData" is specified, new events will continue + to be read and old events will be deleted from the environment. The + default behavior is PurgeOldData. Possible values include: 'PurgeOldData', + 'PauseIngress' + :type storage_limit_exceeded_behavior: str or + ~azure.mgmt.timeseriesinsights.models.StorageLimitExceededBehavior + :param partition_key_properties: The list of event properties which will + be used to partition data in the environment. + :type partition_key_properties: + list[~azure.mgmt.timeseriesinsights.models.TimeSeriesIdProperty] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'data_retention_time': {'key': 'properties.dataRetentionTime', 'type': 'duration'}, + 'storage_limit_exceeded_behavior': {'key': 'properties.storageLimitExceededBehavior', 'type': 'str'}, + 'partition_key_properties': {'key': 'properties.partitionKeyProperties', 'type': '[TimeSeriesIdProperty]'}, + } + + def __init__(self, *, tags=None, sku=None, data_retention_time=None, storage_limit_exceeded_behavior=None, partition_key_properties=None, **kwargs) -> None: + super(StandardEnvironmentUpdateParameters, self).__init__(tags=tags, **kwargs) + self.sku = sku + self.data_retention_time = data_retention_time + self.storage_limit_exceeded_behavior = storage_limit_exceeded_behavior + self.partition_key_properties = partition_key_properties + + +class TimeSeriesIdProperty(Model): + """The structure of the property that a time series id can have. An + environment can have multiple such properties. + + :param name: The name of the property. + :type name: str + :param type: The type of the property. Possible values include: 'String' + :type type: str or ~azure.mgmt.timeseriesinsights.models.PropertyType + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type=None, **kwargs) -> None: + super(TimeSeriesIdProperty, self).__init__(**kwargs) + self.name = name + self.type = type + + +class WarmStorageEnvironmentStatus(Model): + """An object that represents the status of warm storage on an environment. + + :param state: This string represents the state of warm storage properties + usage. It can be "Ok", "Error", "Unknown". Possible values include: 'Ok', + 'Error', 'Unknown' + :type state: str or + ~azure.mgmt.timeseriesinsights.models.WarmStoragePropertiesState + :param current_count: A value that represents the number of properties + used by the environment for S1/S2 SKU and number of properties used by + Warm Store for PAYG SKU + :type current_count: int + :param max_count: A value that represents the maximum number of properties + used allowed by the environment for S1/S2 SKU and maximum number of + properties allowed by Warm Store for PAYG SKU. + :type max_count: int + """ + + _validation = { + 'current_count': {'maximum': 10, 'minimum': 1}, + 'max_count': {'maximum': 10, 'minimum': 1}, + } + + _attribute_map = { + 'state': {'key': 'propertiesUsage.state', 'type': 'str'}, + 'current_count': {'key': 'propertiesUsage.stateDetails.currentCount', 'type': 'int'}, + 'max_count': {'key': 'propertiesUsage.stateDetails.maxCount', 'type': 'int'}, + } + + def __init__(self, *, state=None, current_count: int=None, max_count: int=None, **kwargs) -> None: + super(WarmStorageEnvironmentStatus, self).__init__(**kwargs) + self.state = state + self.current_count = current_count + self.max_count = max_count diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/operation_paged.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_paged_models.py similarity index 93% rename from src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/operation_paged.py rename to src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_paged_models.py index 73ef02f0886..bbc646194ad 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/models/operation_paged.py +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_paged_models.py @@ -14,7 +14,7 @@ class OperationPaged(Paged): """ - A paging container for iterating over a list of :class:`Operation ` object + A paging container for iterating over a list of :class:`Operation ` object """ _attribute_map = { diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_time_series_insights_client_enums.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_time_series_insights_client_enums.py new file mode 100644 index 00000000000..361e35e738e --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/models/_time_series_insights_client_enums.py @@ -0,0 +1,84 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ProvisioningState(str, Enum): + + accepted = "Accepted" + creating = "Creating" + updating = "Updating" + succeeded = "Succeeded" + failed = "Failed" + deleting = "Deleting" + + +class SkuName(str, Enum): + + s1 = "S1" + s2 = "S2" + p1 = "P1" + l1 = "L1" + + +class StorageLimitExceededBehavior(str, Enum): + + purge_old_data = "PurgeOldData" + pause_ingress = "PauseIngress" + + +class PropertyType(str, Enum): + + string = "String" + + +class IngressState(str, Enum): + + disabled = "Disabled" + ready = "Ready" + running = "Running" + paused = "Paused" + unknown = "Unknown" + + +class WarmStoragePropertiesState(str, Enum): + + ok = "Ok" + error = "Error" + unknown = "Unknown" + + +class LocalTimestampFormat(str, Enum): + + embedded = "Embedded" + iana = "Iana" + time_span = "TimeSpan" + + +class ReferenceDataKeyPropertyType(str, Enum): + + string = "String" + double = "Double" + bool_enum = "Bool" + date_time_enum = "DateTime" + + +class DataStringComparisonBehavior(str, Enum): + + ordinal = "Ordinal" + ordinal_ignore_case = "OrdinalIgnoreCase" + + +class AccessPolicyRole(str, Enum): + + reader = "Reader" + contributor = "Contributor" diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/__init__.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/__init__.py new file mode 100644 index 00000000000..c5850384c34 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/__init__.py @@ -0,0 +1,24 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._environments_operations import EnvironmentsOperations +from ._event_sources_operations import EventSourcesOperations +from ._reference_data_sets_operations import ReferenceDataSetsOperations +from ._access_policies_operations import AccessPoliciesOperations + +__all__ = [ + 'Operations', + 'EnvironmentsOperations', + 'EventSourcesOperations', + 'ReferenceDataSetsOperations', + 'AccessPoliciesOperations', +] diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_access_policies_operations.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_access_policies_operations.py new file mode 100644 index 00000000000..fb0b9da8c2b --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_access_policies_operations.py @@ -0,0 +1,382 @@ +# 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 AccessPoliciesOperations(object): + """AccessPoliciesOperations 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: Version of the API to be used with the client request. Constant value: "2018-08-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-15-preview" + + self.config = config + + def create_or_update( + self, resource_group_name, environment_name, access_policy_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update an access policy in the specified environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param access_policy_name: Name of the access policy. + :type access_policy_name: str + :param parameters: Parameters for creating an access policy. + :type parameters: + ~azure.mgmt.timeseriesinsights.models.AccessPolicyCreateOrUpdateParameters + :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: AccessPolicyResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.AccessPolicyResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_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' + 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, 'AccessPolicyCreateOrUpdateParameters') + + # 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, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessPolicyResource', response) + if response.status_code == 201: + deserialized = self._deserialize('AccessPolicyResource', 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.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} + + def get( + self, resource_group_name, environment_name, access_policy_name, custom_headers=None, raw=False, **operation_config): + """Gets the access policy with the specified name in the specified + environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param access_policy_name: The name of the Time Series Insights access + policy associated with the specified environment. + :type access_policy_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: AccessPolicyResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.AccessPolicyResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessPolicyResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} + + def update( + self, resource_group_name, environment_name, access_policy_name, description=None, roles=None, custom_headers=None, raw=False, **operation_config): + """Updates the access policy with the specified name in the specified + subscription, resource group, and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param access_policy_name: The name of the Time Series Insights access + policy associated with the specified environment. + :type access_policy_name: str + :param description: An description of the access policy. + :type description: str + :param roles: The list of roles the principal is assigned on the + environment. + :type roles: list[str or + ~azure.mgmt.timeseriesinsights.models.AccessPolicyRole] + :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: AccessPolicyResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.AccessPolicyResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + access_policy_update_parameters = models.AccessPolicyUpdateParameters(description=description, roles=roles) + + # 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'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_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(access_policy_update_parameters, 'AccessPolicyUpdateParameters') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessPolicyResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} + + def delete( + self, resource_group_name, environment_name, access_policy_name, custom_headers=None, raw=False, **operation_config): + """Deletes the access policy with the specified name in the specified + subscription, resource group, and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param access_policy_name: The name of the Time Series Insights access + policy associated with the specified environment. + :type access_policy_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:`CloudError` + """ + # 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'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies/{accessPolicyName}'} + + def list_by_environment( + self, resource_group_name, environment_name, custom_headers=None, raw=False, **operation_config): + """Lists all the available access policies associated with the + environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_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: AccessPolicyListResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.AccessPolicyListResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_environment.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'), + 'environmentName': self._serialize.url("environment_name", environment_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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessPolicyListResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/accessPolicies'} diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_environments_operations.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_environments_operations.py new file mode 100644 index 00000000000..8125a6efbdd --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_environments_operations.py @@ -0,0 +1,489 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class EnvironmentsOperations(object): + """EnvironmentsOperations 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: Version of the API to be used with the client request. Constant value: "2018-08-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-15-preview" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, environment_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'), + 'environmentName': self._serialize.url("environment_name", environment_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' + 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, 'EnvironmentCreateOrUpdateParameters') + + # 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, 201, 404]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EnvironmentResource', response) + if response.status_code == 201: + deserialized = self._deserialize('EnvironmentResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, environment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update an environment in the specified subscription and + resource group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: Name of the environment + :type environment_name: str + :param parameters: Parameters for creating an environment resource. + :type parameters: + ~azure.mgmt.timeseriesinsights.models.EnvironmentCreateOrUpdateParameters + :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 EnvironmentResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.timeseriesinsights.models.EnvironmentResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + environment_name=environment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('EnvironmentResource', 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.TimeSeriesInsights/environments/{environmentName}'} + + def get( + self, resource_group_name, environment_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the environment with the specified name in the specified + subscription and resource group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param expand: Setting $expand=status will include the status of the + internal services of the environment in the Time Series Insights + service. + :type expand: 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: EnvironmentResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.EnvironmentResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EnvironmentResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} + + + def _update_initial( + self, resource_group_name, environment_name, parameters, custom_headers=None, raw=False, **operation_config): + # 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'), + 'environmentName': self._serialize.url("environment_name", environment_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, 'EnvironmentUpdateParameters') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EnvironmentResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, environment_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates the environment with the specified name in the specified + subscription and resource group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param parameters: Request object that + contains the updated information for the environment. + :type parameters: + ~azure.mgmt.timeseriesinsights.models.StandardEnvironmentUpdateParameters + :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 EnvironmentResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.timeseriesinsights.models.EnvironmentResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.timeseriesinsights.models.EnvironmentResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + environment_name=environment_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('EnvironmentResource', 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.TimeSeriesInsights/environments/{environmentName}'} + + def delete( + self, resource_group_name, environment_name, custom_headers=None, raw=False, **operation_config): + """Deletes the environment with the specified name in the specified + subscription and resource group. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_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:`CloudError` + """ + # 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'), + 'environmentName': self._serialize.url("environment_name", environment_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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the available environments associated with the subscription + and within the specified resource group. + + :param resource_group_name: Name of an Azure Resource group. + :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: EnvironmentListResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.EnvironmentListResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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') + } + 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EnvironmentListResponse', 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.TimeSeriesInsights/environments'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the available environments within a subscription, + irrespective of the resource groups. + + :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: EnvironmentListResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.EnvironmentListResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EnvironmentListResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.TimeSeriesInsights/environments'} diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_event_sources_operations.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_event_sources_operations.py new file mode 100644 index 00000000000..dde291dc09e --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_event_sources_operations.py @@ -0,0 +1,379 @@ +# 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 EventSourcesOperations(object): + """EventSourcesOperations 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: Version of the API to be used with the client request. Constant value: "2018-08-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-15-preview" + + self.config = config + + def create_or_update( + self, resource_group_name, environment_name, event_source_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update an event source under the specified environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param event_source_name: Name of the event source. + :type event_source_name: str + :param parameters: Parameters for creating an event source resource. + :type parameters: + ~azure.mgmt.timeseriesinsights.models.EventSourceCreateOrUpdateParameters + :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: EventSourceResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.EventSourceResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'eventSourceName': self._serialize.url("event_source_name", event_source_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' + 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, 'EventSourceCreateOrUpdateParameters') + + # 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, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EventSourceResource', response) + if response.status_code == 201: + deserialized = self._deserialize('EventSourceResource', 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.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} + + def get( + self, resource_group_name, environment_name, event_source_name, custom_headers=None, raw=False, **operation_config): + """Gets the event source with the specified name in the specified + environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param event_source_name: The name of the Time Series Insights event + source associated with the specified environment. + :type event_source_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: EventSourceResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.EventSourceResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'eventSourceName': self._serialize.url("event_source_name", event_source_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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EventSourceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} + + def update( + self, resource_group_name, environment_name, event_source_name, parameters, custom_headers=None, raw=False, **operation_config): + """Updates the event source with the specified name in the specified + subscription, resource group, and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param event_source_name: The name of the Time Series Insights event + source associated with the specified environment. + :type event_source_name: str + :param tags: Key-value pairs of additional properties for the event + source. + :type tags: dict[str, 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: EventSourceResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.EventSourceResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + event_source_update_parameters = parameters + + # 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'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'eventSourceName': self._serialize.url("event_source_name", event_source_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(event_source_update_parameters, 'EventSourceUpdateParameters') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EventSourceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} + + def delete( + self, resource_group_name, environment_name, event_source_name, custom_headers=None, raw=False, **operation_config): + """Deletes the event source with the specified name in the specified + subscription, resource group, and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param event_source_name: The name of the Time Series Insights event + source associated with the specified environment. + :type event_source_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:`CloudError` + """ + # 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'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'eventSourceName': self._serialize.url("event_source_name", event_source_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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}'} + + def list_by_environment( + self, resource_group_name, environment_name, custom_headers=None, raw=False, **operation_config): + """Lists all the available event sources associated with the subscription + and within the specified resource group and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_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: EventSourceListResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.EventSourceListResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_environment.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'), + 'environmentName': self._serialize.url("environment_name", environment_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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EventSourceListResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources'} diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_operations.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_operations.py new file mode 100644 index 00000000000..dcd7df980be --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/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: Version of the API to be used with the client request. Constant value: "2018-08-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-15-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Time Series Insights related 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.timeseriesinsights.models.OperationPaged[~azure.mgmt.timeseriesinsights.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.TimeSeriesInsights/operations'} diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_reference_data_sets_operations.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_reference_data_sets_operations.py new file mode 100644 index 00000000000..f1d46529b72 --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/operations/_reference_data_sets_operations.py @@ -0,0 +1,380 @@ +# 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 ReferenceDataSetsOperations(object): + """ReferenceDataSetsOperations 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: Version of the API to be used with the client request. Constant value: "2018-08-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-08-15-preview" + + self.config = config + + def create_or_update( + self, resource_group_name, environment_name, reference_data_set_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or update a reference data set in the specified environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param reference_data_set_name: Name of the reference data set. + :type reference_data_set_name: str + :param parameters: Parameters for creating a reference data set. + :type parameters: + ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetCreateOrUpdateParameters + :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: ReferenceDataSetResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]') + } + 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, 'ReferenceDataSetCreateOrUpdateParameters') + + # 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, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ReferenceDataSetResource', response) + if response.status_code == 201: + deserialized = self._deserialize('ReferenceDataSetResource', 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.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} + + def get( + self, resource_group_name, environment_name, reference_data_set_name, custom_headers=None, raw=False, **operation_config): + """Gets the reference data set with the specified name in the specified + environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param reference_data_set_name: The name of the Time Series Insights + reference data set associated with the specified environment. + :type reference_data_set_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: ReferenceDataSetResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ReferenceDataSetResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} + + def update( + self, resource_group_name, environment_name, reference_data_set_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates the reference data set with the specified name in the specified + subscription, resource group, and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param reference_data_set_name: The name of the Time Series Insights + reference data set associated with the specified environment. + :type reference_data_set_name: str + :param tags: Key-value pairs of additional properties for the + reference data set. + :type tags: dict[str, 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: ReferenceDataSetResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetResource + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + reference_data_set_update_parameters = models.ReferenceDataSetUpdateParameters(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'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_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(reference_data_set_update_parameters, 'ReferenceDataSetUpdateParameters') + + # 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ReferenceDataSetResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} + + def delete( + self, resource_group_name, environment_name, reference_data_set_name, custom_headers=None, raw=False, **operation_config): + """Deletes the reference data set with the specified name in the specified + subscription, resource group, and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_name: str + :param reference_data_set_name: The name of the Time Series Insights + reference data set associated with the specified environment. + :type reference_data_set_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:`CloudError` + """ + # 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'), + 'environmentName': self._serialize.url("environment_name", environment_name, 'str'), + 'referenceDataSetName': self._serialize.url("reference_data_set_name", reference_data_set_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, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets/{referenceDataSetName}'} + + def list_by_environment( + self, resource_group_name, environment_name, custom_headers=None, raw=False, **operation_config): + """Lists all the available reference data sets associated with the + subscription and within the specified resource group and environment. + + :param resource_group_name: Name of an Azure Resource group. + :type resource_group_name: str + :param environment_name: The name of the Time Series Insights + environment associated with the specified resource group. + :type environment_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: ReferenceDataSetListResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.timeseriesinsights.models.ReferenceDataSetListResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_environment.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'), + 'environmentName': self._serialize.url("environment_name", environment_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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ReferenceDataSetListResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_environment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/referenceDataSets'} diff --git a/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/version.py b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/version.py new file mode 100644 index 00000000000..9bd1dfac7ec --- /dev/null +++ b/src/timeseriesinsights/azext_timeseriesinsights/vendored_sdks/timeseriesinsights/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.2.0" + diff --git a/src/timeseriesinsights/setup.cfg b/src/timeseriesinsights/setup.cfg new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/timeseriesinsights/setup.py b/src/timeseriesinsights/setup.py new file mode 100644 index 00000000000..77ae9c31d55 --- /dev/null +++ b/src/timeseriesinsights/setup.py @@ -0,0 +1,52 @@ +#!/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") + +VERSION = '0.1.1' + +# 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.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +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='timeseriesinsights', + version=VERSION, + description='Microsoft Azure Command-Line Tools TimeSeriesInsightsClient Extension', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/src/timeseriesinsights', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_timeseriesinsights': ['azext_metadata.json']}, +) diff --git a/src/vm-repair/azext_vm_repair/custom.py b/src/vm-repair/azext_vm_repair/custom.py index 6391109c71f..08e3d3f513b 100644 --- a/src/vm-repair/azext_vm_repair/custom.py +++ b/src/vm-repair/azext_vm_repair/custom.py @@ -85,8 +85,11 @@ def create(cmd, vm_name, resource_group_name, repair_password=None, repair_usern # Copy OS disk command disk_sku, location, os_type, hyperV_generation = _fetch_disk_info(resource_group_name, target_disk_name) - copy_disk_command = 'az disk create -g {g} -n {n} --source {s} --sku {sku} --location {loc} --os-type {os_type} --hyper-v-generation {hyperV} --query id -o tsv' \ - .format(g=resource_group_name, n=copy_disk_name, s=target_disk_name, sku=disk_sku, loc=location, os_type=os_type, hyperV=hyperV_generation) + copy_disk_command = 'az disk create -g {g} -n {n} --source {s} --sku {sku} --location {loc} --os-type {os_type} --query id -o tsv' \ + .format(g=resource_group_name, n=copy_disk_name, s=target_disk_name, sku=disk_sku, loc=location, os_type=os_type) + # Only add hyperV variable when available + if hyperV_generation: + copy_disk_command += ' --hyper-v-generation {hyperV}'.format(hyperV=hyperV_generation) # Validate create vm create command to validate parameters before runnning copy disk command validate_create_vm_command = create_repair_vm_command + ' --validate' diff --git a/src/vm-repair/setup.py b/src/vm-repair/setup.py index a61680b91d3..56d38f9b9f3 100644 --- a/src/vm-repair/setup.py +++ b/src/vm-repair/setup.py @@ -8,7 +8,7 @@ from codecs import open from setuptools import setup, find_packages -VERSION = "0.2.6" +VERSION = "0.2.7" CLASSIFIERS = [ 'Development Status :: 4 - Beta',